• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

1.11 Overview of accessing and changing values
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • A C++ interface to SWI-Prolog
        • A C++ interface to SWI-Prolog
          • Overview of accessing and changing values
            • Converting PlTerm to native C and C++ types
            • Unification
            • Comparison
            • Analysing compound terms
            • Miscellaneous
            • The class PlTerm_string
            • The class PlCodeList
            • The class PlCharList
            • The class PlCompound
            • The class PlTerm_tail
            • The class PlTermv
            • The class PlAtom - Supporting Prolog constants
            • Classes for the recorded database: PlRecord and PlRecordExternalCopy

1.11.3 Comparison

int PlTerm::compare(const PlTerm &t2)
bool PlTerm::operator ==(const PlTerm &)
bool PlTerm::operator !=(const PlTerm &)
bool PlTerm::operator <(const PlTerm &)
bool PlTerm::operator >(const PlTerm &)
bool PlTerm::operator <=(const PlTerm &)
bool PlTerm::operator >=(const PlTerm &)
Compare the instance with t and return the result according to the Prolog defined standard order of terms.
bool PlTerm::operator ==(long num)
bool PlTerm::operator !=(long num)
bool PlTerm::operator <(long num)
bool PlTerm::operator >(long num)
bool PlTerm::operator <=(long num)
bool PlTerm::operator >=(long num)
Convert PlTerm to a long and perform standard C-comparison between the two long integers. If PlTerm cannot be converted a type_error is raised.
bool PlTerm::operator ==(const wchar_t *)
bool PlTerm::operator ==(const char *)
bool PlTerm::operator ==(std::wstring)
bool PlTerm::operator ==(std::string)
Yields true if the PlTerm is an atom or string representing the same text as the argument, false if the conversion was successful, but the strings are not equal and an type_error exception if the conversion failed.

Below are some typical examples. See section 1.11.12.2 for direct manipulation of atoms in their internal representation.

A1 < 0Test A1 to hold a Prolog integer or float that can be transformed lossless to an integer less than zero.
A1 < PlTerm(0) A1 is before the term‘0’in the‘standard order of terms’. This means that if A1 represents an atom, this test yields true.
A1 == PlCompound("a(1)") Test A1 to represent the term a(1).
A1 == "now"Test A1 to be an atom or string holding the text “now” .

ClioPatria (version V3.1.1-51-ga0b30a5)