Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59562 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-02-07 04:11:44


Author: danieljames
Date: 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
New Revision: 59562
URL: http://svn.boost.org/trac/boost/changeset/59562

Log:
Make the quickbook.hpp and actions.hpp match their respective cpp files.
Text files modified:
   branches/quickbook-1.5-spirit2/actions.cpp | 1
   branches/quickbook-1.5-spirit2/actions.hpp | 42 +++++++++++++++++++++++++++------------
   branches/quickbook-1.5-spirit2/actions_class.cpp | 1
   branches/quickbook-1.5-spirit2/block.cpp | 1
   branches/quickbook-1.5-spirit2/boostbook.cpp | 2
   branches/quickbook-1.5-spirit2/doc_info.cpp | 1
   branches/quickbook-1.5-spirit2/doc_info_actions.cpp | 1
   branches/quickbook-1.5-spirit2/phrase.cpp | 1
   branches/quickbook-1.5-spirit2/phrase_actions.cpp | 1
   branches/quickbook-1.5-spirit2/phrase_image.cpp | 16 ++++++++------
   branches/quickbook-1.5-spirit2/quickbook.cpp | 1
   branches/quickbook-1.5-spirit2/quickbook.hpp | 36 +++++++++------------------------
   branches/quickbook-1.5-spirit2/template.cpp | 1
   13 files changed, 53 insertions(+), 52 deletions(-)

Modified: branches/quickbook-1.5-spirit2/actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/actions.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -12,7 +12,6 @@
 #include "actions.hpp"
 #include "actions_class.hpp"
 #include "doc_info.hpp"
-#include "quickbook.hpp" // TODO: Quickbook version number
 #include "utils.hpp"
 
 namespace quickbook

Modified: branches/quickbook-1.5-spirit2/actions.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions.hpp (original)
+++ branches/quickbook-1.5-spirit2/actions.hpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -10,11 +10,11 @@
 #if !defined(BOOST_SPIRIT_QUICKBOOK_ACTIONS_HPP)
 #define BOOST_SPIRIT_QUICKBOOK_ACTIONS_HPP
 
-#include <time.h>
 #include <map>
 #include <string>
 #include <vector>
 #include <boost/spirit/include/qi_symbols.hpp>
+#include <boost/spirit/include/phoenix_function.hpp>
 #include "fwd.hpp"
 
 #ifdef BOOST_MSVC
@@ -28,6 +28,33 @@
     namespace qi = boost::spirit::qi;
     using boost::spirit::unused_type;
 
+ extern unsigned qbk_major_version;
+ extern unsigned qbk_minor_version;
+ extern unsigned qbk_version_n; // qbk_major_version * 100 + qbk_minor_version
+
+ struct quickbook_since_impl {
+ template <typename Arg1>
+ struct result { typedef bool type; };
+
+ bool operator()(unsigned min_) const {
+ return qbk_version_n >= min_;
+ }
+ };
+
+ struct quickbook_before_impl {
+ template <typename Arg1>
+ struct result { typedef bool type; };
+
+ bool operator()(unsigned max_) const {
+ return qbk_version_n < max_;
+ }
+ };
+
+ namespace {
+ boost::phoenix::function<quickbook_since_impl> qbk_since;
+ boost::phoenix::function<quickbook_before_impl> qbk_before;
+ }
+
     struct macro {
         macro() {}
         explicit macro(char const* x) : raw_markup(x) {};
@@ -36,20 +63,9 @@
         std::string raw_markup;
     };
 
- typedef qi::symbols<char, macro> macro_symbols;
+ typedef qi::symbols<char, macro> macro_symbols;
 
     typedef boost::iterator_range<iterator> iterator_range;
