#include "ycp/YCPBuiltinTerm.h"#include "ycp/YCPTerm.h"#include "ycp/YCPInteger.h"#include "ycp/YCPString.h"#include "ycp/StaticDeclaration.h"#include "ycp/y2log.h"Functions | |
| static YCPValue | t_size (const YCPTerm &term) |
| static YCPValue | t_add (const YCPTerm &term, const YCPValue &value) |
| static YCPValue | t_symbolof (const YCPTerm &term) |
| YCPValue | t_select (const YCPValue &term, const YCPValue &i, const YCPValue &def) |
| static YCPValue | t_toterm (const YCPValue &v) |
| static YCPValue | t_remove (const YCPTerm &term, const YCPInteger &i) |
| static YCPValue | t_argsof (const YCPTerm &term) |
Variables | |
| StaticDeclaration | static_declarations |
add Add value to term Adds the value VALUE to the term TERM and returns the newly created term. As always in YCP, TERM is not modified.
| term | TERM | |
| any | VALUE |
argsof Returns the arguments of a term.
| term | TERM |
| static YCPValue t_remove | ( | const YCPTerm & | term, | |
| const YCPInteger & | i | |||
| ) | [static] |
remove Remove item from term
Remove the i'th value from a term. The first value has the index 1 (!). (The index counting is for compatibility reasons with the 'old' remove which allowed 'remove(`term(1,2,3), 0) = [1,2,3]' Use 'argsof (term) -> list' for this kind of transformation.)
| term | TERM | |
| integer | i |
select (deprecated, use TERM[ITEM]:DEFAULT) Select item from term Gets the i'th value of the term t. The first value has the index 0. The call select ([1, 2, 3], 1) thus returns 2. Returns the default if the index is invalid or the found value has a diffetent type that default. Functionality replaced with syntax: term a = `VBox(`VSpacing(2), `Label("string"), `VSpacing(2)); a[1]:`Empty() -> `Label ("string") a[9]:`Empty() -> `Empty ()
| term | TERM | |
| integer | ITEM | |
| any | DEFAULT |
size Returns the number of arguments of the term TERM.
| term | TERM |
TERM
symbolof Returns the symbol of the term TERM.
| term | TERM |
toterm Converts a value to a term.
If the value can't be converted to a term, nilterm is returned.
| any | VALUE |
1.5.3