yast2-core
|
YCPValueRep representing a term. A YCPTermRep is a YCPValue containing a list plus a string representing the term's name. More...
#include <YCPTerm.h>
Public Member Functions | |
string | name () const |
YCPList | args () const |
YCPOrder | compare (const YCPTerm &v) const |
virtual const YCPElementRep * | shallowCopy () const |
YCPTerm | functionalAdd (const YCPValue &value) const |
string | toString () const |
std::ostream & | toStream (std::ostream &str) const |
std::ostream & | toXml (std::ostream &str, int indent) const |
bool | isEmpty () const |
int | size () const |
void | reserve (int size) |
YCPValue | value (int n) const |
void | set (const int n, const YCPValue &value) |
void | add (const YCPValue &value) |
YCPValueType | valuetype () const |
![]() | |
const char * | valuetype_str () const |
bool | isVoid () const |
bool | isBoolean () const |
bool | isInteger () const |
bool | isFloat () const |
bool | isString () const |
bool | isByteblock () const |
bool | isPath () const |
bool | isSymbol () const |
bool | isList () const |
bool | isTerm () const |
bool | isMap () const |
bool | isCode () const |
bool | isBreak () const |
bool | isReturn () const |
bool | isEntry () const |
bool | isReference () const |
bool | isExternal () const |
YCPVoid | asVoid () const |
YCPBoolean | asBoolean () const |
YCPInteger | asInteger () const |
YCPFloat | asFloat () const |
YCPString | asString () const |
YCPByteblock | asByteblock () const |
YCPPath | asPath () const |
YCPSymbol | asSymbol () const |
YCPList | asList () const |
YCPTerm | asTerm () const |
YCPMap | asMap () const |
YCPCode | asCode () const |
YCPEntry | asEntry () const |
YCPReference | asReference () const |
YCPExternal | asExternal () const |
bool | equal (const YCPValue &) const |
YCPOrder | compare (const YCPValue &v, bool rl=false) const |
![]() | |
YCPValue | asValue () const |
Protected Member Functions | |
YCPTermRep (const string &s) | |
YCPTermRep (const string &s, const YCPList &l) | |
~YCPTermRep () | |
![]() | |
YCPElementRep () | |
virtual | ~YCPElementRep () |
Private Member Functions | |
void | setName (string name) |
Private Attributes | |
Ustring | s |
YCPList | l |
Friends | |
class | YCPTerm |
YCPValueRep representing a term. A YCPTermRep is a YCPValue containing a list plus a string representing the term's name.
|
protected |
Creates a new and empty term with the string s.
Referenced by shallowCopy().
|
protected |
Creates a new term with the string s and argument list l.
|
inlineprotected |
Cleans up
References add(), args(), compare(), functionalAdd(), isEmpty(), name(), reserve(), shallowCopy(), size(), str, toStream(), toString(), toXml(), value(), and valuetype().
void YCPTermRep::add | ( | const YCPValue & | value | ) |
Mapping for the term's list add() function
References YCPList::add(), and l.
Referenced by ~YCPTermRep().
YCPList YCPTermRep::args | ( | ) | const |
Compares two YCPTerms for equality, greaterness or smallerness. The relation is lexicographically with respect to
(( alpha() ==
alpha() ) == true ) (( alpha() <
alpha( 1 ) ) == true ) (( alpha( 1 ) ==
alpha( 1 ) ) == true ) (( alpha( 1 ) <
beta( 1 ) ) == true ) (( alpha( 1 ) <
alpha( 2 ) ) == true ) (( alpha( 1 ) < { term b =
beta( 1 ); return b; } ) == true ) #term/term (( alpha( 1 ) > { term b =
beta( 1 ); } ) == true ) #term/nil
v | value to compare against |
References YCPTerm::args(), l, name(), YCPTerm::name(), YO_GREATER, and YO_LESS.
Referenced by ~YCPTermRep().
Creates a new term, that is identical to this one with but one new value appended. Doesn't change this term.
References Ustring::asString(), YCPList::functionalAdd(), l, s, and YCPTerm.
Referenced by ~YCPTermRep().
bool YCPTermRep::isEmpty | ( | ) | const |
Mapping for the term's list isEmpty() function
References YCPList::isEmpty(), and l.
Referenced by ~YCPTermRep().
string YCPTermRep::name | ( | ) | const |
Returns the term's name
References Ustring::asString(), and s.
Referenced by compare(), and ~YCPTermRep().
void YCPTermRep::reserve | ( | int | size | ) |
Mapping for the term's list reserve (int) function
References l, and YCPList::reserve().
Referenced by ~YCPTermRep().
void YCPTermRep::set | ( | const int | n, |
const YCPValue & | value | ||
) |
Mapping for the term's list set() function
References l, and YCPList::set().
|
private |
Set the new term name
References SymbolEntry::_nameHash, and s.
|
virtual |
Creates a copy of this term, i.e. creates a new term with the same elements and the same name as this one. The elements themselves are not copied, but only cloned!
Reimplemented from YCPElementRep.
References Ustring::asString(), l, s, and YCPTermRep().
Referenced by ~YCPTermRep().
int YCPTermRep::size | ( | ) | const |
Mapping for the term's list size() function
References l, and YCPList::size().
Referenced by ~YCPTermRep().
|
virtual |
Output value as bytecode to stream
Implements YCPElementRep.
References l, s, Bytecode::writeUstring(), and y2debug.
Referenced by ~YCPTermRep().
|
virtual |
Returns an ASCII representation of the term. Term are denoted by comma separated values enclosed by brackets precedeed by a name, for example a(1,2) or
b() or `Hugo_17("hirn", c(true)).
Implements YCPElementRep.
References Ustring::asString(), YCPList::commaList(), l, and s.
Referenced by ~YCPTermRep().
|
virtual |
YCPValue YCPTermRep::value | ( | int | n | ) | const |
Mapping for the term's list value() function
References l, and YCPList::value().
Referenced by YCPTerm::set(), and ~YCPTermRep().
|
virtual |
Returns YT_TERM. See YCPValueRep::valuetype.
Implements YCPValueRep.
References YT_TERM.
Referenced by ~YCPTermRep().
|
friend |
Referenced by functionalAdd(), and YCPTerm::YCPTerm().
|
private |
YCP list representing the term's arguments
Referenced by add(), args(), compare(), functionalAdd(), isEmpty(), reserve(), set(), shallowCopy(), size(), toStream(), toString(), toXml(), and value().
|
private |
The terms name
Referenced by functionalAdd(), name(), setName(), shallowCopy(), toStream(), toString(), and toXml().