#include <YCPPath.h>
Inheritance diagram for YCPPathRep:
Public Member Functions | |
bool | isRoot () const |
YCPValue | select (const YCPValue &val) |
void | append (const YCPPath &p) |
void | append (string c) |
long | length () const |
bool | isPrefixOf (const YCPPath &p) const |
YCPPath | at (long index) const |
string | component_str (long index) const |
YCPOrder | compare (const YCPPath &v) const |
string | toString () const |
std::ostream & | toStream (std::ostream &str) const |
YCPValueType | valuetype () const |
Protected Member Functions | |
YCPPathRep () | |
YCPPathRep (const char *r) | |
void | append (const Component &c) |
Private Attributes | |
vector< Component > | components |
Friends | |
class | YCPPath |
Classes | |
struct | Component |
YCPSyntax: A single dot or any sequence of dot-symbol pairs. The symbols may consist of digits, letters and underscores.
. .etc .1.2.127 .etc.fstab.7
|
Creates a new root path. The ASCII representation of the root path is a single dot. |
|
Creates a new path from its ASCII representation. |
|
Appends a component to the path. |
|
Append path to this |
|
Appends component to path. |
|
Returns a postfix of the path. You must check, that the index you give is 0 <= i < length.
|
|
Compares two YCPPaths for equality, greaterness or smallerness.
|
|
Returns one component of the path as string. No error check is done for index. You must check yourself that 0 < index < length. |
|
Checks if this path is a prefix of path p. This holds, if this path has size n and the first n components of p are exactly those of this path. The root path is prefix of any path. That path .a.b is a prefix of .a.b.c but not of the path .a.bc |
|
Returns true, if this is a root path. |
|
Returns the length of the path, i.e. the number of components. The root path has length 0. |
|
Selects the subtree of a YCPValueRep, that is denoted by this path. If this is the root path, select(v) simply returns v. If v is a list or a term, the first component of the path selects an element of the list and evalutes recursivly remainingpath->select(list_element). Returns a 0 pointer, if the path was incorrect. |
|
Output value as bytecode to stream Implements YCPElementRep. |
|
Returns a string representation of this object, that may be parsed by the YCP parser. A path is denoted by a list symbols or number separated by dots, e.g. . or .12 or .eth0.12 Implements YCPElementRep. |
|
Returns YT_PATH. See YCPValueRep::valuetype. Implements YCPValueRep. |
|
|
|
|