Polycode
Polycode::ObjectEntry Class Reference

Single entry in an Object. More...

List of all members.

Public Member Functions

 ObjectEntry ()
 Default constructor.
ObjectEntryaddChild (const String &name)
 Adds an empty child entry.
ObjectEntryaddChild (const String &name, Number val)
 Adds an empty child entry with a number value.
ObjectEntryaddChild (const String &name, int val)
 Adds an empty child entry with an integer value.
ObjectEntryaddChild (const String &name, const String &val)
 Adds an empty child entry with a string value.
ObjectEntryaddChild (const String &name, bool val)
 Adds an empty child entry with a boolean value.
ObjectEntryoperator[] (int index)
 Accesses an object entry as an array by an integer lookup.
ObjectEntryoperator[] (const String &key)
 Accesses an object entry by a string lookup and returns the corresponding object entry.

Public Attributes

int type
 Type of entry.
String name
 Lookup key for this object entry.
Number NumberVal
 Number value of this object entry.
int intVal
 Integer value of this object entry.
String stringVal
 String value of this object entry.
bool boolVal
 Boolean value of this object entry.
int length
 Length of this object entry if its type is ARRAY_ENTRY.

Detailed Description

Single entry in an Object.

Object entries can be accessed as dictionaries or arrays.


Member Function Documentation

ObjectEntry* Polycode::ObjectEntry::addChild ( const String name) [inline]

Adds an empty child entry.

Parameters:
nameLookup key for the object entry.
Returns:
The added object entry.
ObjectEntry* Polycode::ObjectEntry::addChild ( const String name,
Number  val 
) [inline]

Adds an empty child entry with a number value.

Parameters:
nameLookup key for the object entry.
valNumber to set as value in the object entry.
Returns:
The added object entry.
ObjectEntry* Polycode::ObjectEntry::addChild ( const String name,
int  val 
) [inline]

Adds an empty child entry with an integer value.

Parameters:
nameLookup key for the object entry.
valInteger to set as value in the object entry.
Returns:
The added object entry.
ObjectEntry* Polycode::ObjectEntry::addChild ( const String name,
const String val 
) [inline]

Adds an empty child entry with a string value.

Parameters:
nameLookup key for the object entry.
valString to set as value in the object entry.
Returns:
The added object entry.
ObjectEntry* Polycode::ObjectEntry::addChild ( const String name,
bool  val 
) [inline]

Adds an empty child entry with a boolean value.

Parameters:
nameLookup key for the object entry.
valBoolean to set as value in the object entry.
Returns:
The added object entry.
ObjectEntry* Polycode::ObjectEntry::operator[] ( int  index) [inline]

Accesses an object entry as an array by an integer lookup.

Parameters:
indexLookup index to return value for.
Returns:
Object entry corresponding to the lookup index or NULL if one doesn't exist.
ObjectEntry* Polycode::ObjectEntry::operator[] ( const String key) [inline]

Accesses an object entry by a string lookup and returns the corresponding object entry.

Parameters:
keyLookup key to return value for.
Returns:
Object entry corresponding to the string value or NULL if one doesn't exist.

Member Data Documentation

Type of entry.

Possible values are (FLOAT_ENTRY, INT_ENTRY, BOOL_ENTRY, ARRAY_ENTRY, STRING_ENTRY, CONTAINER_ENTRY).