#include <set>#include <algorithm>#include "ycp/YCPBuiltinList.h"#include "ycp/YCPList.h"#include "ycp/YCPMap.h"#include "ycp/YCPSymbol.h"#include "ycp/YCPString.h"#include "ycp/YCPBoolean.h"#include "ycp/YCPInteger.h"#include "ycp/YCPVoid.h"#include "ycp/YCPCode.h"#include "ycp/YCPCodeCompare.h"#include "ycp/YCPTerm.h"#include "ycp/StaticDeclaration.h"#include "ycp/y2log.h"Defines | |
| #define | ETC 0, NULL, constTypePtr(), NULL |
| #define | ETCf NULL, constTypePtr(), NULL |
Functions | |
| static YCPValue | l_find (const YCPSymbol &symbol, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_prepend (const YCPList &list, const YCPValue &value) |
| static YCPValue | l_contains (const YCPList &list, const YCPValue &value) |
| static YCPValue | l_setcontains (const YCPList &list, const YCPValue &value) |
| static YCPValue | l_unionlist (const YCPList &list1, const YCPList &list2) |
| static YCPValue | l_mergelist (const YCPList &list1, const YCPList &list2) |
| static YCPValue | l_sublist1 (const YCPList &list, const YCPInteger &offset) |
| static YCPValue | l_sublist2 (const YCPList &list, const YCPInteger &offset, const YCPInteger &length) |
| static YCPValue | l_filter (const YCPSymbol &symbol, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_maplist (const YCPSymbol &symbol, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_listmap (const YCPSymbol &symbol, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_flatten (const YCPList &list) |
| static YCPValue | l_toset (const YCPList &list) |
| static YCPValue | l_sortlist (const YCPList &list) |
| static YCPValue | l_sort (const YCPValue &sym1, const YCPValue &sym2, const YCPList &list, const YCPCode &order) |
| static YCPValue | l_lsortlist (const YCPList &list) |
| static YCPValue | l_splitstring (const YCPString &s, const YCPString &c) |
| static YCPValue | l_changelist (YCPList &list, const YCPValue &value) |
| static YCPValue | l_add (const YCPList &list, const YCPValue &value) |
| static YCPValue | l_isempty (const YCPList &l) |
| static YCPValue | l_size (const YCPValue &list) |
| static YCPValue | l_remove (const YCPList &list, const YCPInteger &i) |
| static YCPValue | l_select (const YCPValue &list, const YCPValue &i, const YCPValue &def) |
| static YCPValue | l_foreach (const YCPValue &sym, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_reduce_helper (const YCPSymbol &x, const YCPSymbol &y, const YCPValue &initial, const YCPList::const_iterator &first, const YCPList::const_iterator &last, const YCPCode &expr) |
| static YCPValue | l_reduce1 (const YCPSymbol &x, const YCPSymbol &y, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_reduce2 (const YCPSymbol &x, const YCPSymbol &y, const YCPValue &initial, const YCPList &list, const YCPCode &expr) |
| static YCPValue | l_swaplist (const YCPList &v, YCPInteger &i1, YCPInteger &i2) |
| static YCPValue | l_tolist (const YCPValue &v) |
Variables | |
| StaticDeclaration | static_declarations |
| #define ETC 0, NULL, constTypePtr(), NULL |
| #define ETCf NULL, constTypePtr(), NULL |
add add-list Create a new list with a new element
| list | LIST
|
References YCPList::functionalAdd(), and YCPElement::isNull().
Referenced by YCPBuiltinList::YCPBuiltinList().
change change-list Changes a list. Deprecated, use LIST[size(LIST)] = value.
| list | LIST
|
References YCPList::add(), YCPElement::isNull(), and ycpinternal.
Referenced by YCPBuiltinList::YCPBuiltinList().
contains Checks if a list contains an element
| list | LIST List
|
References YCPList::contains().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_filter | ( | const YCPSymbol & | symbol, | |
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
filter filter-list Filters a List
| any | VAR Variable
|
References YCPList::add(), YCPList::begin(), YCPList::end(), YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_find | ( | const YCPSymbol & | symbol, | |
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
find find-list Searches for the first occurence of a certain element in a list
| any | VAR
|
References YCPList::begin(), YCPList::end(), YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
flatten Flattens List
| list<list> | LIST
LIST and creates a single list that is the concatenation of those lists in LIST. |
References YCPList::add(), YCPElement::isNull(), YCPList::size(), YCPList::value(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_foreach | ( | const YCPValue & | sym, | |
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
foreach foreach-list Processes the content of a list
| any | VAR
|
References YCPList::begin(), YCPList::end(), YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
isempty isempty-list Returns whether the list l is empty.
| list | l List
l must not be nil. |
References YCPList::isEmpty().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_listmap | ( | const YCPSymbol & | symbol, | |
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
listmap Maps an operation onto all elements of a list and thus creates a map.
| any | VAR
|
References YCPMap::add(), YCPMap::begin(), YCPList::begin(), YCPList::end(), YCPElement::isNull(), YCPMap::size(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
lsort Sort A List respecting locale
| list | LIST
|
References YCPElement::isNull(), and YCPList::lsortlist().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_maplist | ( | const YCPSymbol & | symbol, | |
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
maplist maplist-list Maps an operation onto all elements of a list and thus creates a new list.
| any | VAR
|
References YCPList::add(), YCPList::begin(), YCPList::end(), YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
merge Merges two lists into one
| list | LIST1 First List
|
References YCPList::add(), YCPElement::isNull(), YCPList::size(), and YCPList::value().
Referenced by YCPBuiltinList::YCPBuiltinList().
prepend Prepends a list with a new element
| list | LIST List
|
References YCPList::functionalAdd(), and YCPElement::isNull().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_reduce1 | ( | const YCPSymbol & | x, | |
| const YCPSymbol & | y, | |||
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
list::reduce list.reduce-internal Reduces a list to a single value.
| flex1 | x
|
References YCPList::begin(), YCPList::end(), YCPList::isEmpty(), l_reduce_helper(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_reduce2 | ( | const YCPSymbol & | x, | |
| const YCPSymbol & | y, | |||
| const YCPValue & | initial, | |||
| const YCPList & | list, | |||
| const YCPCode & | expr | |||
| ) | [static] |
list::reduce list.reduce-external Reduces a list to a single value.
| flex1 | x
|
References YCPList::begin(), YCPList::end(), and l_reduce_helper().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_reduce_helper | ( | const YCPSymbol & | x, | |
| const YCPSymbol & | y, | |||
| const YCPValue & | initial, | |||
| const YCPList::const_iterator & | first, | |||
| const YCPList::const_iterator & | last, | |||
| const YCPCode & | expr | |||
| ) | [static] |
References YCPElement::isNull(), and ycp2error.
Referenced by l_reduce1(), and l_reduce2().
| static YCPValue l_remove | ( | const YCPList & | list, | |
| const YCPInteger & | i | |||
| ) | [static] |
remove remove-list Removes element from a list
| list | LIST
|
References YCPElement::isNull(), YCPList::remove(), YCPList::size(), toString(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_select | ( | const YCPValue & | list, | |
| const YCPValue & | i, | |||
| const YCPValue & | def | |||
| ) | [static] |
select select-list Selects a list element (deprecated, use LIST[INDEX]:DEFAULT)
| list | LIST
|
References YCPElement::isNull(), t_select(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
setcontains Checks if a sorted list contains an element
| list | LIST List
|
References YCPList::begin(), and YCPList::end().
Referenced by YCPBuiltinList::YCPBuiltinList().
size size-list Returns size of list
| list | LIST
LIST |
References YCPElement::isNull().
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_sort | ( | const YCPValue & | sym1, | |
| const YCPValue & | sym2, | |||
| const YCPList & | list, | |||
| const YCPCode & | order | |||
| ) | [static] |
sort sort-expr Sort list using an expression
| any | x
|
References YCPList::fsortlist(), and YCPElement::isNull().
Referenced by YCPBuiltinList::YCPBuiltinList().
sort sort-lt Sorts a List according to the YCP builtin predicate
| list | LIST
|
References YCPElement::isNull(), and YCPList::sortlist().
Referenced by YCPBuiltinList::YCPBuiltinList().
splitstring Split a string by delimiter
| string | STR
STR starts with DELIM, the first string in the result list is empty If STR ends with DELIM, the last string in the result list is empty. If STR does not contain DELIM, the result is a singleton list with STR. |
References YCPList::add(), YCPElement::isNull(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_sublist1 | ( | const YCPList & | list, | |
| const YCPInteger & | offset | |||
| ) | [static] |
sublist sublist-rest Extracts a sublist
Extracts a sublist of the list LIST starting at OFFSET. The OFFSET starts with 0.
| list | LIST
|
References YCPList::add(), YCPElement::isNull(), YCPList::size(), toString(), YCPList::value(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_sublist2 | ( | const YCPList & | list, | |
| const YCPInteger & | offset, | |||
| const YCPInteger & | length | |||
| ) | [static] |
sublist sublist-length Extracts a sublist
Extracts a sublist of the list LIST starting at OFFSET with length LENGTH. The OFFSET starts with 0.
| list | LIST
|
References YCPList::add(), YCPElement::isNull(), YCPList::size(), toString(), YCPList::value(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
| static YCPValue l_swaplist | ( | const YCPList & | v, | |
| YCPInteger & | i1, | |||
| YCPInteger & | i2 | |||
| ) | [static] |
list::swap list.swap Creates new list with swaped elemetns at offset i1 and i2.
| list<flex1> | v list
|
References YCPElement::isNull(), YCPList::size(), YCPList::swap(), and ycp2error.
Referenced by YCPBuiltinList::YCPBuiltinList().
tolist Converts a value to a list (deprecated, use (list)VAR).
| any | VAR
any l_1 = [1, 2, 3]; list <integer> l_2 = (list<integer>) l_1; |
References YCPElement::isNull(), and YT_LIST.
Referenced by YCPBuiltinList::YCPBuiltinList().
toset Sorts list and removes duplicates
| list | LIST
|
References YCPList::begin(), and YCPList::end().
Referenced by YCPBuiltinList::YCPBuiltinList().
union union-list Unions of lists
| list | LIST1 First List
|
References YCPList::add(), YCPList::contains(), YCPElement::isNull(), YCPList::size(), and YCPList::value().
Referenced by YCPBuiltinList::YCPBuiltinList().
1.6.3