pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata entrance_data.cxx,1.2,1


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/worldobjsdata entrance_data.cxx,1.2,1.3
Date: 30 Sep 2002 14:20:51 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/worldobjsdata
In directory dark:/tmp/cvs-serv4130/worldobjsdata

Modified Files:
        entrance_data.cxx 
Log Message:
moved xmlNodeListGetString into XMLhelper


Index: entrance_data.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/worldobjsdata/entrance_data.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- entrance_data.cxx   28 Sep 2002 11:52:26 -0000      1.2
+++ entrance_data.cxx   30 Sep 2002 14:20:49 -0000      1.3
@@ -50,9 +50,7 @@
 
       if (XMLhelper::equal_str(cur->name, "type"))
        {
-         char* name = (char*)xmlNodeListGetString(doc, cur->children, 1); 
-         type = name;
-         xmlFree(name);
+         XMLhelper::node_list_get_string(doc, cur->children, 1, type);
        }
       else if (XMLhelper::equal_str(cur->name, "owner-id"))
        {
@@ -64,22 +62,19 @@
        }
       else if (XMLhelper::equal_str(cur->name, "release-rate"))
        {
-         char* release_rate_str = (char*)xmlNodeListGetString(doc, 
cur->children, 1);
-         release_rate = StringConverter::to_int(release_rate_str);
-         xmlFree(release_rate_str);
+         XMLhelper::node_list_get_string(doc, cur->children, 1, release_rate);
        }
       else if (XMLhelper::equal_str(cur->name, "direction"))
        {
-         char* direction_str = (char*)xmlNodeListGetString(doc, cur->children, 
1);
+         std::string direction_str;
+         XMLhelper::node_list_get_string(doc, cur->children, 1, direction_str);
 
-         if (! strcmp(direction_str, "left"))
+         if (direction_str == "left")
            direction = EntranceData::LEFT;
-         else if (! strcmp(direction_str, "right"))
+         else if (direction_str == "right")
            direction = EntranceData::RIGHT;
-         else if (! strcmp(direction_str, "misc"))
+         else if (direction_str == "misc")
            direction = EntranceData::MISC;
-         
-         xmlFree(direction_str);
        }
       else
        {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]