# HG changeset patch # User aquiles # Date 1280842004 -7200 # Node ID 55cc758832a48b4d6651d387fad35eb01049525f # Parent 6d989ead35528896a9a71c78200c70954ec4959c Changed: #1048 getType() in UFormElm diff -r 6d989ead3552 -r 55cc758832a4 code/nel/include/nel/georges/u_form_elm.h --- a/code/nel/include/nel/georges/u_form_elm.h Sun Aug 01 14:18:59 2010 +0200 +++ b/code/nel/include/nel/georges/u_form_elm.h Tue Aug 03 15:26:44 2010 +0200 @@ -224,6 +224,8 @@ // ** Atom element methods + /// Returns the type of the atom. NULL otherwise. + virtual const class UType *getType () = 0; /// Return true if the element is an atom virtual bool isAtom () const = 0; diff -r 6d989ead3552 -r 55cc758832a4 code/nel/src/georges/form_elm.cpp --- a/code/nel/src/georges/form_elm.cpp Sun Aug 01 14:18:59 2010 +0200 +++ b/code/nel/src/georges/form_elm.cpp Tue Aug 03 15:26:44 2010 +0200 @@ -228,6 +228,13 @@ // *************************************************************************** +const CType* CFormElm::getType () +{ + warning (false, "getType", "This node is not an atom."); + return 0; +} +// *************************************************************************** + bool CFormElm::getValue (string &/* result */, TEval /* evaluate */) const { warning (false, "getValue", "This node is not an atom."); @@ -2808,6 +2815,13 @@ // *************************************************************************** +const CType* CFormElmAtom::getType () +{ + return Type; +} + +// *************************************************************************** + void CFormElmAtom::getDependencies (std::set &/* dependencies */) const { } diff -r 6d989ead3552 -r 55cc758832a4 code/nel/src/georges/form_elm.h --- a/code/nel/src/georges/form_elm.h Sun Aug 01 14:18:59 2010 +0200 +++ b/code/nel/src/georges/form_elm.h Tue Aug 03 15:26:44 2010 +0200 @@ -87,6 +87,7 @@ virtual bool setValueByName (bool value, const char *name, bool *created); virtual bool setValueByName (NLMISC::CRGBA value, const char *name, bool *created); virtual UFormElm *getParent () const; + virtual const CType *getType (); virtual bool isArray () const; virtual bool getArraySize (uint &size) const; virtual bool getArrayNode (const UFormElm **result, uint arrayIndex) const; @@ -432,6 +433,7 @@ bool setParent (CFormElm *parent); void getFormName (std::string &result, const CFormElm *child) const; void getDependencies (std::set &dependencies) const; + const CType* getType (); // Call by CFormLoader void read (xmlNodePtr node, CFormLoader &loader, const CType *type, CForm *form);