Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59287 - in branches/quickbook-1.5-spirit2: . detail
From: daniel_james_at_[hidden]
Date: 2010-01-27 16:59:11


Author: danieljames
Date: 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
New Revision: 59287
URL: http://svn.boost.org/trac/boost/changeset/59287

Log:
Avoid 'using namespace' as it confuses me.
Text files modified:
   branches/quickbook-1.5-spirit2/block.hpp | 2 +-
   branches/quickbook-1.5-spirit2/detail/actions.cpp | 5 ++---
   branches/quickbook-1.5-spirit2/detail/actions.hpp | 19 +++++++++++--------
   branches/quickbook-1.5-spirit2/detail/actions_class.hpp | 2 +-
   branches/quickbook-1.5-spirit2/detail/post_process.cpp | 4 +---
   branches/quickbook-1.5-spirit2/detail/quickbook.cpp | 13 ++++++-------
   branches/quickbook-1.5-spirit2/doc_info.hpp | 2 +-
   branches/quickbook-1.5-spirit2/grammars.hpp | 2 +-
   branches/quickbook-1.5-spirit2/phrase.hpp | 2 +-
   branches/quickbook-1.5-spirit2/syntax_highlight.hpp | 3 ++-
   10 files changed, 27 insertions(+), 27 deletions(-)

Modified: branches/quickbook-1.5-spirit2/block.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block.hpp (original)
+++ branches/quickbook-1.5-spirit2/block.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -24,7 +24,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace ph = boost::phoenix;
 
     template <typename Iterator, typename Actions, bool skip_initial_spaces>

Modified: branches/quickbook-1.5-spirit2/detail/actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/detail/actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/detail/actions.cpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -1224,9 +1224,8 @@
         if (err != 0)
             return err; // return early on error
 
- typedef classic::position_iterator<std::string::const_iterator> iterator_type;
- iterator_type first(code.begin(), code.end(), file);
- iterator_type last(code.end(), code.end());
+ iterator first(code.begin(), code.end(), file);
+ iterator last(code.end(), code.end());
 
         size_t fname_len = file.size();
         bool is_python = fname_len >= 3

Modified: branches/quickbook-1.5-spirit2/detail/actions.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/detail/actions.hpp (original)
+++ branches/quickbook-1.5-spirit2/detail/actions.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -32,13 +32,16 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace fs = boost::filesystem;
+ using boost::spirit::unused_type;
 
- // TODO: This is defined in two places.
- typedef qi::symbols<char, std::string> string_symbols;
+ // TODO: This is defined in two places.
+ typedef qi::symbols<char, std::string> string_symbols;
 
- typedef classic::position_iterator<std::string::const_iterator> iterator;
+ typedef boost::spirit::classic::position_iterator<
+ std::string::const_iterator> iterator;
+ typedef boost::spirit::classic::file_position file_position;
     typedef boost::iterator_range<iterator> iterator_range;
     typedef qi::symbols<char, std::string> string_symbols;
     typedef std::map<std::string, std::string> attribute_map;
@@ -584,8 +587,8 @@
         table_action(quickbook::actions& actions)
         : actions(actions) {}
 
- template <typename Arg1, typename Arg2>
- struct result { typedef void type; };
+ template <typename Arg1, typename Arg2>
+ struct result { typedef void type; };
 
         void operator()(boost::optional<std::string> const&, std::string const&) const;
 
@@ -648,8 +651,8 @@
         , section_level(section_level)
         , qualified_section_id(qualified_section_id) {}
 
- template <typename A1, typename A2>
- struct result { typedef void type; };
+ template <typename A1, typename A2>
+ struct result { typedef void type; };
 
         void operator()(boost::optional<std::string> const&, iterator_range) const;
 

Modified: branches/quickbook-1.5-spirit2/detail/actions_class.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/detail/actions_class.hpp (original)
+++ branches/quickbook-1.5-spirit2/detail/actions_class.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -15,7 +15,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace fs = boost::filesystem;
 
     struct actions

Modified: branches/quickbook-1.5-spirit2/detail/post_process.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/detail/post_process.cpp (original)
+++ branches/quickbook-1.5-spirit2/detail/post_process.cpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -20,10 +20,8 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace ph = boost::phoenix;
- using namespace ph::arg_names;
- using ph::bind;
     typedef std::string::const_iterator iter_type;
 
     struct printer

Modified: branches/quickbook-1.5-spirit2/detail/quickbook.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/detail/quickbook.cpp (original)
+++ branches/quickbook-1.5-spirit2/detail/quickbook.cpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -31,7 +31,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace fs = boost::filesystem;
     tm* current_time; // the current time
     tm* current_gm_time; // the current UTC time
@@ -58,10 +58,9 @@
             return err;
         }
 
- typedef classic::position_iterator<std::string::const_iterator> iterator_type;
- iterator_type first(storage.begin(), storage.end(), filein_);
- iterator_type last(storage.end(), storage.end());
- iterator_type start = first;
+ iterator first(storage.begin(), storage.end(), filein_);
+ iterator last(storage.end(), storage.end());
+ iterator start = first;
 
         doc_info_grammar<iterator, actions> l(actor);
         bool success = parse(first, last, l);
@@ -80,14 +79,14 @@
             }
         }
         else {
- classic::file_position const pos = first.get_position();
+ file_position const pos = first.get_position();
             detail::outerr(pos.file,pos.line)
                 << "Doc Info error near column " << pos.column << ".\n";
         }
 
         if (!success || first != last)
         {
- classic::file_position const pos = first.get_position();
+ file_position const pos = first.get_position();
             detail::outerr(pos.file,pos.line)
                 << "Syntax Error near column " << pos.column << ".\n";
             ++actor.error_count;

Modified: branches/quickbook-1.5-spirit2/doc_info.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info.hpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -23,7 +23,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace ph = boost::phoenix;
 
     template <typename Iterator, typename Actions>

Modified: branches/quickbook-1.5-spirit2/grammars.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/grammars.hpp (original)
+++ branches/quickbook-1.5-spirit2/grammars.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -16,7 +16,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
 
     template <typename Iterator, typename Actions>
     struct phrase_grammar : qi::grammar<Iterator>

Modified: branches/quickbook-1.5-spirit2/phrase.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase.hpp (original)
+++ branches/quickbook-1.5-spirit2/phrase.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -28,7 +28,7 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
     namespace ph = boost::phoenix;
 
     template <typename Rule, typename Action>

Modified: branches/quickbook-1.5-spirit2/syntax_highlight.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/syntax_highlight.hpp (original)
+++ branches/quickbook-1.5-spirit2/syntax_highlight.hpp 2010-01-27 16:59:09 EST (Wed, 27 Jan 2010)
@@ -18,7 +18,8 @@
 
 namespace quickbook
 {
- using namespace boost::spirit;
+ namespace qi = boost::spirit::qi;
+ using boost::spirit::unused_type;
 
     template <class Iterator, class EscapeActions>
     struct parse_escaped_impl


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk