123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- #pragma once
- #include "Array.h"
- #include <functional>
- namespace Framework
- {
- class Text;
- namespace XML
- {
- class Editor;
-
- class Element
- {
- private:
- int ref;
- RCArray< Element > *children;
- RCArray< Text > *attributes;
- RCArray< Text > *attributeValues;
- Text *name;
- Text *text;
- Element *parent;
- public:
-
-
- __declspec( dllexport ) Element( Text string );
-
-
-
- __declspec( dllexport ) Element( Text string, Element *zParent );
- __declspec( dllexport ) ~Element();
-
-
-
- __declspec( dllexport ) void setAttribute( Text attribut, Text value );
-
-
- __declspec( dllexport ) void removeAttribute( Text attribut );
-
-
- __declspec( dllexport ) void addChild( Element *child );
-
-
- __declspec( dllexport ) void addChildAtFront( Element *child );
-
-
- __declspec( dllexport ) void removeChild( Element *child );
-
-
- __declspec( dllexport ) void removeChild( int i );
-
- __declspec( dllexport ) void removeAllChilds();
-
-
- __declspec( dllexport ) void removeChilds( RCArray<Element> *childs );
-
- __declspec( dllexport ) void remove();
-
-
- __declspec( dllexport ) void setText( Text text );
-
- __declspec( dllexport ) Text getText() const;
-
- __declspec( dllexport ) int getChildCount() const;
-
- __declspec( dllexport ) Element *getChild( int i ) const;
-
- __declspec( dllexport ) Element *zChild( int i ) const;
-
- __declspec( dllexport ) Element *getParent() const;
-
- __declspec( dllexport ) Element *zParent() const;
-
- __declspec( dllexport ) Iterator< Element* > getChilds() const;
-
- __declspec( dllexport ) Editor selectChildren() const;
-
-
- __declspec( dllexport ) Editor selectChildsByName( Text name ) const;
-
-
- __declspec( dllexport ) Editor selectChildsByAttribute( Text attribute ) const;
-
-
-
- __declspec( dllexport ) Editor selectChildsByAttribute( Text attribute, Text value ) const;
-
- __declspec( dllexport ) bool hasAttribute( Text name ) const;
-
- __declspec( dllexport ) int getAttributeCount() const;
-
- __declspec( dllexport ) Text getAttributeName( int i ) const;
-
- __declspec( dllexport ) Text getAttributeValue( int i ) const;
-
-
- __declspec( dllexport ) Text getAttributeValue( Text attribut ) const;
-
- __declspec( dllexport ) Iterator< Text* > getAttributeNames() const;
-
- __declspec( dllexport ) Iterator< Text* > getAttributeValues() const;
-
- __declspec( dllexport ) Text getName() const;
-
- __declspec( dllexport ) Text toString() const;
-
- __declspec( dllexport ) Element *dublicate() const;
-
- __declspec( dllexport ) Element *getThis();
-
- __declspec( dllexport ) Element *release();
- friend Editor;
- };
-
- class Editor
- {
- private:
- RCArray< Element > *elements;
- public:
-
- __declspec( dllexport ) Editor( RCArray< Element > *elements );
- __declspec( dllexport ) Editor( const Editor &e );
- __declspec( dllexport ) ~Editor();
-
-
-
- __declspec( dllexport ) void setAttribute( Text attribut, Text value );
-
-
- __declspec( dllexport ) void removeAttribute( Text attribut );
-
-
- __declspec( dllexport ) void addChild( Element *child );
-
-
- __declspec( dllexport ) void removeChild( Element *child );
-
-
- __declspec( dllexport ) void removeChild( int i );
-
- __declspec( dllexport ) void removeAllChilds();
-
-
- __declspec( dllexport ) void removeChilds( RCArray<Element> *childs );
-
- __declspec( dllexport ) void remove();
-
-
- __declspec( dllexport ) void setText( Text text );
-
- __declspec( dllexport ) Iterator<Element *> getIterator();
-
- __declspec( dllexport ) Editor selectChildren() const;
-
- __declspec( dllexport ) Editor selectParents() const;
-
-
- __declspec( dllexport ) Editor whereNameEquals( Text name ) const;
-
-
- __declspec( dllexport ) Editor whereChildWithNameExists( Text name ) const;
-
-
- __declspec( dllexport ) Editor whereChildWithAttributeExists( Text attribute ) const;
-
-
-
- __declspec( dllexport ) Editor whereChildWithAttributeExists( Text attribute, Text value ) const;
-
-
- __declspec( dllexport ) Editor whereAttributeExists( Text attribute ) const;
-
-
-
- __declspec( dllexport ) Editor whereAttributeEquals( Text attribute, Text value ) const;
-
-
- __declspec( dllexport ) Editor without( Editor e ) const;
-
-
- __declspec( dllexport ) void forEach( std::function< void( Element * ) > f ) const;
- };
- }
- }
|