Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Examples

YCPBuiltinTerm.cc File Reference

#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)
 Returns the number of arguments of the term TERM.
static YCPValue t_symbolof (const YCPTerm &term)
 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.
YCPValue t_select (const YCPValue &term, const YCPValue &i, const YCPValue &def)
 Returns the symbol of the term TERM.
static YCPValue t_toterm (const YCPValue &v)
 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 ().
static YCPValue t_remove (const YCPTerm &term, const YCPInteger &i)
 Converts a value to a term.
static YCPValue t_argsof (const YCPTerm &term)
 Remove item from term.

Variables

StaticDeclaration static_declarations

Function Documentation

static YCPValue t_add const YCPTerm term,
const YCPValue value
[static]
 

Returns the number of arguments of the term TERM.

add

Parameters:
term TERM
any VALUE
Returns:
term
See also:
remove add (`VBox(`Empty()), `Label("a")) -> `VBox (`Empty (), `Label ("a")) add (`VBox(`Empty()), "a") -> `VBox (`Empty (), "a")

static YCPValue t_argsof const YCPTerm term  )  [static]
 

Remove item from term.

argsof

Parameters:
term TERM
Returns:
list
argsof (`fun(1, 2)) -> [1, 2] argsof(`TextEntry(`id("text"), "Label", "value")) -> [`id ("text"), "Label", "value"]

static YCPValue t_remove const YCPTerm term,
const YCPInteger &  i
[static]
 

Converts a value to a term.

remove

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.)

Parameters:
term TERM
integer i
Returns:
term
See also:
add remove (`fun(1, 2), 1) -> `fun(2) remove (`VBox(`Label("a"), `Label("b")), 2) -> `VBox (`Label ("a"))

YCPValue t_select const YCPValue term,
const YCPValue i,
const YCPValue def
 

Returns the symbol of the term TERM.

select (deprecated)

Parameters:
term TERM
integer ITEM
any DEFAULT
select (`hirn (true, false), 33, true) -> true

static YCPValue t_size const YCPTerm term  )  [static]
 

size

Parameters:
term TERM
Returns:
integer Size of the TERM
size (`VBox(`Empty(),`Empty(),`Empty())) -> 3

static YCPValue t_symbolof const YCPTerm term  )  [static]
 

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.

symbolof

Parameters:
term TERM
Returns:
symbol
symbolof (`hrombuch (18, false)) -> `hrombuch symbolof (`Label("string")) -> `Label

static YCPValue t_toterm const YCPValue v  )  [static]
 

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 ().

toterm

If the value can't be converted to a term, nilterm is returned.

Parameters:
any VALUE
Returns:
term toterm ("VBox") -> `VBox ()


Variable Documentation

StaticDeclaration static_declarations
 


Generated on Tue Mar 22 11:31:38 2005 for yast2-core by  doxygen 1.4.1