Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65012 - trunk/tools/quickbook/detail
From: dnljms_at_[hidden]
Date: 2010-08-26 04:06:52


Author: danieljames
Date: 2010-08-26 04:06:42 EDT (Thu, 26 Aug 2010)
New Revision: 65012
URL: http://svn.boost.org/trac/boost/changeset/65012

Log:
Warn about dirname, only valid for library.
Text files modified:
   trunk/tools/quickbook/detail/actions.cpp | 53 +++++++++++++++++++++++----------------
   1 files changed, 31 insertions(+), 22 deletions(-)

Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2010-08-26 04:06:42 EDT (Thu, 26 Aug 2010)
@@ -1620,6 +1620,8 @@
             return;
         }
 
+ // Quickbook version
+
         if (qbk_major_version == -1)
         {
             // hard code quickbook version to v1.1
@@ -1653,6 +1655,35 @@
             ++actions.error_count;
         }
 
+ // Warn about invalid fields
+
+ if (actions.doc_type != "library")
+ {
+ std::vector<std::string> invalid_attributes;
+
+ if (!actions.doc_purpose.empty())
+ invalid_attributes.push_back("purpose");
+
+ if (!actions.doc_categories.empty())
+ invalid_attributes.push_back("category");
+
+ if (!actions.doc_dirname.empty())
+ invalid_attributes.push_back("dirname");
+
+ if(!invalid_attributes.empty())
+ {
+ detail::outwarn(actions.filename.file_string(),1)
+ << (invalid_attributes.size() > 1 ?
+ "Invalid attributes" : "Invalid attribute")
+ << " for '" << actions.doc_type << " document info': "
+ << boost::algorithm::join(invalid_attributes, ", ")
+ << "\n"
+ ;
+ }
+ }
+
+ // Write out header
+
         out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
             << "<!DOCTYPE "
             << actions.doc_type
@@ -1718,7 +1749,6 @@
 
     void write_document_info(collector& out, quickbook::actions& actions)
     {
- std::vector<std::string> invalid_attributes;
         std::ostringstream tmp;
 
         if(!actions.doc_authors.empty())
@@ -1780,11 +1810,6 @@
 
         if (!actions.doc_purpose.empty())
         {
- if (actions.doc_type != "library")
- {
- invalid_attributes.push_back("purpose");
- }
-
             tmp << " <" << actions.doc_type << "purpose>\n"
                 << " " << actions.doc_purpose.get(103)
                 << " </" << actions.doc_type << "purpose>\n"
@@ -1794,11 +1819,6 @@
 
         if (!actions.doc_categories.empty())
         {
- if (actions.doc_type != "library")
- {
- invalid_attributes.push_back("category");
- }
-
             for(actions::docinfo_list::const_iterator
                 it = actions.doc_categories.begin(),
                 end = actions.doc_categories.end();
@@ -1821,17 +1841,6 @@
                 << "\n"
             ;
         }
-
- if(!invalid_attributes.empty())
- {
- detail::outwarn(actions.filename.file_string(),1)
- << (invalid_attributes.size() > 1 ?
- "Invalid attributes" : "Invalid attribute")
- << " for '" << actions.doc_type << " document info': "
- << boost::algorithm::join(invalid_attributes, ", ")
- << "\n"
- ;
- }
     }
 
     void phrase_to_string_action::operator()(iterator first, iterator last) const


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