CrystalSpace

Public API Reference

csKeyValuePair Class Reference

A Key Value pair. More...

#include <cstool/keyval.h>

Inheritance diagram for csKeyValuePair:

List of all members.

Public Member Functions

 csKeyValuePair (const char *Key)
 The constructor. Requires only key.
 csKeyValuePair (const char *Key, const char *Value)
 The constructor. Requires both key and value. Data is being copied!
void SetEditorOnly (bool flag)
 Set the "editor only" flag of this key value pair.
virtual ~csKeyValuePair ()
 The destructor as usual.
iKeyValuePair implementation



virtual bool GetEditorOnly () const
 Query whether this pair is an "editor-only" pair.
virtual const char * GetKey () const
 Get the key string of the pair.
virtual const char * GetValue (const char *vname) const
 Get a value string from the pair.
virtual const char * GetValue () const
 Get the 'value' string of the pair.
virtual csRef< iStringArrayGetValueNames () const
 Get a list of the names of values in the pair.
virtual iObjectQueryObject ()
 Get the iObject.
virtual void SetKey (const char *s)
 Set the key string of the pair.
virtual void SetValue (const char *vname, const char *value)
 Set a value string of the pair.
virtual void SetValue (const char *value)
 Set the value string of the pair.

Detailed Description

A Key Value pair.

This object contains a 'key' string and a 'value' string. The 'key' string is the same as the name of the object as returned from the iObject.

One way to attach key value pairs to CS objects is to add the following xml to your object: <key name="somename" value="somevalue" />

Definition at line 43 of file keyval.h.


Constructor & Destructor Documentation

csKeyValuePair::csKeyValuePair ( const char *  Key,
const char *  Value 
)

The constructor. Requires both key and value. Data is being copied!

csKeyValuePair::csKeyValuePair ( const char *  Key  ) 

The constructor. Requires only key.

virtual csKeyValuePair::~csKeyValuePair (  )  [virtual]

The destructor as usual.


Member Function Documentation

virtual bool csKeyValuePair::GetEditorOnly (  )  const [inline, virtual]

Query whether this pair is an "editor-only" pair.

They're marked as such in world files and are normally not kept in memory.

Implements iKeyValuePair.

Definition at line 75 of file keyval.h.

virtual const char* csKeyValuePair::GetKey (  )  const [virtual]

Get the key string of the pair.

Implements iKeyValuePair.

virtual const char* csKeyValuePair::GetValue ( const char *  vname  )  const [virtual]

Get a value string from the pair.

Implements iKeyValuePair.

virtual const char* csKeyValuePair::GetValue (  )  const [virtual]

Get the 'value' string of the pair.

This is the same as calling 'GetValue ("value")'.

Implements iKeyValuePair.

virtual csRef<iStringArray> csKeyValuePair::GetValueNames (  )  const [virtual]

Get a list of the names of values in the pair.

Implements iKeyValuePair.

virtual iObject* csKeyValuePair::QueryObject (  )  [inline, virtual]

Get the iObject.

Implements iKeyValuePair.

Definition at line 65 of file keyval.h.

void csKeyValuePair::SetEditorOnly ( bool  flag  )  [inline]

Set the "editor only" flag of this key value pair.

Definition at line 60 of file keyval.h.

virtual void csKeyValuePair::SetKey ( const char *  key  )  [virtual]

Set the key string of the pair.

Implements iKeyValuePair.

virtual void csKeyValuePair::SetValue ( const char *  vname,
const char *  value 
) [virtual]

Set a value string of the pair.

Implements iKeyValuePair.

virtual void csKeyValuePair::SetValue ( const char *  value  )  [virtual]

Set the value string of the pair.

This is the same as calling 'SetValue ("value", value)'.

Implements iKeyValuePair.


The documentation for this class was generated from the following file:

Generated for Crystal Space 2.0 by doxygen 1.6.1