allenb 2002/02/20 22:54:57 PST
Modified files:
gamekernel/xmlpp xmlpp.cpp xmlpp.h
gamekernel/xmlpp/Test nodetest.cpp parsetest.cpp
Log:
More updates on the path to a JDOM-like system. There are several minor function name additions (and deprecations) to try to get a consistent function name convention
and also move towards the JDOM interface (sweet system).
The coolest addition: xmlattribute class
This class is not the type that is used with getAttribute() and setAttribute(). It has an interface for setting and getting non-string values. Namely things like:
mPos[2] = pos_node->getAttribute("z").getValue<float>();
and
pos_node->setAttribute("z", 12.0f);
The attribute class automatically converts between types. It uses templates and streams to work it's magic. The impl could be improved in the future (performance), but
for now it works very well and goes well beyond the JDOM abilities for type conversion (templates rock). NOTE: All old code should still work because xmlattribute auto
converts to and from std::string.
== Other interface changes ==
getName() vs get_name(), getType() vs get_type(), getAttribute() (above stuff), setName(), setAttribute(), addChild(), removeChild(), getChildren() vs children()
NOTE: I added std::cout messages in the deprecated methods (ie annoying messages). Once GK works with the new interface, if you tell me I can remove the old functions
(or someone else can if they feel the need). None of the changes should break old code, but it may output annoying messages (easy to fix since the message says exactly what to do).
Revision Changes Path
1.4 +2 -2 lib/gamekernel/xmlpp/Test/nodetest.cpp
1.6 +3 -3 lib/gamekernel/xmlpp/Test/parsetest.cpp
1.9 +7 -7 lib/gamekernel/xmlpp/xmlpp.cpp
1.14 +161 -13 lib/gamekernel/xmlpp/xmlpp.h
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/lib/gamekernel/xmlpp/Test/nodetest.cpp.diff?r1=1.3&r2=1.4&diff_format=h
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/lib/gamekernel/xmlpp/Test/parsetest.cpp.diff?r1=1.5&r2=1.6&diff_format=h
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/lib/gamekernel/xmlpp/xmlpp.cpp.diff?r1=1.8&r2=1.9&diff_format=h
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/isugamedev/lib/gamekernel/xmlpp/xmlpp.h.diff?r1=1.13&r2=1.14&diff_format=h
|