# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLGEORGES::CFormElm Class Reference

Base class of form elments. More...

#include <form_elm.h>

Inheritance diagram for NLGEORGES::CFormElm:

NLGEORGES::UFormElm NLGEORGES::CFormElmArray NLGEORGES::CFormElmAtom NLGEORGES::CFormElmStruct NLGEORGES::CFormElmVirtualStruct List of all members.

Public Methods

 CFormElm (CForm *form, CFormElm *parentNode, const CFormDfn *parentDfn, uint parentIndex)
virtual ~CFormElm ()
CFormgetForm () const
virtual bool isUsed (const CForm *form) const
virtual void getFormName (std::string &result, const CFormElm *child=NULL) const=0
virtual bool getNodeByName (const UFormElm **result, const char *name, TWhereIsNode *where, bool verbose=true) const
 Return a node pointer with its name. More...

virtual bool getNodeByName (UFormElm **result, const char *name, TWhereIsNode *where, bool verbose=true)
virtual bool getValueByName (std::string &result, const char *name, bool evaluate, TWhereIsValue *where) const
 Get a form value with its name. More...

virtual bool getValueByName (sint8 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (uint8 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (sint16 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (uint16 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (sint32 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (uint32 &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (float &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (double &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (bool &result, const char *name, bool evaluate, TWhereIsValue *where) const
virtual bool getValueByName (NLMISC::CRGBA &result, const char *name, bool evaluate, TWhereIsValue *where) const
 Warning, only R, G and B members are filled, not A. More...

virtual bool setValueByName (const char *value, const char *name, bool *created)
 Set a form value with its name. More...

virtual bool setValueByName (sint8 value, const char *name, bool *created)
virtual bool setValueByName (uint8 value, const char *name, bool *created)
virtual bool setValueByName (sint16 value, const char *name, bool *created)
virtual bool setValueByName (uint16 value, const char *name, bool *created)
virtual bool setValueByName (sint32 value, const char *name, bool *created)
virtual bool setValueByName (uint32 value, const char *name, bool *created)
virtual bool setValueByName (float value, const char *name, bool *created)
virtual bool setValueByName (double value, const char *name, bool *created)
virtual bool setValueByName (bool value, const char *name, bool *created)
virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created)
virtual UFormElmgetParent () const
virtual bool isArray () const
 Return true if the element is an array. More...

virtual bool getArraySize (uint &size) const
 Return true if the element is an array and fill size with the array size. More...

virtual bool getArrayNode (const UFormElm **result, uint arrayIndex) const
 Get a array sub element const pointer. More...

virtual bool getArrayNode (UFormElm **result, uint arrayIndex)
 Get a array sub element mutable pointer. More...

virtual bool getArrayNodeName (std::string &result, uint arrayIndex) const
 Return the name of a table element. More...

virtual bool getArrayValue (std::string &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
 Get an array value. More...

virtual bool getArrayValue (sint8 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (uint8 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (sint16 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (uint16 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (sint32 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (uint32 &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (float &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (double &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (bool &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
virtual bool getArrayValue (NLMISC::CRGBA &result, uint arrayIndex, bool evaluate, TWhereIsValue *where) const
 Warning, only R, G and B members are filled, not A. More...

virtual bool isStruct () const
 Return true if the element is a struct or a virtual struct. More...

virtual bool isVirtualStruct () const
 Return true if the element is a virtual struct. More...

virtual bool getDfnName (std::string &dfnName) const
 Get the dfn filename for this virtual struct. Must be a virtual struct node. More...

virtual bool getStructSize (uint &size) const
 Return the struct size. More...

virtual bool getStructNodeName (uint element, std::string &result) const
 Return the element name. More...

virtual bool getStructNode (uint element, const UFormElm **result) const
 Return a const element pointer. Can be NULL if the node doesn't exist. More...

virtual bool getStructNode (uint element, UFormElm **result)
 Return a mutable element pointer. Can be NULL if the node doesn't exist. More...

virtual bool isAtom () const
 Return true if the element is an atom. More...

virtual bool getValue (std::string &result, bool evaluate) const
 Return the atom value. More...

virtual bool getValue (sint8 &result, bool evaluate) const
virtual bool getValue (uint8 &result, bool evaluate) const
virtual bool getValue (sint16 &result, bool evaluate) const
virtual bool getValue (uint16 &result, bool evaluate) const
virtual bool getValue (sint32 &result, bool evaluate) const
virtual bool getValue (uint32 &result, bool evaluate) const
virtual bool getValue (float &result, bool evaluate) const
virtual bool getValue (double &result, bool evaluate) const
virtual bool getValue (bool &result, bool evaluate) const
virtual bool getValue (NLMISC::CRGBA &result, bool evaluate) const
 Warning, only R, G and B members are filled, not A. More...

bool createNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &created)
bool deleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array)
 Delete a node by name. More...

bool getNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool &parentVDfnArray, bool verbose) const
bool arrayInsertNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const
 Insert an array node by name The index asked must be < the size of the array. More...

bool arrayDeleteNodeByName (const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, bool verbose, uint arrayIndex) const
 Delete an array node by name The index asked must be < the size of the array. More...

virtual xmlNodePtr write (xmlNodePtr node, const CForm *form, const char *structName=NULL, bool forceWrite=false) const=0

Static Public Methods

bool convertValue (sint8 &result, const char *value)
bool convertValue (uint8 &result, const char *value)
bool convertValue (sint16 &result, const char *value)
bool convertValue (uint16 &result, const char *value)
bool convertValue (sint32 &result, const char *value)
bool convertValue (uint32 &result, const char *value)
bool convertValue (float &result, const char *value)
bool convertValue (double &result, const char *value)
bool convertValue (bool &result, const char *value)
bool convertValue (NLMISC::CRGBA &result, const char *value)
const char * tokenize (const char *name, std::string &str, uint &errorIndex, uint &code)

Protected Types

enum  TNodeAction { Return, Create, Delete }

Protected Methods

virtual void unlink (CFormElm *child)
 Unlink a child. More...


Static Protected Methods

bool getIternalNodeByName (CForm *form, const char *name, const CFormDfn **parentDfn, uint &indexDfn, const CFormDfn **nodeDfn, const CType **nodeType, CFormElm **node, UFormDfn::TEntryType &type, bool &array, TNodeAction action, bool &created, bool &parentVDfnArray, bool verbose)
 Is createNode == Create, (*node)->Form must be == to the form argument. More...


Protected Attributes

CFormForm
CFormElm * ParentNode
const CFormDfnParentDfn
uint ParentIndex

Private Types

enum  TToken { TokenString = 0, TokenPoint, TokenArrayBegin, TokenArrayEnd }

Friends

class CForm
class CType
class CFormDfn

Detailed Description

Base class of form elments.

Definition at line 45 of file form_elm.h.


Member Enumeration Documentation

enum NLGEORGES::CFormElm::TNodeAction [protected]
 

Enumeration values:
Return 
Create 
Delete 

Definition at line 185 of file form_elm.h.

enum NLGEORGES::CFormElm::TToken [private]
 

Enumeration values:
TokenString 
TokenPoint 
TokenArrayBegin 
TokenArrayEnd 

Definition at line 234 of file form_elm.h.


Constructor & Destructor Documentation

NLGEORGES::CFormElm::CFormElm CForm   form,
CFormElm *    parentNode,
const CFormDfn   parentDfn,
uint    parentIndex
 

Definition at line 323 of file form_elm.cpp.

References Form, ParentDfn, ParentIndex, ParentNode, and uint.

Referenced by arrayDeleteNodeByName, arrayInsertNodeByName, getIternalNodeByName, getNodeByName, getValueByName, and setValueByName.

NLGEORGES::CFormElm::~CFormElm   [virtual]
 

Definition at line 333 of file form_elm.cpp.


Member Function Documentation

bool NLGEORGES::CFormElm::arrayDeleteNodeByName const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array,
bool    verbose,
uint    arrayIndex
const
 

Delete an array node by name The index asked must be < the size of the array.

Definition at line 712 of file form_elm.cpp.

References CFormElm, Create, Form, getIternalNodeByName, nlassert, ParentDfn, ParentIndex, type, and uint.

bool NLGEORGES::CFormElm::arrayInsertNodeByName const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array,
bool    verbose,
uint    arrayIndex
const
 

Insert an array node by name The index asked must be < the size of the array.

Definition at line 638 of file form_elm.cpp.

References CFormElm, Create, Form, getIternalNodeByName, nlassert, nlstop, ParentDfn, ParentIndex, type, and uint.

bool NLGEORGES::CFormElm::convertValue NLMISC::CRGBA   result,
const char *    value
[inline, static]
 

Definition at line 623 of file form_elm.h.

References NLMISC::CRGBA::B, NLMISC::clamp, NLMISC::CRGBA::G, nlwarning, NLMISC::CRGBA::R, and r.

bool NLGEORGES::CFormElm::convertValue bool &    result,
const char *    value
[inline, static]
 

Definition at line 591 of file form_elm.h.

References nlwarning, and NLMISC::strlwr.

bool NLGEORGES::CFormElm::convertValue double &    result,
const char *    value
[inline, static]
 

Definition at line 573 of file form_elm.h.

References nlwarning.

bool NLGEORGES::CFormElm::convertValue float &    result,
const char *    value
[inline, static]
 

Definition at line 557 of file form_elm.h.

References nlwarning.

bool NLGEORGES::CFormElm::convertValue uint32   result,
const char *    value
[inline, static]
 

Definition at line 538 of file form_elm.h.

References NLMISC::clamp, nlwarning, and uint32.

bool NLGEORGES::CFormElm::convertValue sint32   result,
const char *    value
[inline, static]
 

Definition at line 519 of file form_elm.h.

References NLMISC::clamp, nlwarning, and sint32.

bool NLGEORGES::CFormElm::convertValue uint16   result,
const char *    value
[inline, static]
 

Definition at line 500 of file form_elm.h.

References NLMISC::clamp, nlwarning, and uint16.

bool NLGEORGES::CFormElm::convertValue sint16   result,
const char *    value
[inline, static]
 

Definition at line 481 of file form_elm.h.

References NLMISC::clamp, nlwarning, and sint16.

bool NLGEORGES::CFormElm::convertValue uint8   result,
const char *    value
[inline, static]
 

Definition at line 462 of file form_elm.h.

References NLMISC::clamp, nlwarning, and uint8.

bool NLGEORGES::CFormElm::convertValue sint8   result,
const char *    value
[inline, static]
 

Definition at line 443 of file form_elm.h.

References NLMISC::clamp, nlwarning, and sint8.

Referenced by NLGEORGES::CFormElmArray::getArrayValue, NLGEORGES::CFormElmAtom::getValue, and getValueByName.

bool NLGEORGES::CFormElm::createNodeByName const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array,
bool &    created
 

Definition at line 589 of file form_elm.cpp.

References Create, Form, getIternalNodeByName, ParentDfn, ParentIndex, type, and uint.

Referenced by setValueByName.

bool NLGEORGES::CFormElm::deleteNodeByName const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array
 

Delete a node by name.

If the node already exist, return it Delete its parent if not used

Definition at line 605 of file form_elm.cpp.

References Delete, Form, getIternalNodeByName, ParentDfn, ParentIndex, type, and uint.

bool NLGEORGES::CFormElm::getArrayNode UFormElm **    result,
uint    arrayIndex
[virtual]
 

Get a array sub element mutable pointer.

If return true, fill result with the arrayIndex cell's element pointer. Can be NULL if the node doesn't exist.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 71 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayNode const UFormElm **    result,
uint    arrayIndex
const [virtual]
 

Get a array sub element const pointer.

If return true, fill result with the arrayIndex cell's element Can be NULL if the node doesn't exist.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 63 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayNodeName std::string &    result,
uint    arrayIndex
const [virtual]
 

Return the name of a table element.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 79 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArraySize uint   size const [virtual]
 

Return true if the element is an array and fill size with the array size.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 55 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayValue NLMISC::CRGBA   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Warning, only R, G and B members are filled, not A.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 167 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayValue bool &    result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 159 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayValue double &    result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 151 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayValue float &    result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 143 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getArrayValue uint32   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 135 of file form_elm.cpp.

References nlwarning, uint, and uint32.

bool NLGEORGES::CFormElm::getArrayValue sint32   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 127 of file form_elm.cpp.

References nlwarning, sint32, and uint.

bool NLGEORGES::CFormElm::getArrayValue uint16   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 119 of file form_elm.cpp.

References nlwarning, uint, and uint16.

bool NLGEORGES::CFormElm::getArrayValue sint16   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 111 of file form_elm.cpp.

References nlwarning, sint16, and uint.

bool NLGEORGES::CFormElm::getArrayValue uint8   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 103 of file form_elm.cpp.

References nlwarning, uint, and uint8.

bool NLGEORGES::CFormElm::getArrayValue sint8   result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 95 of file form_elm.cpp.

References nlwarning, sint8, and uint.

bool NLGEORGES::CFormElm::getArrayValue std::string &    result,
uint    arrayIndex,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Get an array value.

The node must be an array of atom element.

Parameters:
result  is a reference on the value to fill with the result.
arrayIndex  is the array index to evaluate.
evaluate  must be true if you want to have an evaluated value, false if you want the formula value.
where  is a pointer on the information flag of the value. If Where is not NULL, it is filled with the position where the value has been found.
Returns:
true if the result has been filled, false if the value has not been found or the cast has failed or the evaluation has failed.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 87 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getDfnName std::string &    dfnName const [virtual]
 

Get the dfn filename for this virtual struct. Must be a virtual struct node.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmVirtualStruct.

Definition at line 189 of file form_elm.cpp.

CForm * NLGEORGES::CFormElm::getForm   const
 

Definition at line 346 of file form_elm.cpp.

References Form.

virtual void NLGEORGES::CFormElm::getFormName std::string &    result,
const CFormElm *    child = NULL
const [pure virtual]
 

Implemented in NLGEORGES::CFormElmStruct.

bool NLGEORGES::CFormElm::getIternalNodeByName CForm   form,
const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array,
TNodeAction    action,
bool &    created,
bool &    parentVDfnArray,
bool    verbose
[static, protected]
 

Is createNode == Create, (*node)->Form must be == to the form argument.

Is createNode == Return, form argument is not used, can be undefined.

Only form, name, and action, must be defined. Then, else (*parentDfn / indexDfn ) or *node must be defined. Others value are for result only.

Definition at line 757 of file form_elm.cpp.

References CForm, CFormDfn, CFormElm, Create, CType, Delete, nlassert, nlstop, nlverify, nlwarning, Return, NLMISC::smprintf, TokenArrayBegin, TokenArrayEnd, tokenize, TokenPoint, TokenString, type, and uint.

Referenced by arrayDeleteNodeByName, arrayInsertNodeByName, createNodeByName, deleteNodeByName, and getNodeByName.

bool NLGEORGES::CFormElm::getNodeByName const char *    name,
const CFormDfn **    parentDfn,
uint   indexDfn,
const CFormDfn **    nodeDfn,
const CType **    nodeType,
CFormElm **    node,
UFormDfn::TEntryType   type,
bool &    array,
bool &    parentVDfnArray,
bool    verbose
const
 

Definition at line 622 of file form_elm.cpp.

References CFormElm, Form, getIternalNodeByName, ParentDfn, ParentIndex, Return, type, and uint.

bool NLGEORGES::CFormElm::getNodeByName UFormElm **    result,
const char *    name,
TWhereIsNode   where,
bool    verbose = true
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 353 of file form_elm.cpp.

bool NLGEORGES::CFormElm::getNodeByName const UFormElm **    result,
const char *    name,
TWhereIsNode   where,
bool    verbose = true
const [virtual]
 

Return a node pointer with its name.

Parameters:
result  will be filled with the node pointer. Can be NULL if the node doesn't exist.
name  is the form node name
where  is a pointer on the information flag of the value. If Where is not NULL, it is filled with the position where the node has been found. If result is NULL, where is undefined.
Returns:
true if the result has been filled, false if the node is not referenced.
About the node existance

An atom node exist if its value are defined. A struct node exist if one of its children exist. An array node exist if one of its children exist. If the node doesn't exist, you can't have a pointer on it with getNodeByName(). It returns NULL. But, you can evaluate the value of non-existant atom nodes with getValueByName().

About the form name:

Struct elements name must be separeted by '.' Struct indexes must be between '[' and ']'

Exemple: "position.x" : get the element named x in the struct named position "entities[2].color" : get the node named color in the second element of the entities array

Implements NLGEORGES::UFormElm.

Definition at line 366 of file form_elm.cpp.

References CFormDfn, CFormElm, CType, Form, NLGEORGES::UFormElm::NodeForm, NLGEORGES::UFormElm::NodeParentForm, type, and uint.

Referenced by getValueByName.

UFormElm * NLGEORGES::CFormElm::getParent   const [virtual]
 

Definition at line 582 of file form_elm.cpp.

References ParentNode.

bool NLGEORGES::CFormElm::getStructNode uint    element,
UFormElm **    result
[virtual]
 

Return a mutable element pointer. Can be NULL if the node doesn't exist.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 220 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getStructNode uint    element,
const UFormElm **    result
const [virtual]
 

Return a const element pointer. Can be NULL if the node doesn't exist.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 212 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getStructNodeName uint    element,
std::string &    result
const [virtual]
 

Return the element name.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 204 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getStructSize uint   size const [virtual]
 

Return the struct size.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 196 of file form_elm.cpp.

References nlwarning, and uint.

bool NLGEORGES::CFormElm::getValue NLMISC::CRGBA   result,
bool    evaluate
const [virtual]
 

Warning, only R, G and B members are filled, not A.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 315 of file form_elm.cpp.

References nlwarning.

bool NLGEORGES::CFormElm::getValue bool &    result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 307 of file form_elm.cpp.

References nlwarning.

bool NLGEORGES::CFormElm::getValue double &    result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 299 of file form_elm.cpp.

References nlwarning.

bool NLGEORGES::CFormElm::getValue float &    result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 291 of file form_elm.cpp.

References nlwarning.

bool NLGEORGES::CFormElm::getValue uint32   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 283 of file form_elm.cpp.

References nlwarning, and uint32.

bool NLGEORGES::CFormElm::getValue sint32   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 275 of file form_elm.cpp.

References nlwarning, and sint32.

bool NLGEORGES::CFormElm::getValue uint16   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 267 of file form_elm.cpp.

References nlwarning, and uint16.

bool NLGEORGES::CFormElm::getValue sint16   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 259 of file form_elm.cpp.

References nlwarning, and sint16.

bool NLGEORGES::CFormElm::getValue uint8   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 251 of file form_elm.cpp.

References nlwarning, and uint8.

bool NLGEORGES::CFormElm::getValue sint8   result,
bool    evaluate
const [virtual]
 

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 243 of file form_elm.cpp.

References nlwarning, and sint8.

bool NLGEORGES::CFormElm::getValue std::string &    result,
bool    evaluate
const [virtual]
 

Return the atom value.

The numbers are clamped to the type limit values.

Parameters:
result  is the reference on the value to fill with result
evaluate  must be true if you want to have an evaluated value, false if you want the formula value.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 235 of file form_elm.cpp.

References nlwarning.

bool NLGEORGES::CFormElm::getValueByName NLMISC::CRGBA   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Warning, only R, G and B members are filled, not A.

Implements NLGEORGES::UFormElm.

Definition at line 568 of file form_elm.cpp.

References convertValue, and getValueByName.

bool NLGEORGES::CFormElm::getValueByName bool &    result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 554 of file form_elm.cpp.

References convertValue, and getValueByName.

bool NLGEORGES::CFormElm::getValueByName double &    result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 540 of file form_elm.cpp.

References convertValue, and getValueByName.

bool NLGEORGES::CFormElm::getValueByName float &    result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 526 of file form_elm.cpp.

References convertValue, and getValueByName.

bool NLGEORGES::CFormElm::getValueByName uint32   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 512 of file form_elm.cpp.

References convertValue, getValueByName, and uint32.

bool NLGEORGES::CFormElm::getValueByName sint32   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 498 of file form_elm.cpp.

References convertValue, getValueByName, and sint32.

bool NLGEORGES::CFormElm::getValueByName uint16   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 484 of file form_elm.cpp.

References convertValue, getValueByName, and uint16.

bool NLGEORGES::CFormElm::getValueByName sint16   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 470 of file form_elm.cpp.

References convertValue, getValueByName, and sint16.

bool NLGEORGES::CFormElm::getValueByName uint8   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 456 of file form_elm.cpp.

References convertValue, getValueByName, and uint8.

bool NLGEORGES::CFormElm::getValueByName sint8   result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 442 of file form_elm.cpp.

References convertValue, getValueByName, and sint8.

bool NLGEORGES::CFormElm::getValueByName std::string &    result,
const char *    name,
bool    evaluate,
TWhereIsValue   where
const [virtual]
 

Get a form value with its name.

The numbers are clamped to the type limit values.

Parameters:
result  is a reference on the value to fill with the result.
name  is the form name of the value to found.
evaluate  must be true if you want to have an evaluated value, false if you want the formula value.
where  is a pointer on the information flag of the value. If Where is not NULL, it is filled with the position where the value has been found.
Returns:
true if the result has been filled, false if the value has not been found or the cast has failed or the evaluation has failed.
See also:
getNodeByName ()

Implements NLGEORGES::UFormElm.

Definition at line 399 of file form_elm.cpp.

References CFormDfn, CFormElm, CType, Form, getNodeByName, nlassert, nlwarning, type, uint, and uint32.

Referenced by getValueByName.

bool NLGEORGES::CFormElm::isArray   const [virtual]
 

Return true if the element is an array.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmArray.

Definition at line 48 of file form_elm.cpp.

bool NLGEORGES::CFormElm::isAtom   const [virtual]
 

Return true if the element is an atom.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 228 of file form_elm.cpp.

bool NLGEORGES::CFormElm::isStruct   const [virtual]
 

Return true if the element is a struct or a virtual struct.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 175 of file form_elm.cpp.

bool NLGEORGES::CFormElm::isUsed const CForm   form const [virtual]
 

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 339 of file form_elm.cpp.

References Form.

Referenced by NLGEORGES::CFormElmAtom::write.

bool NLGEORGES::CFormElm::isVirtualStruct   const [virtual]
 

Return true if the element is a virtual struct.

Implements NLGEORGES::UFormElm.

Reimplemented in NLGEORGES::CFormElmVirtualStruct.

Definition at line 182 of file form_elm.cpp.

bool NLGEORGES::CFormElm::setValueByName NLMISC::CRGBA    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1600 of file form_elm.cpp.

References NLMISC::CRGBA::B, NLMISC::CRGBA::G, NLMISC::CRGBA::R, setValueByName, and NLMISC::smprintf.

bool NLGEORGES::CFormElm::setValueByName bool    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1593 of file form_elm.cpp.

References setValueByName.

bool NLGEORGES::CFormElm::setValueByName double    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1586 of file form_elm.cpp.

References setValueByName.

bool NLGEORGES::CFormElm::setValueByName float    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1579 of file form_elm.cpp.

References setValueByName.

bool NLGEORGES::CFormElm::setValueByName uint32    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1572 of file form_elm.cpp.

References setValueByName, and uint32.

bool NLGEORGES::CFormElm::setValueByName sint32    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1565 of file form_elm.cpp.

References setValueByName, and sint32.

bool NLGEORGES::CFormElm::setValueByName uint16    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1558 of file form_elm.cpp.

References setValueByName, and uint16.

bool NLGEORGES::CFormElm::setValueByName sint16    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1551 of file form_elm.cpp.

References setValueByName, and sint16.

bool NLGEORGES::CFormElm::setValueByName uint8    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1544 of file form_elm.cpp.

References setValueByName, and uint8.

bool NLGEORGES::CFormElm::setValueByName sint8    value,
const char *    name,
bool *    created
[virtual]
 

Implements NLGEORGES::UFormElm.

Definition at line 1537 of file form_elm.cpp.

References setValueByName, and sint8.

bool NLGEORGES::CFormElm::setValueByName const char *    value,
const char *    name,
bool *    created
[virtual]
 

Set a form value with its name.

If the node doesn't exist, it is created.

Parameters:
value  is a reference on the value to set in the form.
name  is the form name of the value to set or create.
where  is a pointer on the information flag of the value. If Where is not NULL, it is filled with the position where the value has been found.
created  is a pointer on the creatation flag. If created is not NULL, it is filled with true if the value has been created, false it the value has been filled.
Returns:
true if the value has been set, false if the value has not been found or hasn't been created.

Implements NLGEORGES::UFormElm.

Definition at line 1485 of file form_elm.cpp.

References CFormDfn, CFormElm, createNodeByName, CType, nlassert, nlwarning, type, and uint.

Referenced by setValueByName.

const char * NLGEORGES::CFormElm::tokenize const char *    name,
std::string &    str,
uint   errorIndex,
uint   code
[static]
 

Definition at line 1435 of file form_elm.cpp.

References TokenArrayBegin, TokenArrayEnd, TokenPoint, TokenString, and uint.

Referenced by getIternalNodeByName.

void NLGEORGES::CFormElm::unlink CFormElm *    child [protected, virtual]
 

Unlink a child.

Reimplemented in NLGEORGES::CFormElmStruct.

Definition at line 1477 of file form_elm.cpp.

References nlstop.

virtual xmlNodePtr NLGEORGES::CFormElm::write xmlNodePtr    node,
const CForm   form,
const char *    structName = NULL,
bool    forceWrite = false
const [pure virtual]
 

Implemented in NLGEORGES::CFormElmStruct.


Friends And Related Function Documentation

friend class CForm [friend]
 

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 47 of file form_elm.h.

Referenced by getIternalNodeByName.

friend class CFormDfn [friend]
 

Definition at line 49 of file form_elm.h.

Referenced by getIternalNodeByName, getNodeByName, getValueByName, and setValueByName.

friend class CType [friend]
 

Reimplemented in NLGEORGES::CFormElmAtom.

Definition at line 48 of file form_elm.h.

Referenced by getIternalNodeByName, getNodeByName, getValueByName, and setValueByName.


Member Data Documentation

CForm* NLGEORGES::CFormElm::Form [protected]
 

Definition at line 221 of file form_elm.h.

Referenced by arrayDeleteNodeByName, arrayInsertNodeByName, CFormElm, createNodeByName, deleteNodeByName, NLGEORGES::CFormElmArray::getArrayValue, getForm, getNodeByName, getValueByName, NLGEORGES::CFormElmArray::isUsed, and isUsed.

const CFormDfn* NLGEORGES::CFormElm::ParentDfn [protected]
 

Definition at line 227 of file form_elm.h.

Referenced by arrayDeleteNodeByName, arrayInsertNodeByName, CFormElm, createNodeByName, deleteNodeByName, NLGEORGES::CFormElmArray::getArrayValue, getNodeByName, and NLGEORGES::CFormElmArray::read.

uint NLGEORGES::CFormElm::ParentIndex [protected]
 

Definition at line 230 of file form_elm.h.

Referenced by arrayDeleteNodeByName, arrayInsertNodeByName, CFormElm, createNodeByName, deleteNodeByName, NLGEORGES::CFormElmArray::getArrayValue, getNodeByName, and NLGEORGES::CFormElmArray::read.

CFormElm* NLGEORGES::CFormElm::ParentNode [protected]
 

Definition at line 224 of file form_elm.h.

Referenced by CFormElm, NLGEORGES::CFormElmAtom::getFormName, NLGEORGES::CFormElmArray::getFormName, NLGEORGES::CFormElmStruct::getFormName, and getParent.


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