Update of /cvsroot/boost/boost/tools/quickbook/detail
In directory 
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv27100/tools/quickbook_backend/detail

Modified Files:
      Tag: QUICKBOOK_BACKEND
        actions.cpp actions.hpp actions_class.cpp actions_class.hpp 
        quickbook.cpp 
Log Message:
Merge from head.

Index: actions.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions.cpp,v
retrieving revision 1.49.2.7
retrieving revision 1.49.2.8
diff -u -d -r1.49.2.7 -r1.49.2.8
--- actions.cpp 11 Jul 2007 04:55:13 -0000      1.49.2.7
+++ actions.cpp 30 Jul 2007 14:47:14 -0000      1.49.2.8
@@ -162,6 +162,31 @@
         out << post;
     }
 
+    void cond_phrase_action_pre::operator()(iterator first, iterator last) 
const
+    {
+        std::string str(first, last);
+        conditions.push_back(find(macro, str.c_str()));
+        out.push(); // save the stream
+    }
+
+    void cond_phrase_action_post::operator()(iterator first, iterator last) 
const
+    {
+        bool symbol_found = conditions.back();
+        conditions.pop_back();
+
+        if (first == last || !symbol_found)
+        {
+            out.pop(); // restore the stream
+        }
+        else
+        {
+            std::string save;
+            out.swap(save);
+            out.pop(); // restore the stream
+            out << save; // print the body
+        }
+    }
+
     void list_action::operator()(iterator first, iterator last) const
     {
         BOOST_ASSERT(!list_marks.empty()); // there must be at least one item 
in the stack

Index: actions.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions.hpp,v
retrieving revision 1.36.2.6
retrieving revision 1.36.2.7
diff -u -d -r1.36.2.6 -r1.36.2.7
--- actions.hpp 11 Jul 2007 04:55:13 -0000      1.36.2.6
+++ actions.hpp 30 Jul 2007 14:47:14 -0000      1.36.2.7
@@ -84,6 +84,44 @@
         string_symbols const& macro;
     };
 
+    struct cond_phrase_action_pre
+    {
+        //  Handles conditional phrases
+
+        cond_phrase_action_pre(
+            collector& out
+          , std::vector<bool>& conditions
+          , string_symbols const& macro)
+        : out(out)
+        , conditions(conditions)
+        , macro(macro) {}
+
+        void operator()(iterator first, iterator last) const;
+
+        collector& out;
+        std::vector<bool>& conditions;
+        string_symbols const& macro;
+    };
+
+    struct cond_phrase_action_post
+    {
+        //  Handles conditional phrases
+
+        cond_phrase_action_post(
+            collector& out
+          , std::vector<bool>& conditions
+          , string_symbols const& macro)
+        : out(out)
+        , conditions(conditions)
+        , macro(macro) {}
+
+        void operator()(iterator first, iterator last) const;
+
+        collector& out;
+        std::vector<bool>& conditions;
+        string_symbols const& macro;
+    };
+
     struct list_action
     {
         //  Handles lists

Index: actions_class.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions_class.cpp,v
retrieving revision 1.9.2.6
retrieving revision 1.9.2.7
diff -u -d -r1.9.2.6 -r1.9.2.7
--- actions_class.cpp   11 Jul 2007 04:55:13 -0000      1.9.2.6
+++ actions_class.cpp   30 Jul 2007 14:47:14 -0000      1.9.2.7
@@ -100,6 +100,8 @@
         , plain_char(phrase)
         , raw_char(phrase)
         , image("image",*this)
+        , cond_phrase_pre(phrase, conditions, macro)
+        , cond_phrase_post(phrase, conditions, macro)
 
         , list(out, list_buffer, list_indent, list_marks)
         , list_format(list_buffer, list_indent, list_marks)

Index: actions_class.hpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/actions_class.hpp,v
retrieving revision 1.9.2.6
retrieving revision 1.9.2.7
diff -u -d -r1.9.2.6 -r1.9.2.7
--- actions_class.hpp   11 Jul 2007 04:55:13 -0000      1.9.2.6
+++ actions_class.hpp   30 Jul 2007 14:47:14 -0000      1.9.2.7
@@ -89,6 +89,7 @@
         std::string             macro_id;
         std::stack<mark_type>   list_marks;
         int                     list_indent;
+        std::vector<bool>       conditions;
         string_list             template_info;
         int                     template_depth;
         bool                    template_escape;
@@ -123,6 +124,8 @@
         plain_char_action       plain_char;
         raw_char_action         raw_char;
         image_action            image;
+        cond_phrase_action_pre  cond_phrase_pre;
+        cond_phrase_action_post cond_phrase_post;
 
         list_action             list;
         list_format_action      list_format;

Index: quickbook.cpp
===================================================================
RCS file: /cvsroot/boost/boost/tools/quickbook/detail/quickbook.cpp,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -d -r1.29.2.1 -r1.29.2.2
--- quickbook.cpp       13 Apr 2007 03:28:16 -0000      1.29.2.1
+++ quickbook.cpp       30 Jul 2007 14:47:14 -0000      1.29.2.2
@@ -26,7 +26,7 @@
 #pragma warning(disable:4355)
 #endif
 
-#define QUICKBOOK_VERSION "Quickbook Version 1.3"
+#define QUICKBOOK_VERSION "Quickbook Version 1.4"
 
 namespace quickbook
 {


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to