-
Hyphens are now stripped in the constructor and added back by the write() method.
-
… methods from GTools.
-
The file existence checking is not to be done in GUrlFile as this class may create a new file. The check needs to be done in GXml.
-
An empty tag is defined by <name/>. Although the empty tag was identified correctly, the / was not stripped.
-
… exist. Element existence is verified by a NULL pointer.
-
The XML module now handles predefined entities. Special characters, such as " will now be transformed into their predefined entities, e.g. ", when writing the XML file. Upon reading, predefined entities will be converted into special chacaters, so that the user always deals with a human readable string.
-
Hierarchical element access methods have been added to GXml and GXmlNode.Using a string in the format "params > param[1] > value > struct" one can in a single method call walk down the hierarchy of an XML document to access an element. The squared brackets allow specifying an element index in case that multiple elements with the same name exist. If squared brackets are omitted, an index of 0 is assumed. If the indicated element does not exist, the method returns a pointer to NULL.
-
The coding and design conventions (CDC) document was also updated.
-
I ran this build: CXXFLAGS="-Wall -Wno-c++11-long-long -pedantic -std=c++98" ./configure make -j 1 This commit fixes the few compiler warnings that showed up (all unimportant). There is no way to fix the issue that `long long` is not standard C++98, but it's an extension that has been supported by most compilers for a decade, so it's OK to ignore: http://stackoverflow.com/questions/4017621/how-to-do-portable-64-bit-arithmetic-without-compiler-warnings
-
Delete statements have been added to the remove() method(s) so that the elements are properly deleted before the pointers are erased.
-
These are the final modifications for the GammaLib core code review.
-
Add GChatter argument to print() method. The print() method now takes an argument of type GChatter to control the chattiness of the output in a homogenous manner. Pass NORMAL chatter level in __str__ method. Add chatter argument to print() methods. Use GLog::chatter() method to control the chattiness of the log stream operator. Add chatter() methods and provide member access through const references. Add chatter() methods, provide member access through const references, and declare one liners as inline methods. The chatter() methods control the new m_chatter attribute that is used to control the chattiness of the object's print() methods. name() and version() methods return const references. logFileOpen() method now sets the chattiness from the applications's chatter parameter, and name() and version() methods now return a const reference.
-
The remove_attribute() method allows removing of attributes from an XML element. Now the user has full control about adding, changing and removing attributes.
-
Text should never be indented in an XML file as text follows directly the tag end.
-
A element containing a single text leaf should be written in a single line without indentation. This special case is now detected and the proper formatting is performed.
-
The class now derives from GContainer and implements all container class interfaces. Nodes are now passed by reference and cloned internally. This gives full and save memory management to the XML classes.
-
The class now derives from the GContainer class. The full container interface has been implemented and the interface has been globally reviewed.
-
The use of the new GUrl class insread of the FILE type allows now for transparent input and output of an XML document in different URL types. So far only the file type URL exists (GUrlFile), but this can now easily be expanded to support piping into a string or direct http transfer. The latter is particularily useful for XML-RPC implementation.
-
The parse() method now either parses a file or a text string, depending on whether a valid file pointer or text string is provided. This option is now used in the GXml(const std::string& xml) constructor that will interpret the argument as either a text string or a file name. The interpretation is done on basis of the 5 first characters. If the string starts with "<?xml" the string is an XML document, otherwise it will be interpreted as a filename.
-
All classes now derive from GBase. ostream and GLog friends are removed since they are now implement at the GBase level.