• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • KJS
  • List
Public Member Functions | Static Public Member Functions | List of all members
KJS::List Class Reference

#include <list.h>

Public Member Functions

 List (bool needsMarking)
 
 List (const List &b)
 
List & operator= (const List &)
 
void append (const Value &val)
 
void append (ValueImp *val)
 
void clear ()
 
List copy () const
 
List copyTail () const
 
bool isEmpty () const
 
int size () const
 
ListIterator begin () const
 
ListIterator end () const
 
Value at (int i) const
 
Value operator[] (int i) const
 
ValueImp * impAt (int i) const
 
void mark ()
 

Static Public Member Functions

static const List & empty ()
 

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 48 of file list.h.

Constructor & Destructor Documentation

◆ List() [1/3]

KJS::List::List ( )

Definition at line 121 of file list.cpp.

◆ List() [2/3]

KJS::List::List ( bool  needsMarking)

Definition at line 139 of file list.cpp.

◆ ~List()

KJS::List::~List ( )
inline

Definition at line 52 of file list.h.

◆ List() [3/3]

KJS::List::List ( const List &  b)
inline

Definition at line 54 of file list.h.

Member Function Documentation

◆ append() [1/2]

void KJS::List::append ( const Value &  val)
inline

Append an object to the end of the list.

Parameters
valPointer to object.

Definition at line 66 of file list.h.

◆ append() [2/2]

void KJS::List::append ( ValueImp *  val)

Definition at line 246 of file list.cpp.

◆ at()

Value KJS::List::at ( int  i) const
inline

Retrieve an element at an indexed position.

If you want to iterate trough the whole list using KJS::ListIterator will be faster.

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

Definition at line 108 of file list.h.

◆ begin()

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

Definition at line 186 of file list.h.

◆ clear()

void KJS::List::clear ( )

Remove all elements from the list.

Definition at line 238 of file list.cpp.

◆ copy()

List KJS::List::copy ( ) const

Make a copy of the list.

Definition at line 281 of file list.cpp.

◆ copyTail()

List KJS::List::copyTail ( ) const

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

Definition at line 302 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 322 of file list.cpp.

◆ end()

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

Definition at line 187 of file list.h.

◆ impAt()

ValueImp * KJS::List::impAt ( int  i) const

Definition at line 228 of file list.cpp.

◆ isEmpty()

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

Definition at line 86 of file list.h.

◆ mark()

void KJS::List::mark ( )
inline

Definition at line 122 of file list.h.

◆ operator=()

List & KJS::List::operator= ( const List &  b)
inline

Definition at line 189 of file list.h.

◆ operator[]()

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

Equivalent to at.

Definition at line 112 of file list.h.

◆ size()

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

Definition at line 90 of file list.h.


The documentation for this class was generated from the following files:
  • list.h
  • list.cpp

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kjs by doxygen 1.9.4
This website is maintained by Timothy Pearson.