yast2-core
Macros | Functions | Variables
YCPBuiltinPath.cc File Reference
#include "ycp/YCPBuiltinPath.h"
#include "ycp/YCPPath.h"
#include "ycp/YCPString.h"
#include "ycp/YCPInteger.h"
#include "ycp/StaticDeclaration.h"

Macros

#define ETC   0, NULL, constTypePtr(), NULL
 
#define ETCf   NULL, constTypePtr(), NULL
 

Functions

static YCPValue p_size (const YCPPath &path)
 
static YCPValue p_add (const YCPPath &path, const YCPString &s)
 
static YCPValue p_plus (const YCPPath &path1, const YCPPath &path2)
 
static YCPValue p_topath (const YCPValue &v)
 

Variables

StaticDeclaration static_declarations
 

Macro Definition Documentation

#define ETC   0, NULL, constTypePtr(), NULL
#define ETCf   NULL, constTypePtr(), NULL

Function Documentation

static YCPValue p_add ( const YCPPath path,
const YCPString s 
)
static

add add-path Add a path element to existing path

Returns PATH with added path element created from string STR.

Parameters
pathPATH
stringor path STR
Returns
path

add (.aaa, "anypath...\n\"") -> .aaa."anypath...
"" add (.sysconfig, .safety) -> .sysconfig.safety

References YCPElement::isNull().

Referenced by YCPBuiltinPath::YCPBuiltinPath().

static YCPValue p_plus ( const YCPPath path1,
const YCPPath path2 
)
static

path p1 + path p2 -> path Returns p1 with added p2 element created from string s.

Example:

.aaa + "anypath...\n\"" -> .aaa."anypath...
""

References YCPElement::isNull().

Referenced by YCPBuiltinPath::YCPBuiltinPath().

static YCPValue p_size ( const YCPPath path)
static

size size-path Returns the number of path elements

Returns the number of path elements of the path PATH, i.e. the length of PATH.

Parameters
pathPATH
Returns
integer Number of elements in the path

size (.hello.world) -> 2 size (.) -> 0

References YCPElement::isNull().

Referenced by YCPBuiltinPath::YCPBuiltinPath().

static YCPValue p_topath ( const YCPValue v)
static

topath Converts a value to a path. If the value can't be converted to a path, nilpath is returned.

Parameters
stringSTR
Returns
path

topath ("path") -> .path topath (".some.path") -> .some.path

References YCPElement::isNull(), YT_PATH, and YT_STRING.

Referenced by YCPBuiltinPath::YCPBuiltinPath().

Variable Documentation

StaticDeclaration static_declarations

Generated on a sunny day for yast2-core by doxygen 1.8.6