From: <pat...@us...> - 2010-05-09 20:39:48
|
Revision: 658 http://xml-cppdom.svn.sourceforge.net/xml-cppdom/?rev=658&view=rev Author: patrickh Date: 2010-05-09 20:39:42 +0000 (Sun, 09 May 2010) Log Message: ----------- Merged r656 from the trunk: Avoid polluting the global namespace with 'using namespace' declarations in a header file. Submitted by: Jan P. Springer Modified Paths: -------------- branches/1.0/cppdom/SpiritParser.cpp branches/1.0/cppdom/SpiritParser.h Modified: branches/1.0/cppdom/SpiritParser.cpp =================================================================== --- branches/1.0/cppdom/SpiritParser.cpp 2010-05-09 20:37:14 UTC (rev 657) +++ branches/1.0/cppdom/SpiritParser.cpp 2010-05-09 20:39:42 UTC (rev 658) @@ -41,6 +41,9 @@ */ #include <cppdom/SpiritParser.h> +namespace bs = boost::spirit; +using namespace boost::spirit; + namespace cppdom { Modified: branches/1.0/cppdom/SpiritParser.h =================================================================== --- branches/1.0/cppdom/SpiritParser.h 2010-05-09 20:37:14 UTC (rev 657) +++ branches/1.0/cppdom/SpiritParser.h 2010-05-09 20:39:42 UTC (rev 658) @@ -56,10 +56,6 @@ #include <boost/spirit/iterator/multi_pass.hpp> #include <iostream> - -namespace bs = boost::spirit; -using namespace boost::spirit; - namespace cppdom { @@ -193,7 +189,7 @@ * type: BUILDER_T must implement the interface concept similar to 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) @@ -207,6 +203,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 @@ -273,7 +272,7 @@ BOOST_SPIRIT_DEBUG_RULE(xmldecl); } - rule<ScannerT> attribute, + boost::spirit::rule<ScannerT> attribute, attrib_value, cdata_sect, cdata, @@ -295,7 +294,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. |