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. |