Changeset 111
- Timestamp:
- 06/21/10 15:06:43 (14 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/XMLIO
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp
r108 r111 16 16 { /* Ne rien faire de plus */} 17 17 18 istream& operator>> (std::string& s) {s.assign(this->iss.str()); return (this->iss);} 18 istream& operator>> (std::string& s) 19 {s.assign(this->iss.str()); return (this->iss);} 19 20 istream& operator>> (int& s) { return (iss>>s); } 20 21 istream& operator>> (bool& s) -
XMLIO_V2/dev/dev_rv/src/XMLIO/main_cpp.cpp
r110 r111 11 11 try 12 12 { 13 //string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml");14 string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml");13 string file("/local/XMLIOSERVER_DEV/dev_rv/test/iodef_test.xml"); 14 //string file("/local/XMLIOSERVER_DEV/dev_rv/iodef_test.xml"); 15 15 16 16 ifstream istr( file.c_str() , ifstream::in ); … … 29 29 Context::ShowTree(std::clog); 30 30 31 /*std::clog << "Nombre de Contexts listés : " << Context::GetCurrentListObject().getSize() << " contre 1 attendus."<< std::endl;32 std::clog << "Nombre de FieldGroups listés : " << FieldGroup::GetCurrentListObject().getSize() << " contre 5 attendus."<< std::endl;33 std::clog << "Description du champs votkeavt : " << Field::GetObject("votkeavt").axis_ref << " contre \"Vertical Eddy Diffusivity\" attendus."<< std::endl;*/34 35 31 } 36 32 catch(const Exception &exc) -
XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_c_interface.cpp
r98 r111 1 /* 1 /*using namespace XMLIOSERVER; 2 using namespace XMLIOSERVER::XML; 3 using namespace std; 4 2 5 extern "C" 3 6 { // Début du code C 4 5 using namespace XMLIOSERVER;6 using namespace XMLIOSERVER::XML;7 using namespace std;8 7 9 8 typedef void *XMLIOhandle; … … 11 10 // VIDE TEMPORAIREMENT 12 11 13 } 14 */ 12 }*/ 13 -
XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_xml_node.hpp
r109 r111 11 11 #include <Poco/DOM/AutoPtr.h> 12 12 13 // Entêtes Poco SAX 13 // Entêtes Poco SAX. 14 14 #include <Poco/SAX/InputSource.h> 15 15 16 // Utilisation de la STL 16 // Utilisation de la STL. 17 17 using std::string; 18 18 … … 25 25 using std::ifstream; 26 26 27 // Utilisation de la biliothÚque POCO 27 // Utilisation de la biliothÚque POCO. 28 28 using Poco::XML::DOMParser; 29 29 using Poco::XML::InputSource; … … 64 64 // ... et à pour valeur la chaîne rootName. 65 65 node.pDoc = parser.parse(&src); 66 if (!(node.pDoc->documentElement()->nodeName().compare(_rootName))) 67 { node.setCNode(node.pDoc->documentElement()); } 68 else 69 throw XMLParsingException("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + (node.pDoc->documentElement()->nodeName()) + "\" lue)"); 66 node.setCNode(node.pDoc->documentElement()); 67 if (node.getElementName().compare(_rootName) != 0) 68 throw XMLParsingException("L'élément racine doit avoir pour valeur <" + _rootName + "> (\"" + node.getElementName() + "\" lue)"); 70 69 } 71 70 else … … 75 74 } 76 75 77 string getElementName(void) const {return (this->getCNode()->nodeName());} 76 string getElementName(void) const 77 { string _str(this->getCNode()->nodeName()); return (_toLower(_str)); } 78 78 79 79 bool goToNextElement(void) … … 127 127 128 128 for(unsigned int i = 0; i< map->length(); i++) 129 attributes[map->item(i)->nodeName()] = map->item(i)->nodeValue(); 129 { 130 string _str(map->item(i)->nodeName()); 131 size_t d = map->item(i)->nodeValue().find_first_not_of (' '); 132 size_t f = map->item(i)->nodeValue().find_last_not_of (' '); 133 attributes[_toLower(_str)] = map->item(i)->nodeValue().substr(d,f-d+1); 134 } 130 135 131 136 return (true); … … 143 148 144 149 private : 150 151 string& _toLower(string& _str) const 152 { 153 for (unsigned int i = 0; i < _str.size(); i++) 154 _str[i] = tolower(_str[i]); 155 return (_str); 156 } 157 145 158 AutoPtr<Document> pDoc; 146 159 Node* cNode;
Note: See TracChangeset
for help on using the changeset viewer.