- typedef std::map<std::string, std::string> attribute_map;
-
- struct actions;
- extern tm* current_time; // the current time
- extern tm* current_gm_time; // the current UTC time
- extern bool debug_mode;
- extern std::vector<std::string> include_path;
-
- // forward declarations
- struct actions;
- int parse(char const* filein_, actions& actor, bool ignore_docinfo = false);
 
     struct error_action
     {

Modified: branches/quickbook-1.5-spirit2/actions_class.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions_class.cpp (original)
+++ branches/quickbook-1.5-spirit2/actions_class.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -11,6 +11,7 @@
 
 #include <boost/filesystem/operations.hpp>
 #include "actions_class.hpp"
+#include "quickbook.hpp"
 
 #if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310))
 #pragma warning(disable:4355)

Modified: branches/quickbook-1.5-spirit2/block.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block.cpp (original)
+++ branches/quickbook-1.5-spirit2/block.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -20,7 +20,6 @@
 #include <boost/fusion/include/adapt_struct.hpp>
 #include "grammars.hpp"
 #include "block.hpp"
-#include "quickbook.hpp"
 #include "utils.hpp"
 #include "actions_class.hpp"
 #include "parse_utils.hpp"

Modified: branches/quickbook-1.5-spirit2/boostbook.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/boostbook.cpp (original)
+++ branches/quickbook-1.5-spirit2/boostbook.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -175,7 +175,7 @@
 
         actions.phrase << "></imagedata></imageobject>";
 
- attribute_map::const_iterator it = x.attributes.find("alt");
+ image2::attribute_map::const_iterator it = x.attributes.find("alt");
         if(it != x.attributes.end()) {
             // Also add a textobject -- use the basename of the image file.
             // This will mean we get "alt" attributes of the HTML img.

Modified: branches/quickbook-1.5-spirit2/doc_info.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info.cpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -10,7 +10,6 @@
 
 #include "doc_info.hpp"
 #include "grammars.hpp"
-#include "quickbook.hpp"
 #include "actions_class.hpp"
 #include "parse_utils.hpp"
 #include <boost/spirit/include/qi_core.hpp>

Modified: branches/quickbook-1.5-spirit2/doc_info_actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info_actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info_actions.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -14,6 +14,7 @@
 #include <utility>
 #include "fwd.hpp"
 #include "collector.hpp"
+#include "quickbook.hpp"
 #include "doc_info_actions.hpp"
 #include "actions_class.hpp"
 #include "utils.hpp"

Modified: branches/quickbook-1.5-spirit2/phrase.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -22,7 +22,6 @@
 #include "phrase.hpp"
 #include "grammars.hpp"
 #include "actions_class.hpp"
-#include "quickbook.hpp"
 #include "parse_utils.hpp"
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: branches/quickbook-1.5-spirit2/phrase_actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase_actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase_actions.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -14,6 +14,7 @@
 #include "utils.hpp"
 #include "code.hpp"
 #include "boostbook.hpp"
+#include "quickbook.hpp"
 
 namespace quickbook
 {

Modified: branches/quickbook-1.5-spirit2/phrase_image.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase_image.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase_image.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -21,8 +21,10 @@
 
     image2 process(quickbook::actions& actions, image const& x)
     {
- std::map<std::string, std::string> attributes(
- x.attributes.begin(), x.attributes.end());
+ typedef image2::attribute_map attribute_map;
+ typedef attribute_map::value_type attribute;
+
+ attribute_map attributes(x.attributes.begin(), x.attributes.end());
         
         if(attributes.size() != x.attributes.size()) {
             std::map<std::string, std::string> duplicates;
@@ -44,9 +46,9 @@
         }
     
         fs::path const img_path(x.image_filename);
- attributes.insert(attribute_map::value_type("fileref", x.image_filename));
+ attributes.insert(attribute("fileref", x.image_filename));
         // Note: If there is already an alt attribute this is a no-op.
- attributes.insert(attribute_map::value_type("alt", fs::basename(img_path)));
+ attributes.insert(attribute("alt", fs::basename(img_path)));
 
         if(fs::extension(img_path) == ".svg")
         {
@@ -61,7 +63,7 @@
            // a tiny box with scrollbars (Firefox), or else cropped to
            // fit in a tiny box (IE7).
            //
- attributes.insert(attribute_map::value_type("format", "SVG"));
+ attributes.insert(attribute("format", "SVG"));
            //
            // Image paths are relative to the html subdirectory:
            // TODO: This only works when you're running in the correct directory.
@@ -97,7 +99,7 @@
            b = svg_text.find('\"', a + 1);
            if(a != std::string::npos)
            {
- attributes.insert(attribute_map::value_type("contentwidth",
+ attributes.insert(attribute("contentwidth",
                 std::string(svg_text.begin() + a + 1, svg_text.begin() + b)));
            }
            a = svg_text.find("height");
@@ -106,7 +108,7 @@
            b = svg_text.find('\"', a + 1);
            if(a != std::string::npos)
            {
- attributes.insert(attribute_map::value_type("contentdepth",
+ attributes.insert(attribute("contentdepth",
                 std::string(svg_text.begin() + a + 1, svg_text.begin() + b)));
            }
         }

Modified: branches/quickbook-1.5-spirit2/quickbook.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/quickbook.cpp (original)
+++ branches/quickbook-1.5-spirit2/quickbook.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -17,6 +17,7 @@
 #include <boost/filesystem/operations.hpp>
 #include <boost/ref.hpp>
 #include "fwd.hpp"
+#include "quickbook.hpp"
 #include "actions_class.hpp"
 #include "grammars.hpp"
 #include "post_process.hpp"

Modified: branches/quickbook-1.5-spirit2/quickbook.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/quickbook.hpp (original)
+++ branches/quickbook-1.5-spirit2/quickbook.hpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -12,36 +12,20 @@
 #if !defined(BOOST_SPIRIT_QUICKBOOK_QUICKBOOK_HPP)
 #define BOOST_SPIRIT_QUICKBOOK_QUICKBOOK_HPP
 
-#include <boost/spirit/include/phoenix_function.hpp>
+#include <time.h>
+#include <string>
+#include <vector>
+#include "fwd.hpp"
 
 namespace quickbook
 {
- extern unsigned qbk_major_version;
- extern unsigned qbk_minor_version;
- extern unsigned qbk_version_n; // qbk_major_version * 100 + qbk_minor_version
+ extern tm* current_time; // the current time
+ extern tm* current_gm_time; // the current UTC time
+ extern bool debug_mode;
+ extern std::vector<std::string> include_path;
 
- struct quickbook_since_impl {
- template <typename Arg1>
- struct result { typedef bool type; };
-
- bool operator()(unsigned min_) const {
- return qbk_version_n >= min_;
- }
- };
-
- struct quickbook_before_impl {
- template <typename Arg1>
- struct result { typedef bool type; };
-
- bool operator()(unsigned max_) const {
- return qbk_version_n < max_;
- }
- };
-
- namespace {
- boost::phoenix::function<quickbook_since_impl> qbk_since;
- boost::phoenix::function<quickbook_before_impl> qbk_before;
- }
+ // forward declarations
+ int parse(char const* filein_, actions& actor, bool ignore_docinfo = false);
 }
 
 #endif

Modified: branches/quickbook-1.5-spirit2/template.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/template.cpp (original)
+++ branches/quickbook-1.5-spirit2/template.cpp 2010-02-07 04:11:42 EST (Sun, 07 Feb 2010)
@@ -12,7 +12,6 @@
 #include "phrase_actions.hpp"
 #include "grammars.hpp"
 #include "actions_class.hpp"
-#include "quickbook.hpp"
 #include "utils.hpp"
 
 #ifdef BOOST_MSVC


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