Boost logo

Boost-Commit :

From: grafikrobot_at_[hidden]
Date: 2008-03-15 15:35:51


Author: grafik
Date: 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
New Revision: 43639
URL: http://svn.boost.org/trac/boost/changeset/43639

Log:
Merge latest quickbook from trunk to release.
Text files modified:
   branches/release/tools/quickbook/detail/actions.cpp | 30 +++++++++++++++++++-----------
   branches/release/tools/quickbook/detail/actions.hpp | 12 ++++++++++++
   branches/release/tools/quickbook/detail/actions_class.cpp | 3 +--
   branches/release/tools/quickbook/detail/actions_class.hpp | 4 ++--
   branches/release/tools/quickbook/doc_info.hpp | 9 +++++----
   5 files changed, 39 insertions(+), 19 deletions(-)

Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
@@ -1096,6 +1096,21 @@
             << " </author>\n";
     }
 
+ void xml_copyright::operator()(std::pair<std::vector<std::string>, std::string> const& copyright) const
+ {
+ out << "\n" << " <copyright>\n";
+
+ for_each(
+ copyright.first.begin()
+ , copyright.first.end()
+ , xml_year(out));
+
+ out << " <holder>" << copyright.second << "</holder>\n"
+ << " </copyright>\n"
+ << "\n"
+ ;
+ }
+
     void xml_year::operator()(std::string const &year) const
     {
         out << " <year>" << year << "</year>\n";
@@ -1170,19 +1185,12 @@
             out << " </authorgroup>\n";
         }
 
- if (!actions.doc_copyright_holder.empty())
+ if (!actions.doc_copyrights.empty())
         {
- out << "\n" << " <copyright>\n";
-
             for_each(
- actions.doc_copyright_years.begin()
- , actions.doc_copyright_years.end()
- , xml_year(out));
-
- out << " <holder>" << actions.doc_copyright_holder << "</holder>\n"
- << " </copyright>\n"
- << "\n"
- ;
+ actions.doc_copyrights.begin()
+ , actions.doc_copyrights.end()
+ , xml_copyright(out));
         }
 
         if (qbk_version_n < 103)

Modified: branches/release/tools/quickbook/detail/actions.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.hpp (original)
+++ branches/release/tools/quickbook/detail/actions.hpp 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
@@ -743,6 +743,18 @@
         collector& out;
     };
 
+ struct xml_copyright
+ {
+ // Handles xml copyright
+
+ xml_copyright(collector& out)
+ : out(out) {}
+
+ void operator()(std::pair<std::vector<std::string>, std::string> const &copyright) const;
+
+ collector& out;
+ };
+
     void pre(collector& out, quickbook::actions& actions, bool ignore_docinfo = false);
     void post(collector& out, quickbook::actions& actions, bool ignore_docinfo = false);
 

Modified: branches/release/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.cpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.cpp 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
@@ -24,8 +24,7 @@
         , doc_version()
         , doc_id()
         , doc_dirname()
- , doc_copyright_years()
- , doc_copyright_holder()
+ , doc_copyrights()
         , doc_purpose()
         , doc_category()
         , doc_authors()

Modified: branches/release/tools/quickbook/detail/actions_class.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.hpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.hpp 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
@@ -28,6 +28,7 @@
 
         typedef std::vector<std::string> string_list;
         typedef std::vector<std::pair<std::string, std::string> > author_list;
+ typedef std::vector<std::pair<string_list, std::string> > copyright_list;
         typedef std::pair<char, int> mark_type;
         static int const max_template_depth = 100;
 
@@ -37,8 +38,7 @@
         std::string doc_version;
         std::string doc_id;
         std::string doc_dirname;
- string_list doc_copyright_years;
- std::string doc_copyright_holder;
+ copyright_list doc_copyrights;
         std::string doc_purpose;
         std::string doc_category;
         author_list doc_authors;

Modified: branches/release/tools/quickbook/doc_info.hpp
==============================================================================
--- branches/release/tools/quickbook/doc_info.hpp (original)
+++ branches/release/tools/quickbook/doc_info.hpp 2008-03-15 15:35:51 EDT (Sat, 15 Mar 2008)
@@ -66,7 +66,7 @@
                               doc_version
                             | doc_id
                             | doc_dirname
- | doc_copyright
+ | doc_copyright [push_back_a(actions.doc_copyrights, copyright)]
                             | doc_purpose [actions.extract_doc_purpose]
                             | doc_category
                             | doc_authors
@@ -103,12 +103,12 @@
                     ;
 
                 doc_copyright =
- "copyright" >> hard_space
- >> +( repeat_p(4)[digit_p] [push_back_a(actions.doc_copyright_years)]
+ "copyright" >> hard_space [clear_a(copyright.first)]
+ >> +( repeat_p(4)[digit_p] [push_back_a(copyright.first)]
>> space
                         )
>> space
- >> (*(anychar_p - ']')) [assign_a(actions.doc_copyright_holder)]
+ >> (*(anychar_p - ']')) [assign_a(copyright.second)]
                     ;
 
                 doc_purpose =
@@ -178,6 +178,7 @@
 
             bool unused;
             std::pair<std::string, std::string> name;
+ std::pair<std::vector<std::string>, std::string> copyright;
             rule<Scanner> doc_info, doc_title, doc_version, doc_id, doc_dirname,
                             doc_copyright, doc_purpose,doc_category, doc_authors,
                             doc_author, comment, space, hard_space, doc_license,


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