Changeset 138 for XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp
- Timestamp:
- 12/10/10 16:04:54 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp
r137 r138 25 25 { 26 26 const AttributRegistrar &ar = c; 27 std::string extraAttributes = c.getXmlExtraAttributes(); 27 28 28 29 if (c.baseObject != NULL) … … 32 33 if (c.isDefinition()) 33 34 { 34 out << NIndent << std::endl; 35 out << NIndent << "<!-- Groupe de définition dans le contexte \"" << ObjectTemplate<T>::GetCurrentContextId() << "\" courant -->" << std::endl; 35 out << NIndent << std::endl 36 << NIndent << "<!-- Groupe de définition dans le contexte \"" 37 << ObjectTemplate<T>::GetCurrentContextId() << "\" courant -->" 38 << std::endl; 36 39 } 37 40 38 41 if (c.hasChild()) 39 42 { 40 out << IncIndent << "<" << c.getName() << c.printId() << ar << ">" << std::endl; 41 c.printChild(out); // << Ecriture des objets enfants ici. 42 if (c.hasId() && (c.getName().compare("context") == 0)) 43 out << NIndent << std::endl; 43 bool __isContext = false; 44 if (c.hasId() && 45 (c.getName().compare("context") == 0)) 46 { 47 out << IncIndent << "<" << c.getName() << c.printId() 48 << extraAttributes << ">" << std::endl; 49 __isContext = true; 50 } 51 else 52 out << IncIndent << "<" << c.getName() 53 << c.printId() << ar << ">" << std::endl; 54 c.printChild(out); 55 if (__isContext) out << NIndent << std::endl; 44 56 out << NIndent << "</" << c.getName() << ">" << DecEndl; 45 57 } 46 58 else 47 out << IncIndent << "<" << c.getName() << c.printId() << ar << "/>" << DecEndl; 59 { 60 out << IncIndent << "<" << c.getName() << c.printId() 61 << extraAttributes << ar << "/>" << DecEndl; 62 } 48 63 49 64 return (out); … … 56 71 } 57 72 58 st ring getName(void) const73 std::string getName(void) const 59 74 { 60 75 if (this->hasId()) … … 98 113 } 99 114 115 virtual std::string getXmlExtraAttributes(void) const 116 { return (std::string("")); } 117 100 118 virtual void parse (XMLNode& _node) 101 119 { … … 117 135 public : /* static */ 118 136 119 static T* CreateObject(const string& _id) throw (XMLIOUndefinedValueException)137 static T* CreateObject(const string& _id) 120 138 { 121 139 // Si l'identifiant est répertorié, on retourne l'élément existant. … … 136 154 } 137 155 138 static T* GetObject(const string& _id) throw (XMLIOUndefinedValueException)156 static T* GetObject(const string& _id) 139 157 { return (ObjectTemplate<T>::AllListObj[CurrContext][_id]); } 140 158
Note: See TracChangeset
for help on using the changeset viewer.