Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75536 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-11-17 16:06:25


Author: danieljames
Date: 2011-11-17 16:06:25 EST (Thu, 17 Nov 2011)
New Revision: 75536
URL: http://svn.boost.org/trac/boost/changeset/75536

Log:
Quickbook: Move id_state together.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/id_manager.cpp | 82 +++++++++++++++++++--------------------
   1 files changed, 40 insertions(+), 42 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/id_manager.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/id_manager.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/id_manager.cpp 2011-11-17 16:06:25 EST (Thu, 17 Nov 2011)
@@ -238,48 +238,6 @@
     };
 
     //
- // id_state
- //
-
- id_placeholder* id_state::add_placeholder(
- std::string const& id, id_category category,
- id_placeholder* parent)
- {
- placeholders.push_back(id_placeholder(
- placeholders.size(), id, category, parent));
- return &placeholders.back();
- }
-
- id_placeholder* id_state::get_placeholder(string_ref value)
- {
- // If this isn't a placeholder id.
- if (value.size() <= 1 || *value.begin() != '$')
- return 0;
-
- unsigned index = boost::lexical_cast<int>(std::string(
- value.begin() + 1, value.end()));
-
- return &placeholders.at(index);
- }
-
- void id_state::switch_section(boost::intrusive_ptr<section_info> const& p)
- {
- assert(!current_file->switched_section);
- current_file->original_section = current_file->document->current_section;
- current_file->document->current_section = current_file->switched_section = p;
- }
-
- void id_state::restore_section()
- {
- // TODO: Restore when it's a parent
- if (current_file->switched_section &&
- current_file->switched_section == current_file->document->current_section)
- current_file->document->current_section = current_file->original_section;
- }
-
- // (continued later)
-
- //
     // id_manager
     //
 
@@ -417,6 +375,46 @@
         }
     }
 
+ //
+ // id_state
+ //
+
+ id_placeholder* id_state::add_placeholder(
+ std::string const& id, id_category category,
+ id_placeholder* parent)
+ {
+ placeholders.push_back(id_placeholder(
+ placeholders.size(), id, category, parent));
+ return &placeholders.back();
+ }
+
+ id_placeholder* id_state::get_placeholder(string_ref value)
+ {
+ // If this isn't a placeholder id.
+ if (value.size() <= 1 || *value.begin() != '$')
+ return 0;
+
+ unsigned index = boost::lexical_cast<int>(std::string(
+ value.begin() + 1, value.end()));
+
+ return &placeholders.at(index);
+ }
+
+ void id_state::switch_section(boost::intrusive_ptr<section_info> const& p)
+ {
+ assert(!current_file->switched_section);
+ current_file->original_section = current_file->document->current_section;
+ current_file->document->current_section = current_file->switched_section = p;
+ }
+
+ void id_state::restore_section()
+ {
+ // TODO: Restore when it's a parent
+ if (current_file->switched_section &&
+ current_file->switched_section == current_file->document->current_section)
+ current_file->document->current_section = current_file->original_section;
+ }
+
     std::string id_state::start_file(
             std::string const& include_doc_id,
             std::string const& id,


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