KJS::List Class Reference
Native list type. More...
#include <types.h>
Inheritance diagram for KJS::List:


Public Member Functions | |
List (ListImp *v) | |
List (const List &v) | |
List & | operator= (const List &v) |
void | append (const Value &val) |
Append an object to the end of the list. | |
void | prepend (const Value &val) |
Insert an object at the beginning of the list. | |
void | appendList (const List &lst) |
Appends the items of another list at the end of this one. | |
void | prependList (const List &lst) |
Prepend the items of another list to this one. | |
void | removeFirst () |
Remove the element at the beginning of the list. | |
void | removeLast () |
Remove the element at the end of the list. | |
void | remove (const Value &val) |
void | clear () |
Remove all elements from the list. | |
List | copy () const |
Returns a deep copy of the list. | |
ListIterator | begin () const |
ListIterator | end () const |
bool | isEmpty () const |
int | size () const |
Value | at (int i) const |
Retrieve an element at an indexed position. | |
Value | operator[] (int i) const |
Equivalent to at. | |
Static Public Member Functions | |
List | dynamicCast (const Value &v) |
Converts a Value into an List. | |
const List | empty () |
Returns a pointer to a static instance of an empty list. | |
Friends | |
class | ListIterator |
Detailed Description
Native list type.List is a native ECMAScript type. List values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects.
The list is explicitly shared. Note that while copy() returns a deep copy of the list the referenced objects are still shared.
Definition at line 132 of file types.h.
Member Function Documentation
|
Converts a Value into an List. If the value's type is not ListType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type List, you should check the isNull() methods afterwards before calling any methods on the returned value.
Definition at line 189 of file types.cpp. References KJS::Value::imp(), KJS::Value::isNull(), and KJS::Value::type(). |
|
Append an object to the end of the list.
Definition at line 197 of file types.cpp. Referenced by KJS::Error::create(). |
|
Insert an object at the beginning of the list.
|
|
Appends the items of another list at the end of this one.
|
|
Prepend the items of another list to this one.
The first item of |
|
Remove the element at the beginning of the list.
|
|
Remove the element at the end of the list.
|
|
Remove all elements from the list.
|
|
Returns a deep copy of the list. Ownership is passed to the user who is responsible for deleting the list then. |
|
|
|
|
|
|
|
|
|
Retrieve an element at an indexed position. If you want to iterate trough the whole list using KJS::ListIterator will be faster.
|
|
Equivalent to at.
|
|
Returns a pointer to a static instance of an empty list. Useful if a function has a List parameter. |
The documentation for this class was generated from the following files: