KJS::List

Search for usage in LXR

#include <list.h>

Public Member Functions

 List (const List &b)
 
void append (JSValue *val)
 
JSValueat (int i) const
 
JSValueatUnchecked (int i) const
 
ListIterator begin () const
 
void clear ()
 
List copy () const
 
List copyTail () const
 
ListIterator end () const
 
bool isEmpty () const
 
Listoperator= (const List &)
 
JSValueoperator[] (int i) const
 
void reset ()
 
int size () const
 

Static Public Member Functions

static const Listempty ()
 
static void markProtectedLists ()
 

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 copyTail() returns a copy of the list the referenced objects are still shared.

Definition at line 52 of file list.h.

Member Function Documentation

◆ append()

void KJS::List::append ( JSValue val)
inline

Append an object to the end of the list.

Parameters
valPointer to object.

Definition at line 186 of file list.h.

◆ at()

JSValue * KJS::List::at ( int  i) const
inline

Retrieve an element at an indexed position.

Parameters
iList index.
Returns
Return the element at position i. KJS::Undefined if the index is out of range.

Definition at line 177 of file list.h.

◆ begin()

ListIterator KJS::List::begin ( ) const
inline
Returns
A KJS::ListIterator pointing to the first element.

Definition at line 275 of file list.h.

◆ clear()

void KJS::List::clear ( )
inline

Remove all elements from the list.

Definition at line 77 of file list.h.

◆ copy()

List KJS::List::copy ( ) const

Make a copy of the list.

Definition at line 250 of file list.cpp.

◆ copyTail()

List KJS::List::copyTail ( ) const

Make a copy of the list, omitting the first element.

Definition at line 281 of file list.cpp.

◆ empty()

const List & KJS::List::empty ( )
static

Returns a pointer to a static instance of an empty list.

Useful if a function has a KJS::List parameter.

Definition at line 311 of file list.cpp.

◆ end()

ListIterator KJS::List::end ( ) const
inline
Returns
A KJS::ListIterator pointing to the last element.

Definition at line 279 of file list.h.

◆ isEmpty()

bool KJS::List::isEmpty ( ) const
inline
Returns
true if the list is empty. false otherwise.

Definition at line 104 of file list.h.

◆ operator[]()

JSValue* KJS::List::operator[] ( int  i) const
inline

Equivalent to at.

Definition at line 145 of file list.h.

◆ size()

int KJS::List::size ( ) const
inline
Returns
the current size of the list.

Definition at line 112 of file list.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 03:59:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.