git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@810 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
atantar 2007-11-23 16:41:23 +00:00
commit 7526792805
49 changed files with 449 additions and 420 deletions

View file

@ -41,11 +41,11 @@
static xmlTextReaderPtr reader;
void openXMLDocument (const char * __filename) {
reader = xmlNewTextReaderFilename (__filename);
if (! reader) {
fprintf (stderr, "unable to open '%s'.\n", __filename);
exit (1);
}
@ -57,18 +57,18 @@ void closeXMLDocument () {
}
std :: string getAttributeValue (const std :: string & __attr) {
xmlChar * value = xmlTextReaderGetAttribute (reader, (const xmlChar *) __attr.c_str ());
std :: string str ((const char *) value);
xmlFree (value);
return str;
}
static bool isSep (const xmlChar * __text) {
for (unsigned i = 0; i < strlen ((char *) __text); i ++)
if (__text [i] != ' ' && __text [i] != '\t' && __text [i] != '\n')
return false;
@ -76,7 +76,7 @@ static bool isSep (const xmlChar * __text) {
}
std :: string getNextNode () {
xmlChar * name, * value;
do {
@ -91,12 +91,11 @@ std :: string getNextNode () {
str.assign ((char *) name);
else
str.assign ((char *) value);
if (name)
xmlFree (name);
if (value)
xmlFree (value);
return str;
}