1 #ifndef __EIEN__EIENML__ELEMENTUTILS_HPP__ 2 #define __EIEN__EIENML__ELEMENTUTILS_HPP__ 30 #define AssignToPointer( ptr, val ) if ( ptr ) *( ptr ) = ( val ) 32 #define DEFINE_NEWDOC_FUNC( cls ) DEFINE_NEWOBJ_FUNC( cls, eienml::Document ) 33 #define DEFINE_NEWBLOCK_FUNC( cls ) DEFINE_NEWOBJ_FUNC( cls, eienml::Block ) 34 #define DEFINE_NEWELEM_FUNC( cls ) DEFINE_NEWOBJ_FUNC( cls, eienml::Element ) 35 #define DEFINE_NEWTEXT_FUNC( cls ) DEFINE_NEWOBJ_FUNC( cls, eienml::TextNode ) 36 #define DEFINE_NEWNODE_FUNC( cls ) DEFINE_NEWOBJ_FUNC( cls, eienml::Node ) 37 #define DEFINE_NEWOBJ_FUNC( cls, ret )\ 38 inline static ret * NewInstance( void )\ 43 #define ClassObj( cls, p ) ( static_cast<cls *>( p ) ) 44 #define TextNodeObj( p ) ClassObj( eienml::TextNode, ( p ) ) 45 #define BlockObj( p ) ClassObj( eienml::Block, ( p ) ) 46 #define ElementObj( p ) ClassObj( eienml::Element, ( p ) ) 47 #define DocumentObj( p ) ClassObj( eienml::Document, ( p ) ) 58 void delInstance(
void );
60 virtual
void doWork(
void );
64 Element * getParent(
void ) const;
65 void setParent(
Element * element );
66 Document * getDocument(
void ) const;
70 virtual ~
Node(
void );
82 virtual
void doWork(
void );
118 virtual
winux::AnsiString childAsStr(
int procType = ProcType_Raw );
119 virtual
void doChildWork(
void );
124 bool addTextToLast(
winux::AnsiString const & str,
TextNode * * p = NULL );
125 bool addChild( Node * element );
126 bool hasChildren(
void );
127 void getElements( ElementArray * arr,
winux::AnsiString const & tagName );
128 void getBlocks( BlockArray * arr,
winux::AnsiString const & blockTag );
129 virtual
winux::AnsiString asStr(
int procType = ProcType_Raw );
130 virtual
void doWork(
void );
131 bool hasAttr(
winux::AnsiString const & name ) const;
132 winux::AnsiString getAttr(
winux::AnsiString const & name ) const;
133 void setAttr(
winux::AnsiString const & name,
winux::AnsiString const & value );
134 void delAttr(
winux::AnsiString const & name );
136 NodeArray & getChildren(
void );
137 Attributes & getAttributes(
void );
138 void setAttributes( Attributes const & attrs );
139 bool isOdd(
void ) const;
143 virtual
winux::AnsiString replaceProc(
void );
144 virtual
winux::AnsiString treeProc(
void );
172 virtual
winux::AnsiString asStr(
int procType = ProcType_Raw );
173 virtual
void doWork(
void );
182 #endif // __EIEN__EIENML__ELEMENTUTILS_HPP__ XString< char > AnsiString
std::vector< Block * > BlockArray
std::vector< Element * > ElementArray
#define DEFINE_NEWDOC_FUNC(cls)
std::vector< Node * > NodeArray
#define DEFINE_NEWELEM_FUNC(cls)
#define DEFINE_NEWNODE_FUNC(cls)
#define DEFINE_NEWTEXT_FUNC(cls)
#define DEFINE_NEWBLOCK_FUNC(cls)
std::map< winux::AnsiString, winux::AnsiString > Attributes