[219] | 1 | #ifndef __XMLIO_CAttributeMap__ |
---|
| 2 | #define __XMLIO_CAttributeMap__ |
---|
| 3 | |
---|
| 4 | /// xmlioserver headers /// |
---|
| 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "attribute.hpp" |
---|
| 7 | #include "attribute_template.hpp" |
---|
| 8 | #include "exception.hpp" |
---|
| 9 | #include "xml_node.hpp" |
---|
| 10 | |
---|
| 11 | namespace xmlioserver |
---|
| 12 | { |
---|
| 13 | namespace tree |
---|
| 14 | { |
---|
| 15 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 16 | class CAttributeMap |
---|
| 17 | : public xios_map<StdString, CAttribute*> |
---|
| 18 | { |
---|
| 19 | typedef xios_map<StdString, CAttribute*> SuperClassMap; |
---|
| 20 | |
---|
| 21 | public : |
---|
| 22 | |
---|
| 23 | /// Tests /// |
---|
| 24 | inline bool hasAttribute(const StdString & key) const; |
---|
| 25 | |
---|
| 26 | /// Accesseurs /// |
---|
| 27 | CAttribute * operator[](const StdString & key); |
---|
| 28 | |
---|
| 29 | /// Mutateurs /// |
---|
| 30 | void setAttribute(const StdString & key, CAttribute * const attr); |
---|
| 31 | |
---|
| 32 | void setAttributes(const xml::THashAttributes & attributes); |
---|
| 33 | void setAttributes(const CAttributeMap * const _parent); |
---|
| 34 | |
---|
| 35 | void clearAllAttributes(void); |
---|
| 36 | |
---|
| 37 | /// Destructeur /// |
---|
| 38 | virtual ~CAttributeMap(void); |
---|
| 39 | |
---|
| 40 | /// Flux /// |
---|
| 41 | // Debug only // |
---|
| 42 | // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap); |
---|
| 43 | |
---|
| 44 | /// Autre /// |
---|
| 45 | virtual StdString toString(void) const; |
---|
| 46 | virtual void fromString(const StdString & str); |
---|
| 47 | |
---|
| 48 | virtual void toBinary (StdOStream & os) const; |
---|
| 49 | virtual void fromBinary(StdIStream & is); |
---|
| 50 | |
---|
| 51 | protected : |
---|
| 52 | |
---|
| 53 | /// Constructeurs /// |
---|
| 54 | CAttributeMap(void); |
---|
| 55 | CAttributeMap(const xios_map<StdString, CAttribute*> & umap); // Never implemented. |
---|
| 56 | CAttributeMap(const xios_map<StdString, CAttribute*> * const umap); // Not implemented. |
---|
| 57 | |
---|
| 58 | /// Propriété statique /// |
---|
| 59 | static CAttributeMap * Current; |
---|
| 60 | |
---|
| 61 | }; // class CAttributeMap |
---|
| 62 | |
---|
| 63 | } // namespace tree |
---|
| 64 | } // namespace xmlioserver |
---|
| 65 | |
---|
| 66 | #endif // __XMLIO_CAttributeMap__ |
---|