Ignore:
Timestamp:
12/10/10 16:04:54 (14 years ago)
Author:
hozdoba
Message:

Mise à jour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp

    r137 r138  
    2525         { 
    2626            const AttributRegistrar &ar = c; 
     27            std::string extraAttributes = c.getXmlExtraAttributes(); 
    2728 
    2829            if (c.baseObject != NULL) 
     
    3233            if (c.isDefinition()) 
    3334            { 
    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; 
    3639            } 
    3740 
    3841            if (c.hasChild()) 
    3942            { 
    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; 
    4456               out << NIndent    << "</" << c.getName()  << ">" << DecEndl; 
    4557            } 
    4658            else 
    47                out << IncIndent << "<" << c.getName()  << c.printId() << ar << "/>" << DecEndl; 
     59            { 
     60               out << IncIndent << "<" << c.getName() << c.printId() 
     61                   << extraAttributes << ar << "/>" << DecEndl; 
     62            } 
    4863 
    4964            return (out); 
     
    5671         } 
    5772 
    58          string getName(void) const 
     73         std::string getName(void) const 
    5974         { 
    6075            if (this->hasId()) 
     
    98113         } 
    99114 
     115         virtual std::string getXmlExtraAttributes(void) const 
     116         { return (std::string("")); } 
     117 
    100118         virtual void parse (XMLNode& _node) 
    101119         { 
     
    117135      public : /* static */ 
    118136 
    119          static T* CreateObject(const string& _id) throw (XMLIOUndefinedValueException) 
     137         static T* CreateObject(const string& _id) 
    120138         { 
    121139            // Si l'identifiant est répertorié, on retourne l'élément existant. 
     
    136154         } 
    137155 
    138          static T* GetObject(const string& _id) throw (XMLIOUndefinedValueException) 
     156         static T* GetObject(const string& _id) 
    139157         { return (ObjectTemplate<T>::AllListObj[CurrContext][_id]); } 
    140158 
Note: See TracChangeset for help on using the changeset viewer.