From: <pat...@us...> - 2010-03-06 16:16:06
|
Revision: 639 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=639&view=rev Author: patrickh Date: 2010-03-06 16:15:59 +0000 (Sat, 06 Mar 2010) Log Message: ----------- Improve Doxygen usage. No functional changes. Modified Paths: -------------- trunk/cppdom/SpiritParser.h trunk/cppdom/cppdom.h Modified: trunk/cppdom/SpiritParser.h =================================================================== --- trunk/cppdom/SpiritParser.h 2010-03-06 16:03:29 UTC (rev 638) +++ trunk/cppdom/SpiritParser.h 2010-03-06 16:15:59 UTC (rev 639) @@ -187,11 +187,12 @@ }; /** -* XML grammar. -* Based on: http://www.w3.org/TR/2004/REC-xml-20040204/ -* -* type: BUILDER_T must implement the interface concept similar to XmlBuilder above. -*/ + * XML grammar. + * Based on: http://www.w3.org/TR/2004/REC-xml-20040204/ + * + * @tparam BUILDER_T must implement the interface concept similar to + * XmlBuilder above. + */ template<typename BUILDER_T> struct XmlGrammar : public grammar<XmlGrammar<BUILDER_T> > { @@ -301,7 +302,8 @@ }; -/** The actual parser class that we will use. +/** + * The actual parser class that we will use. * * Provides a simple interface for using the builder and grammar. */ Modified: trunk/cppdom/cppdom.h =================================================================== --- trunk/cppdom/cppdom.h 2010-03-06 16:03:29 UTC (rev 638) +++ trunk/cppdom/cppdom.h 2010-03-06 16:15:59 UTC (rev 639) @@ -115,27 +115,29 @@ //! namespace of the cppdom project namespace cppdom { - // Declare a version string constant that can be used at run time. + /** Declare a version string constant that can be used at run time. */ CPPDOM_EXPORT(const char*) getVersion(); - // Helper methods + /** Helper methods. */ template <class T> inline void ignore_unused_variable_warning(const T&) { } - // True if there are characters references: ex: & + /** True if there are characters references: ex: & */ CPPDOM_EXPORT(bool) textContainsXmlEscaping(const std::string& data); - // True if there are chars needing escaping + /** True if there are chars needing escaping. */ CPPDOM_EXPORT(bool) textNeedsXmlEscaping(const std::string& data, bool isCdata); - // Remove escaping from xml text + /** Removes escaping from XML text. */ CPPDOM_EXPORT(std::string) removeXmlEscaping(const std::string& data, bool isCdata); - // Add escaping to xml text + /** Adds escaping to XML text. */ CPPDOM_EXPORT(std::string) addXmlEscaping(const std::string& data, bool isCdata); - /** Method to split string base on seperator. + /** + * Method to split string base on seperator. * - * If separator does not exist in string, then just return that string in the output. + * If separator does not exist in string, then just return that string in + * the output. * * @example: * std::string s = "apple, orange, cherry, peach, grapefruit, cantalope,watermelon"; @@ -159,7 +161,7 @@ } } - //! xml parsing error codes enumeration + /** XML parsing error codes enumeration */ enum ErrorCode { xml_unknown = 0, /**< unspecified or unknown error */ @@ -175,7 +177,7 @@ xml_attr_value_expected, /**< expected value after an '=' in attribute */ xml_save_invalid_nodetype, /**< invalid nodetype encountered while saving */ - xml_invalid_operation, /**< Attempted to execute an xml operation that would cause invalid structure */ + xml_invalid_operation, /**< Attempted to execute an XML operation that would cause invalid structure */ xml_invalid_argument, /**< Attempted to pass an invalid argument */ // added by kevin for 0.7 compatibility... xml_filename_invalid, @@ -185,7 +187,8 @@ xml_dummy /**< dummy error code */ }; - // typedefs + /** @name Typedefs */ + //@{ /** smart pointer to node */ class Node; typedef cppdom_boost::shared_ptr<cppdom::Node> NodePtr; @@ -197,34 +200,34 @@ /** list of node smart pointer */ typedef std::vector<NodePtr> NodeList; typedef NodeList::iterator NodeListIterator; + //@} - // classes /** - * xml error class - * contains an ErrorCode and is thrown while parsing xml input + * XML error class. + * Contains an ErrorCode and is thrown while parsing XML input. */ class CPPDOM_CLASS Error : public std::exception { public: - /** constructor */ + /** Constructor. */ Error(ErrorCode code, std::string localDesc, std::string location); - /** constructor that can take line num */ + /** Constructor that can take line number. */ Error(ErrorCode code, std::string localDesc, std::string file, unsigned line_num); - /** returns the error code */ + /** Returns the error code. */ ErrorCode getError() const; virtual ~Error() throw(); - /** returns the string representation of the error code */ + /** Returns the string representation of the error code. */ std::string getStrError() const; std::string getString() const; - /** return additional error info */ + /** Returns additional error info. */ std::string getInfo() const; virtual const char* what() const throw(); @@ -237,29 +240,29 @@ /** - * xml stream position - * represents the position in the xml input stream; usable if load() - * throws an error on parsing xml content + * XML stream position. + * Represents the position in the XML input stream; usable if load() + * throws an error on parsing XML content. */ class CPPDOM_CLASS Location { public: - /** Constructor */ + /** Constructor. */ Location(); - /** returns current line */ + /** Returns current line. */ int getLine() const; - /** returns current position in a line */ + /** Returns current position in a line. */ int getPos() const; - /** advances a char */ + /** Advances a char. */ void step(int chars = 1); - /** indicates entering a new line */ + /** Indicates entering a new line. */ void newline(); - /** reset location */ + /** Resets location. */ void reset(); protected: @@ -268,44 +271,47 @@ }; - // typedefs - /** smart pointer for Context */ + /** @name Typedefs */ + //@{ + /** Smart pointer for Context */ typedef cppdom_boost::shared_ptr<class Context> ContextPtr; - /** smart pointer to the event handler */ + /** Smart pointer to the event handler */ typedef cppdom_boost::shared_ptr<class EventHandler> EventHandlerPtr; + //@} /** - * xml parsing context class. - * the class is the parsing context for the parsed xml document. - * the class has a tagname lookup table and an entity map + * XML parsing context class. + * The class is the parsing context for the parsed XML document. + * The class has a tagname lookup table and an entity map. */ class CPPDOM_CLASS Context { public: - /** ctor */ + /** Constructor. */ Context(); - /** dtor */ + + /** Destructor. */ virtual ~Context(); - /** returns the tagname by the tagname handle */ + /** Returns the tagname by the tagname handle. */ std::string getTagname(TagNameHandle handle); - /** inserts a tag name and returns a tag name handle to the string */ + /** Inserts a tag name and returns a tag name handle to the string. */ TagNameHandle insertTagname(const std::string& tagname); - /** returns the current location in the xml stream */ + /** Returns the current location in the XML stream. */ Location& getLocation(); - /** @name event handling methods */ + /** @name Event Handling Methods */ //@{ - /** sets the event handler; enables handling events */ + /** Sets the event handler; enables handling events. */ void setEventHandler(EventHandlerPtr ehptr); - /** returns the currently used eventhandler (per reference) */ + /** Returns the currently used eventhandler (per reference). */ EventHandler& getEventHandler(); - /** returns if a valid event handler is set */ + /** Returns if a valid event handler is set. */ bool hasEventHandler() const; //@} @@ -322,7 +328,7 @@ /** * XML attribute class. - * Just wraps a string (this is really just and attribute VALUE) + * Just wraps a string (this is really just and attribute VALUE). * This is just meant to be a "magic" class to provide some syntactic * sugar related to autoconversions and get<value>() usefullness. */ @@ -345,8 +351,9 @@ #ifndef CPPDOM_NO_MEMBER_TEMPLATES /** - * Set mData to the string value of val - * @note Requires a stream operation of type T + * Set mData to the string value of val. + * + * @note Requires a stream operation of type T. */ template<class T> void setValue(const T& val) @@ -370,8 +377,8 @@ // specializations, found below. #ifdef _MSC_VER /** - * Specialization of getValue<T> for std::string so that more than just the - * first word of the attribute string is returned. + * Specialization of getValue<T> for std::string so that more than just + * the first word of the attribute string is returned. */ template<> std::string getValue<std::string>() const @@ -381,7 +388,7 @@ #endif // ! _MSC_VER #endif // ! CPPDOM_NO_MEMBER_TEMPLATES - /** Autoconversion to string (so old code should work) */ + /** Autoconversion to string (so old code should work). */ operator std::string() const; bool operator==(const Attribute& rhs) @@ -446,18 +453,19 @@ }; - /** xml node. - * A node has the following properties - * name - The element name of the node - * type - The type of the node. see NodeType - * children - Child elements of the node - * cdata - the cdata content if of type cdata - * - */ + /** + * XML node. + * + * A node has the following properties: + * * name - The element name of the node. + * * type - The type of the node. see NodeType. + * * children - Child elements of the node. + * * cdata - the cdata content if of type cdata. + */ class CPPDOM_CLASS Node { public: - /** node type enumeration */ + /** Node type enumeration */ enum Type { xml_nt_node, /**< normal node, can contain subnodes */ @@ -467,15 +475,16 @@ }; friend class Parser; + protected: /** Default Constructor */ Node(); public: - /** constructor, takes xml context pointer */ + /** Constructor, takes XML context pointer. */ explicit Node(ContextPtr pctx); - /** Construct a node with a given name */ + /** Construct a node with a given name. */ explicit Node(std::string nodeName, ContextPtr ctx); Node(const Node& node); @@ -492,11 +501,14 @@ /** assign operator */ Node& operator=(const Node& node); - /** Returns true if the nodes are equal - * @param ignoreAttribs - Attributes to ignore in the comparison - * @param ignoreElements - Elements to ignore in the comparison - */ - bool isEqual(NodePtr otherNode, const std::vector<std::string>& ignoreAttribs, + /** + * Returns true if the nodes are equal. + * + * @param ignoreAttribs Attributes to ignore in the comparison. + * @param ignoreElements Elements to ignore in the comparison. + */ + bool isEqual(NodePtr otherNode, + const std::vector<std::string>& ignoreAttribs, const std::vector<std::string>& ignoreElements, bool dbgit=false, const unsigned debugIndent=0); @@ -506,14 +518,15 @@ return isEqual(otherNode, empty_strings, empty_strings ); } - /** Returns the local name of the node (the element name) */ + /** Returns the local name of the node (the element name). */ std::string getName(); - /** set the node name */ + + /** Sets the node name. */ void setName(const std::string& name); /** @name Type information */ //@{ - /** returns type of node */ + /** Returns type of node. */ Node::Type getType() const; bool isNode() @@ -525,26 +538,32 @@ bool isCData() { return getType() == xml_nt_cdata;} - /** sets new nodetype */ + /** Sets new nodetype. */ void setType(Node::Type type); //@} /** @name Attribute information */ //@{ - /** Check if the node has a given attribute */ + /** Checks if the node has a given attribute. */ bool hasAttribute(const std::string& name) const; /** - * Get the named attribute - * @returns empty string ("") if not found, else the value + * Gets the named attribute. + * * @post Object does not change. + * + * @return Empty string ("") if not found, else the value. */ Attribute getAttribute(const std::string& name) const; /** - * sets new attribute value - * @param attr - Attribute name to set. There must not be ANY spaces in this name - * @post Element.attr is set to value. If it didn't exist before, now it does. + * Sets new attribute value. + * + * @post Element.attr is set to value. If it did not exist before, now + * it does. + * + * @param attr Attribute name to set. There must not be ANY spaces in + * this name. */ void setAttribute(const std::string& attr, const Attribute& value); @@ -572,12 +591,14 @@ /** Direct access to attribute map. */ const Attributes& attrib() const; - /** returns attribute map of the node + /** + * Returns attribute map of the node. * @deprecated */ Attributes& getAttrMap(); - /** returns attribute map of the node + /** + * Returns attribute map of the node. * @deprecated */ const Attributes& getAttrMap() const; @@ -586,17 +607,24 @@ /** @name Children and parents */ //@{ - /** Returns true if the node has a child of the given name. - * @param name Name can be a single element name or a chain of the form "tag/tag/tag" + /** + * Returns true if the node has a child of the given name. + * + * @param name Name can be a single element name or a chain of the form + * "tag/tag/tag". */ bool hasChild(const std::string& name); - /** Returns the first child of the given local name. + /** + * Returns the first child of the given local name. */ NodePtr getChild(const std::string& name); - /** Return first child of the given name. - * @param name Name can be a single element name or a chain of the form "tag/tag/tag" + /** + * Return first child of the given name. + * + * @param name Name can be a single element name or a chain of the form + * "tag/tag/tag". */ NodePtr getChildPath(const std::string& path); @@ -604,27 +632,32 @@ NodeList& getChildren(); /** - * Returns a list of all children (one level deep) with local name of childName - * \note currently no path-like childname can be passed, like in e.g. msxml - * If has standard compose() functions, could impl this by calling getChildren(pred) + * Returns a list of all children (one level deep) with local name of + * childName. + * + * @note Currently no path-like childname can be passed, such as in + * MSXML. If has standard compose() functions, could impl this by + * calling getChildren(pred). */ NodeList getChildren(const std::string& name); /** * Returns list of all children. + * * @see getChildren - * @note Needed because of predicate template matching char* + * @note Needed because of predicate template matching char*. */ NodeList getChildren(const char* name); - /** Return a list of children that pass the given STL predicate */ + /** Return a list of children that pass the given STL predicate. */ template<class Predicate> NodeList getChildrenPred(Predicate pred) { NodeList result(0); NodeList::const_iterator iter; - // search for all occurances of nodename and insert them into the new list + // search for all occurances of nodename and insert them into the new + // list. for(iter = mNodeList.begin(); iter != mNodeList.end(); ++iter) { if (pred(*iter)) @@ -657,40 +690,47 @@ /** @name CData methods */ //@{ /** - * returns cdata string - * @note: For node type "cdata", this returns the local cdata. - * For other nodes, this attempts to find the first child cdata - * node and returns its data. + * Returns CDATA string. + * + * @note For node type "cdata", this returns the local cdata. + * For other nodes, this attempts to find the first child cdata + * node and returns its data. */ std::string getCdata(); /** - * Returns the full cdata of the node or immediate children. - * @note: For node type "cdata", this returns the local cdata. - * For other nodes, combines the cdata of all cdata children. - */ + * Returns the full CDATA of the node or immediate children. + * + * @note For node type "cdata", this returns the local cdata. + * For other nodes, combines the cdata of all cdata children. + */ std::string getFullCdata(); - /** Sets the node cdata. - * @post For cdata type nodes, this sets the contained cdata - * For other types, this sets the cdata of the first cdata node. - * If none exists, then one is created called "cdata". - */ + /** + * Sets the node CDATA. + * + * @post For CDATA type nodes, this sets the contained cdata + * For other types, this sets the cdata of the first cdata node. + * If none exists, then one is created called "cdata". + */ void setCdata(const std::string& cdata); //@} - /** @name load/save functions */ + /** @name Load/Save Functions */ //@{ - /** loads xml node from input stream */ + /** Loads XML node from input stream. */ void load(std::istream& in, ContextPtr& context); - /** saves node to xml output stream - * @param indent - The amount to indent - * @doIndent - If true, then indent the output - * @doNewline - If true then use newlines in output - */ - void save(std::ostream& out, int indent=0, bool doIndent=true, bool doNewline=true); + /** + * Saves node to xml output stream. + * + * @param indent The amount to indent. + * @param doIndent If true, then indent the output. + * @param doNewline If true then use newlines in output. + */ + void save(std::ostream& out, int indent = 0, bool doIndent = true, + bool doNewline = true); //@} /** Returns the context used for this node. */ @@ -711,15 +751,15 @@ }; - /** XML document root node. + /** + * XML document root node. * - * Structure of a cppdom document + * Structure of a cppdom document: * * Nested tree of nodes. Each node has a type (Node::Type). * Root node is of type document. Standard nodes are type node. * Under standard nodes there can be cdata nodes. These nodes are nodes * for containing the raw text inside an element. - * */ class CPPDOM_CLASS Document: public Node { @@ -729,36 +769,43 @@ ~Document(); - /** constructor taking xml context pointer */ + /** Constructor taking XML context pointer. */ explicit Document(ContextPtr context); - /** constructor taking xml context pointer */ + /** Constructor taking XML context pointer. */ explicit Document(std::string docName, ContextPtr context); - /** returns a list of processing instruction nodes */ + /** Returns a list of processing instruction nodes. */ NodeList& getPiList(); - /** returns a list of document type definition rules to check the xml file */ + /** + * Returns a list of document type definition rules to check the XML + * file. + */ NodeList& getDtdList(); - /** loads xml Document (node) from input stream */ + /** Loads XML Document (node) from input stream. */ void load(std::istream& in, ContextPtr& context); - /** saves node to xml output stream - * @param doIndent - If true, then indent the output. - * @param doNewline - If true, then use newlines in the output. - */ + /** + * Saves node to xml output stream. + * + * @param doIndent If true, then indent the output. + * @param doNewline If true, then use newlines in the output. + */ void save(std::ostream& out, bool doIndent=true, bool doNewline=true); /** - * \exception throws cppdom::Error when the file name is invalid. + * @throw cppdom::Error Thrown when the file name is invalid. */ void loadFile(const std::string& filename) throw(Error); void loadFileChecked(const std::string& filename); - /** Save the document to the given filename. - * @todo Fix this method. It doesn't work - */ + /** + * Saves the document to the given filename. + * + * @todo Fix this method. It doesn't work + */ void saveFile(std::string filename); @@ -770,37 +817,39 @@ NodeList mDtdRules; }; - /** Interface for xml parsing event handler */ + /** Interface for XML parsing event handler. */ class CPPDOM_CLASS EventHandler { public: - /** ctor */ + /** Constructor. */ EventHandler() {} - /** virtual dtor */ + /** Destructor. */ virtual ~EventHandler() {} - /** called when parsing of an xml document starts */ + /** Called when parsing of an xml document starts. */ virtual void startDocument() {} - /** called when ended parsing a document */ + /** Called when ended parsing a document. */ virtual void endDocument() {} - /** called when parsing a processing instruction */ + /** Called when parsing a processing instruction. */ virtual void processingInstruction(Node& pinode) { cppdom::ignore_unused_variable_warning(pinode);} - /** called when start parsing a node */ + /** Called when start parsing a node. */ virtual void startNode(const std::string& nodename) { cppdom::ignore_unused_variable_warning(nodename); } - /** called when an attribute list was parsed */ + + /** Called when an attribute list was parsed. */ virtual void parsedAttributes(Attributes& attr) { cppdom::ignore_unused_variable_warning(attr); } - /** called when parsing of a node was finished */ + + /** Called when parsing of a node was finished. */ virtual void endNode(Node& node) { cppdom::ignore_unused_variable_warning(node);} - /** called when a cdata section ended */ + /** Called when a cdata section ended. */ virtual void gotCdata(const std::string& cdata) { cppdom::ignore_unused_variable_warning(cdata); } }; @@ -809,10 +858,13 @@ // ----------------------------------- // /** @name Helper methods */ //@{ - /** Merges data from one node to another. + /** + * Merges data from one node to another. + * + * @post All elements and attributes in fromNode will exist in toNode. + * * @param fromNode Node to read data from. * @param toNode Node to merge data onto. - * @post All elements and attributes in fromNode will exist in toNode. */ CPPDOM_EXPORT(void) merge(NodePtr fromNode, NodePtr toNode); //@} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2010-03-06 16:19:48
|
Revision: 640 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=640&view=rev Author: patrickh Date: 2010-03-06 16:19:42 +0000 (Sat, 06 Mar 2010) Log Message: ----------- It is unwise to have a polymorphic type entirely inlined in a header. The base type needs to be compiled into the defining translation unit. Modified Paths: -------------- trunk/cppdom/cppdom.cpp trunk/cppdom/cppdom.h Modified: trunk/cppdom/cppdom.cpp =================================================================== --- trunk/cppdom/cppdom.cpp 2010-03-06 16:15:59 UTC (rev 639) +++ trunk/cppdom/cppdom.cpp 2010-03-06 16:19:42 UTC (rev 640) @@ -1087,4 +1087,49 @@ out.close(); } + EventHandler::EventHandler() + { + /* Do nothing. */ ; + } + + EventHandler::~EventHandler() + { + /* Do nothing. */ ; + } + + void EventHandler::startDocument() + { + /* Do nothing. */ ; + } + + void EventHandler::endDocument() + { + /* Do nothing. */ ; + } + + void EventHandler::processingInstruction(Node&) + { + /* Do nothing. */ ; + } + + void EventHandler::startNode(const std::string&) + { + /* Do nothing. */ ; + } + + void EventHandler::parsedAttributes(Attributes&) + { + /* Do nothing. */ ; + } + + void EventHandler::endNode(Node&) + { + /* Do nothing. */ ; + } + + void EventHandler::gotCdata(const std::string&) + { + /* Do nothing. */ ; + } + } Modified: trunk/cppdom/cppdom.h =================================================================== --- trunk/cppdom/cppdom.h 2010-03-06 16:15:59 UTC (rev 639) +++ trunk/cppdom/cppdom.h 2010-03-06 16:19:42 UTC (rev 640) @@ -822,36 +822,31 @@ { public: /** Constructor. */ - EventHandler() {} + EventHandler(); /** Destructor. */ - virtual ~EventHandler() {} + virtual ~EventHandler(); /** Called when parsing of an xml document starts. */ - virtual void startDocument() {} + virtual void startDocument(); /** Called when ended parsing a document. */ - virtual void endDocument() {} + virtual void endDocument(); /** Called when parsing a processing instruction. */ - virtual void processingInstruction(Node& pinode) - { cppdom::ignore_unused_variable_warning(pinode);} + virtual void processingInstruction(Node& pinode); /** Called when start parsing a node. */ - virtual void startNode(const std::string& nodename) - { cppdom::ignore_unused_variable_warning(nodename); } + virtual void startNode(const std::string& nodename); /** Called when an attribute list was parsed. */ - virtual void parsedAttributes(Attributes& attr) - { cppdom::ignore_unused_variable_warning(attr); } + virtual void parsedAttributes(Attributes& attr); /** Called when parsing of a node was finished. */ - virtual void endNode(Node& node) - { cppdom::ignore_unused_variable_warning(node);} + virtual void endNode(Node& node); /** Called when a cdata section ended. */ - virtual void gotCdata(const std::string& cdata) - { cppdom::ignore_unused_variable_warning(cdata); } + virtual void gotCdata(const std::string& cdata); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2010-05-09 20:35:30
|
Revision: 656 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=656&view=rev Author: patrickh Date: 2010-05-09 20:35:24 +0000 (Sun, 09 May 2010) Log Message: ----------- Avoid polluting the global namespace with 'using namespace' declarations in a header file. Submitted by: Jan P. Springer Modified Paths: -------------- trunk/cppdom/SpiritParser.cpp trunk/cppdom/SpiritParser.h Modified: trunk/cppdom/SpiritParser.cpp =================================================================== --- trunk/cppdom/SpiritParser.cpp 2010-04-14 13:26:39 UTC (rev 655) +++ trunk/cppdom/SpiritParser.cpp 2010-05-09 20:35:24 UTC (rev 656) @@ -41,6 +41,9 @@ */ #include <cppdom/SpiritParser.h> +namespace bs = boost::spirit; +using namespace boost::spirit; + namespace cppdom { Modified: trunk/cppdom/SpiritParser.h =================================================================== --- trunk/cppdom/SpiritParser.h 2010-04-14 13:26:39 UTC (rev 655) +++ trunk/cppdom/SpiritParser.h 2010-05-09 20:35:24 UTC (rev 656) @@ -56,10 +56,6 @@ #include <boost/spirit/iterator/multi_pass.hpp> #include <iostream> - -namespace bs = boost::spirit; -using namespace boost::spirit; - namespace cppdom { @@ -194,7 +190,7 @@ * XmlBuilder above. */ template<typename BUILDER_T> -struct XmlGrammar : public grammar<XmlGrammar<BUILDER_T> > +struct XmlGrammar : public boost::spirit::grammar<XmlGrammar<BUILDER_T> > { XmlGrammar(BUILDER_T* builder) : mBuilder(builder) @@ -208,6 +204,9 @@ { definition(XmlGrammar const& self) { + namespace bs = boost::spirit; + using namespace boost::spirit; + document = prolog >> element >> *misc; // Main document root ws = +space_p; // Whitespace, simplified from XML spec @@ -274,7 +273,7 @@ BOOST_SPIRIT_DEBUG_RULE(xmldecl); } - rule<ScannerT> attribute, + boost::spirit::rule<ScannerT> attribute, attrib_value, cdata_sect, cdata, @@ -296,7 +295,7 @@ xmldecl ; - rule<ScannerT> const& start() const + boost::spirit::rule<ScannerT> const& start() const { return document; } }; }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2011-04-04 23:45:30
|
Revision: 676 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=676&view=rev Author: patrickh Date: 2011-04-04 23:45:24 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Added missing #include directives. Submitted by: Doug McCorkle Modified Paths: -------------- trunk/cppdom/cppdom.cpp trunk/cppdom/ext/OptionRepository.cpp Modified: trunk/cppdom/cppdom.cpp =================================================================== --- trunk/cppdom/cppdom.cpp 2010-10-03 17:01:06 UTC (rev 675) +++ trunk/cppdom/cppdom.cpp 2011-04-04 23:45:24 UTC (rev 676) @@ -45,6 +45,7 @@ #include <iostream> #include <fstream> #include <string> +#include <iterator> // needed includes #include <cppdom/cppdom.h> Modified: trunk/cppdom/ext/OptionRepository.cpp =================================================================== --- trunk/cppdom/ext/OptionRepository.cpp 2010-10-03 17:01:06 UTC (rev 675) +++ trunk/cppdom/ext/OptionRepository.cpp 2011-04-04 23:45:24 UTC (rev 676) @@ -1,6 +1,7 @@ #include <cppdom/ext/OptionRepository.h> #include <sstream> +#include <iterator> #include <assert.h> namespace cppdom This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pat...@us...> - 2012-07-30 15:03:10
|
Revision: 699 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=699&view=rev Author: patrickh Date: 2012-07-30 15:02:59 +0000 (Mon, 30 Jul 2012) Log Message: ----------- Generate verison.h based on the version information from the CMake scripts. This officially breaks the SCons build. Submitted by: Doug McCorkle Modified Paths: -------------- trunk/cppdom/CMakeLists.txt Added Paths: ----------- trunk/cppdom/version.h.in Removed Paths: ------------- trunk/cppdom/version.h Modified: trunk/cppdom/CMakeLists.txt =================================================================== --- trunk/cppdom/CMakeLists.txt 2012-07-30 14:41:53 UTC (rev 698) +++ trunk/cppdom/CMakeLists.txt 2012-07-30 15:02:59 UTC (rev 699) @@ -2,6 +2,10 @@ # 2009-2011 Ryan Pavlik <rp...@ia...> # http://academic.cleardefinition.com/ # Iowa State University HCI Graduate Program/VRAC +set(CPPDOM_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}") +set(CPPDOM_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}") +set(CPPDOM_VERSION_PATCH "${CPACK_PACKAGE_VERSION_PATCH}") +configure_file(version.h.in "${CMAKE_CURRENT_SOURCE_DIR}/version.h" @ONLY) set(API config.h Deleted: trunk/cppdom/version.h =================================================================== --- trunk/cppdom/version.h 2012-07-30 14:41:53 UTC (rev 698) +++ trunk/cppdom/version.h 2012-07-30 15:02:59 UTC (rev 699) @@ -1,139 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil c-basic-offset: 3 -*- */ -// vim:cindent:ts=3:sw=3:et:tw=80:sta: -/*************************************************************** cppdom-cpr beg - * - * cppdom was forked from the original xmlpp version 0.6 under the LGPL. This - * new, branched xmlpp is under the same LGPL (of course) and is being - * maintained by: - * Kevin Meinert <sub...@us...> - * Allen Bierbaum <al...@us...> - * Ben Scott <non...@us...> - * - * ----------------------------------------------------------------- - * - * xmlpp - an xml parser and validator written in C++ - * copyright (c) 2000-2001 Michael Fink - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - * ----------------------------------------------------------------- - * File: $RCSfile$ - * Date modified: $Date$ - * Version: $Revision$ - * ----------------------------------------------------------------- - * - ************************************************************ cppdom-cpr-end */ -#ifndef CPPDOM_VERSION_H -#define CPPDOM_VERSION_H - -/** @file version.h - * This file contains two useful items. - * - 1. The preprocessor friendly CPPDOM_VERSION "string". It is in the form - * <major><minor><patch> where each part has exactly 3 digits. - * - 2. The C++ friendly variable, version, that contains the version as a - * string. It is in the form of <major>.<minor>.<patch> where each part - * has anywhere from 1 to 3 digits. - */ - -/** - * This is the "human-readable" CPPDOM version _string_. It is of the form - * <major><minor><patch>. Each part has exactly 3 digits. - */ -// The major/minor/patch version (up to 3 digits each). -#define CPPDOM_VERSION_MAJOR 1 -#define CPPDOM_VERSION_MINOR 3 -#define CPPDOM_VERSION_PATCH 0 - -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- -// To update the version number, do not modify anything below this line!!!! -//-------------------------------------------------------------------------- -//-------------------------------------------------------------------------- - - -//-------------------------------------------------------------------------- -// Define the helper macros -//-------------------------------------------------------------------------- - -// These helper macros are used build up the CPPDOM_VERSION macro -#define CPPDOM_GLUE(a,b) a ## b -#define CPPDOM_XGLUE(a,b) CPPDOM_GLUE(a,b) - -// These helpr macros are used to facilitate a zero left fill -#define CPPDOM_ZEROFILL(a) 0 ## a -#define CPPDOM_XZEROFILL(a) CPPDOM_ZEROFILL(a) - -// Fix up the major version by doing a zero left fill -#if CPPDOM_VERSION_MAJOR < 10 -# define CPPDOM_VERSION_MAJOR_FILLED \ - CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_MAJOR)) -#elif CPPDOM_VERSION_MAJOR < 100 -# define CPPDOM_VERSION_MAJOR_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_MAJOR) -#else -# define CPPDOM_VERSION_MAJOR_FILLED CPPDOM_VERSION_MAJOR -#endif - -// Fix up the minor version by doing a zero left fill -#if CPPDOM_VERSION_MINOR < 10 -# define CPPDOM_VERSION_MINOR_FILLED \ - CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_MINOR)) -#elif CPPDOM_VERSION_MINOR < 100 -# define CPPDOM_VERSION_MINOR_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_MINOR) -#else -# define CPPDOM_VERSION_MINOR_FILLED CPPDOM_VERSION_MINOR -#endif - -// Fix up the patch version by doing a zero left fill -#if CPPDOM_VERSION_PATCH < 10 -# define CPPDOM_VERSION_PATCH_FILLED \ - CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_PATCH)) -#elif CPPDOM_VERSION_PATCH < 100 -# define CPPDOM_VERSION_PATCH_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_PATCH) -#else -# define CPPDOM_VERSION_PATCH_FILLED CPPDOM_VERSION_PATCH -#endif - -//-------------------------------------------------------------------------- -// Define the CPPDOM_VERSION macro -//-------------------------------------------------------------------------- - -// Build up the CPPDOM_VERSION macro by pasting the individual parts together -/** - * The is the preprocessor-friendly version string. It is in the form of - * <major><minor><patch>. Each part has exactly 3 digits. - */ -#define CPPDOM_VERSION \ - CPPDOM_XGLUE( \ - CPPDOM_XGLUE(CPPDOM_VERSION_MAJOR_FILLED, CPPDOM_VERSION_MINOR_FILLED), \ - CPPDOM_VERSION_PATCH_FILLED \ - ) - -//-------------------------------------------------------------------------- -// Cleanup after ourselves and undef all internal macros. -//-------------------------------------------------------------------------- - -// Undef the all helper macros -#undef CPPDOM_XGLUE -#undef CPPDOM_GLUE -#undef CPPDOM_ZEROFILL -#undef CPPDOM_XZEROFILL - -// Undef the XXX_FILLED temporary macros -#undef CPPDOM_VERSION_MAJOR_FILLED -#undef CPPDOM_VERSION_MINOR_FILLED -#undef CPPDOM_VERSION_PATCH_FILLED - -#endif Added: trunk/cppdom/version.h.in =================================================================== --- trunk/cppdom/version.h.in (rev 0) +++ trunk/cppdom/version.h.in 2012-07-30 15:02:59 UTC (rev 699) @@ -0,0 +1,139 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil c-basic-offset: 3 -*- */ +// vim:cindent:ts=3:sw=3:et:tw=80:sta: +/*************************************************************** cppdom-cpr beg + * + * cppdom was forked from the original xmlpp version 0.6 under the LGPL. This + * new, branched xmlpp is under the same LGPL (of course) and is being + * maintained by: + * Kevin Meinert <sub...@us...> + * Allen Bierbaum <al...@us...> + * Ben Scott <non...@us...> + * + * ----------------------------------------------------------------- + * + * xmlpp - an xml parser and validator written in C++ + * copyright (c) 2000-2001 Michael Fink + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * ----------------------------------------------------------------- + * File: $RCSfile$ + * Date modified: $Date: 2011-05-01 11:07:55 -0500 (Sun, 01 May 2011) $ + * Version: $Revision: 683 $ + * ----------------------------------------------------------------- + * + ************************************************************ cppdom-cpr-end */ +#ifndef CPPDOM_VERSION_H +#define CPPDOM_VERSION_H + +/** @file version.h + * This file contains two useful items. + * - 1. The preprocessor friendly CPPDOM_VERSION "string". It is in the form + * <major><minor><patch> where each part has exactly 3 digits. + * - 2. The C++ friendly variable, version, that contains the version as a + * string. It is in the form of <major>.<minor>.<patch> where each part + * has anywhere from 1 to 3 digits. + */ + +/** + * This is the "human-readable" CPPDOM version _string_. It is of the form + * <major><minor><patch>. Each part has exactly 3 digits. + */ +// The major/minor/patch version (up to 3 digits each). +#define CPPDOM_VERSION_MAJOR @CPPDOM_VERSION_MAJOR@ +#define CPPDOM_VERSION_MINOR @CPPDOM_VERSION_MINOR@ +#define CPPDOM_VERSION_PATCH @CPPDOM_VERSION_PATCH@ + +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- +// To update the version number, do not modify anything below this line!!!! +//-------------------------------------------------------------------------- +//-------------------------------------------------------------------------- + + +//-------------------------------------------------------------------------- +// Define the helper macros +//-------------------------------------------------------------------------- + +// These helper macros are used build up the CPPDOM_VERSION macro +#define CPPDOM_GLUE(a,b) a ## b +#define CPPDOM_XGLUE(a,b) CPPDOM_GLUE(a,b) + +// These helpr macros are used to facilitate a zero left fill +#define CPPDOM_ZEROFILL(a) 0 ## a +#define CPPDOM_XZEROFILL(a) CPPDOM_ZEROFILL(a) + +// Fix up the major version by doing a zero left fill +#if CPPDOM_VERSION_MAJOR < 10 +# define CPPDOM_VERSION_MAJOR_FILLED \ + CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_MAJOR)) +#elif CPPDOM_VERSION_MAJOR < 100 +# define CPPDOM_VERSION_MAJOR_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_MAJOR) +#else +# define CPPDOM_VERSION_MAJOR_FILLED CPPDOM_VERSION_MAJOR +#endif + +// Fix up the minor version by doing a zero left fill +#if CPPDOM_VERSION_MINOR < 10 +# define CPPDOM_VERSION_MINOR_FILLED \ + CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_MINOR)) +#elif CPPDOM_VERSION_MINOR < 100 +# define CPPDOM_VERSION_MINOR_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_MINOR) +#else +# define CPPDOM_VERSION_MINOR_FILLED CPPDOM_VERSION_MINOR +#endif + +// Fix up the patch version by doing a zero left fill +#if CPPDOM_VERSION_PATCH < 10 +# define CPPDOM_VERSION_PATCH_FILLED \ + CPPDOM_XZEROFILL(CPPDOM_XZEROFILL(CPPDOM_VERSION_PATCH)) +#elif CPPDOM_VERSION_PATCH < 100 +# define CPPDOM_VERSION_PATCH_FILLED CPPDOM_XZEROFILL(CPPDOM_VERSION_PATCH) +#else +# define CPPDOM_VERSION_PATCH_FILLED CPPDOM_VERSION_PATCH +#endif + +//-------------------------------------------------------------------------- +// Define the CPPDOM_VERSION macro +//-------------------------------------------------------------------------- + +// Build up the CPPDOM_VERSION macro by pasting the individual parts together +/** + * The is the preprocessor-friendly version string. It is in the form of + * <major><minor><patch>. Each part has exactly 3 digits. + */ +#define CPPDOM_VERSION \ + CPPDOM_XGLUE( \ + CPPDOM_XGLUE(CPPDOM_VERSION_MAJOR_FILLED, CPPDOM_VERSION_MINOR_FILLED), \ + CPPDOM_VERSION_PATCH_FILLED \ + ) + +//-------------------------------------------------------------------------- +// Cleanup after ourselves and undef all internal macros. +//-------------------------------------------------------------------------- + +// Undef the all helper macros +#undef CPPDOM_XGLUE +#undef CPPDOM_GLUE +#undef CPPDOM_ZEROFILL +#undef CPPDOM_XZEROFILL + +// Undef the XXX_FILLED temporary macros +#undef CPPDOM_VERSION_MAJOR_FILLED +#undef CPPDOM_VERSION_MINOR_FILLED +#undef CPPDOM_VERSION_PATCH_FILLED + +#endif Property changes on: trunk/cppdom/version.h.in ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |