Clarisse 4.0 SP9 SDK  4.0.0.0.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Friends | List of all members
ParserEntry Class Reference

Public Types

enum  Type {
  TYPE_REGULAR,
  TYPE_KEYWORD,
  TYPE_FUNCTION,
  TYPE_RAW_TEXT
}
 

Public Member Functions

 ParserEntry (const CoreString &name, const Type &type=TYPE_REGULAR, const unsigned long &line=0, const unsigned long &column=0)
 Constructor.
 
 ParserEntry (const ParserEntry &entry)
 Copy Constructor.
 
virtual ~ParserEntry ()
 Destructor.
 
void copy_from (const ParserEntry &entry)
 Copies the content of this entry by the content of the specified entry.
 
const CoreStringget_name () const
 
void rename (const CoreString &name)
 
const unsigned long & get_line () const
 
const unsigned long & get_column () const
 
const unsigned int & get_value_count () const
 
ParserValue::Type get_value_type (const unsigned int &index=0) const
 
void reset ()
 Clears parser entry content.
 
bool is_group () const
 returns true if entry is a group, false otherwise.
 
const Type & get_type () const
 
bool is_array () const
 
void set_array (const bool &flag, const unsigned int &count=0)
 
const unsigned int & get_array_count () const
 
bool is_template () const
 
void set_template (const CoreString &type)
 
const CoreStringget_template () const
 
void set_as_raw_text (bool is_raw_text)
 
bool is_value_bool (const unsigned int &index=0) const
 
bool is_value_char (const unsigned int &index=0) const
 
bool is_value_int (const unsigned int &index=0) const
 
bool is_value_double (const unsigned int &index=0) const
 
bool is_value_string (const unsigned int &index=0) const
 
bool is_value_group (const unsigned int &index=0) const
 
void add_bool (const bool &value)
 adds a new bool value
 
void add_char (const char &value)
 adds a new char value
 
void add_int (const int &value)
 adds a new int value
 
void add_double (const double &value)
 adds a new double value
 
void add_vec2i (const GMathVec2i &value)
 adds a new vec2i value
 
void add_vec2d (const GMathVec2d &value)
 adds a new vec2d value
 
void add_vec3d (const GMathVec3d &value)
 adds a new vec3d value
 
void add_vec4d (const GMathVec4d &value)
 adds a new vec4d value
 
void add_string (const CoreString &value)
 adds a new string value
 
void add_binary_data (void *data, const unsigned int &size)
 adds binary data value
 
void add_word (const ParserWord &word, const ParserValue::Type &type=ParserValue::TYPE_WORD)
 Adds a new word value.
 
ParserGroupadd_group (ParserGroup *group=0)
 Adds a group.
 
void remove_value (const unsigned int &index)
 Removes a value from entry.
 
void remove_value (const CoreBasicArray< unsigned int > &indices)
 Removes a batch of value from entry.
 
void remove_value (const CoreList< unsigned int > &indices)
 Removes a batch of value from entry.
 
void move_value (const unsigned int &from, const unsigned int &to)
 Moves a value from one index to another.
 
bool has_value () const
 
bool get_bool (const unsigned int &index=0) const
 Returns bool value at specified index.
 
char get_char (const unsigned int &index=0) const
 Returns char value at specified index.
 
int get_int (const unsigned int &index=0) const
 Returns int value at specified index.
 
double get_double (const unsigned int &index=0) const
 Returns double value at specified index.
 
GMathVec2i get_vec2i (const unsigned int &index=0) const
 Returns vec2i value at specified index.
 
GMathVec2d get_vec2d (const unsigned int &index=0) const
 Returns vec2d value at specified index.
 
GMathVec3d get_vec3d (const unsigned int &index=0) const
 Returns vec3d value at specified index.
 
GMathVec4d get_vec4d (const unsigned int &index=0) const
 Returns vec4d value at specified index.
 
const CoreStringget_string (const unsigned int &index=0) const
 Returns string value at specified index.
 
void * get_binary_data (const unsigned int &index=0) const
 Returns binary data value at specified index.
 
unsigned int get_binary_data_size (const unsigned int &index=0) const
 Returns binary data size at specified index.
 
CoreString get_word (const unsigned int &index=0) const
 Returns word value at specified index.
 
ParserGroupget_group (const unsigned int &index=0) const
 Returns group at specified index.
 
void set_bool (const bool &value, const unsigned int &index=0)
 set bool value at given index
 
void set_int (const int &value, const unsigned int &index=0)
 set int value at given index
 
void set_double (const double &value, const unsigned int &index=0)
 set double value at given index
 
void set_string (const CoreString &value, const unsigned int &index=0)
 set string value at given index
 
void set_binary_data (void *data, const unsigned int &size, const unsigned int &index=0)
 set binary value at given index
 
void get_text (CoreString &text, const bool &multiline=false, const unsigned int &offset=1) const
 Returns entry content as text.
 
void get_value_text (CoreString &text, const bool &multiline=false, const unsigned int &offset=1) const
 
void get_encrypted_text (CoreString &text, const CoreString &key, const bool &multiline=false, const unsigned int &offset=1) const
 
void get_encrypted_text (CoreArray< unsigned char > &buffer, const CoreString &key, const bool &multiline=false, const unsigned int &offset=1) const
 
CoreVector< char > get_binary () const
 Returns entry content as binary.
 
bool set_binary (const CoreVector< char > &buffer, long unsigned long &position)
 

Friends

struct ParserImpl
 
class ParserGroup
 
CoreLogStreamoperator<< (CoreLogStream &stream, const ParserEntry &entry)
 

Constructor & Destructor Documentation

ParserEntry::ParserEntry ( const CoreString name,
const Type &  type = TYPE_REGULAR,
const unsigned long &  line = 0,
const unsigned long &  column = 0 
)

Constructor.

Parameters
[in]nameentry name
[in]lineentry line
[in]columnentry column

Member Function Documentation

void ParserEntry::add_binary_data ( void *  data,
const unsigned int &  size 
)

adds binary data value

Parameters
[in]databinary data buffer
[in]sizebuffer size, in Bytes.
void ParserEntry::move_value ( const unsigned int &  from,
const unsigned int &  to 
)

Moves a value from one index to another.

Parameters
[in]fromoriginal index
[in]todestination index
Note
both indexes must exist.
void ParserEntry::remove_value ( const unsigned int &  index)

Removes a value from entry.

Parameters
[in]indexvalue index to remove
void ParserEntry::remove_value ( const CoreBasicArray< unsigned int > &  indices)

Removes a batch of value from entry.

Parameters
[in]indicesarray of indices referencing the values to remove
void ParserEntry::remove_value ( const CoreList< unsigned int > &  indices)

Removes a batch of value from entry.

Parameters
[in]indiceslist of indices referencing the values to remove