Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67661 - trunk/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-01-04 17:34:37


Author: danieljames
Date: 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
New Revision: 67661
URL: http://svn.boost.org/trac/boost/changeset/67661

Log:
Use filesystem 3 in quickbook.

And remove cygwin 1.5 support.
Text files modified:
   trunk/tools/quickbook/src/actions.cpp | 18 ++++++++++--------
   trunk/tools/quickbook/src/actions.hpp | 2 +-
   trunk/tools/quickbook/src/actions_class.cpp | 4 ++--
   trunk/tools/quickbook/src/doc_info_actions.cpp | 8 ++++----
   trunk/tools/quickbook/src/input_path.cpp | 33 +--------------------------------
   trunk/tools/quickbook/src/quickbook.cpp | 4 ++--
   6 files changed, 20 insertions(+), 49 deletions(-)

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -11,8 +11,8 @@
 #include <numeric>
 #include <functional>
 #include <algorithm>
-#include <boost/filesystem/v2/convenience.hpp>
-#include <boost/filesystem/v2/fstream.hpp>
+#include <boost/filesystem/v3/convenience.hpp>
+#include <boost/filesystem/v3/fstream.hpp>
 #include <boost/lexical_cast.hpp>
 #include "quickbook.hpp"
 #include "actions.hpp"
@@ -509,7 +509,9 @@
         fs::path const img_path(image_fileref);
         
         attribute_map::iterator it = attributes.find("alt");
- std::string alt_text = it != attributes.end() ? it->second : img_path.stem();
+ std::string alt_text = it != attributes.end() ?
+ it->second :
+ img_path.stem().generic_string();
         attributes.erase("alt");
 
         attributes.insert(attribute_map::value_type("fileref", image_fileref));
@@ -1294,9 +1296,9 @@
         fs::path path(std::string(first, last));
         if (!path.is_complete())
         {
- fs::path infile = fs::complete(actions.filename).normalize();
+ fs::path infile = fs::absolute(actions.filename).normalize();
             path = (infile.parent_path() / path).normalize();
- fs::path outdir = fs::complete(actions.outdir).normalize();
+ fs::path outdir = fs::absolute(actions.outdir).normalize();
             path = path_difference(outdir, path);
         }
         return path;
@@ -1348,7 +1350,7 @@
         if(!actions.output_pre(actions.out)) return;
 
         fs::path path = include_search(actions.filename.parent_path(), std::string(first,last));
- std::string ext = path.extension();
+ std::string ext = path.extension().generic_string();
         std::vector<template_symbol> storage;
         actions.error_count +=
             load_snippets(path.string(), storage, ext, actions.doc_id);
@@ -1412,10 +1414,10 @@
         }
 
         // update the __FILENAME__ macro
- *boost::spirit::classic::find(actions.macro, "__FILENAME__") = actions.filename.file_string();
+ *boost::spirit::classic::find(actions.macro, "__FILENAME__") = actions.filename.native();
 
         // parse the file
- quickbook::parse_file(actions.filename.file_string().c_str(), actions, true);
+ quickbook::parse_file(actions.filename.native().c_str(), actions, true);
 
         // restore the values
         std::swap(actions.filename, filein);

Modified: trunk/tools/quickbook/src/actions.hpp
==============================================================================
--- trunk/tools/quickbook/src/actions.hpp (original)
+++ trunk/tools/quickbook/src/actions.hpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -15,7 +15,7 @@
 #include <vector>
 #include <stack>
 #include <algorithm>
-#include <boost/filesystem/v2/operations.hpp>
+#include <boost/filesystem/v3/operations.hpp>
 #include <boost/foreach.hpp>
 #include <boost/tuple/tuple.hpp>
 #include "fwd.hpp"

Modified: trunk/tools/quickbook/src/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.cpp (original)
+++ trunk/tools/quickbook/src/actions_class.cpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -44,7 +44,7 @@
         , list_buffer()
 
     // state
- , filename(fs::complete(fs::path(filein_)))
+ , filename(fs::absolute(fs::path(filein_)))
         , outdir(outdir_)
         , macro_change_depth(0)
         , macro()
@@ -206,7 +206,7 @@
         // turn off __FILENAME__ macro on debug mode = true
         std::string filename_str = debug_mode ?
             std::string("NO_FILENAME_MACRO_GENERATED_IN_DEBUG_MODE") :
- filename.file_string();
+ filename.native();
 
         // add the predefined macros
         macro.add

Modified: trunk/tools/quickbook/src/doc_info_actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/doc_info_actions.cpp (original)
+++ trunk/tools/quickbook/src/doc_info_actions.cpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -77,7 +77,7 @@
             qbk_major_version = 1;
             qbk_minor_version = 1;
             qbk_version_n = 101;
- detail::outwarn(actions.filename.file_string(),1)
+ detail::outwarn(actions.filename.native(),1)
                 << "Warning: Quickbook version undefined. "
                 "Version 1.1 is assumed" << std::endl;
         }
@@ -89,13 +89,13 @@
         
         if (qbk_version_n == 106)
         {
- detail::outwarn(actions.filename.file_string(),1)
+ detail::outwarn(actions.filename.native(),1)
                 << "Quickbook 1.6 is still under development and is "
                 "likely to change in the future." << std::endl;
         }
         else if(qbk_version_n < 100 || qbk_version_n > 106)
         {
- detail::outerr(actions.filename.file_string(),1)
+ detail::outerr(actions.filename.native(),1)
                 << "Unknown version of quickbook: quickbook "
                 << qbk_major_version
                 << "."
@@ -121,7 +121,7 @@
 
             if(!invalid_attributes.empty())
             {
- detail::outwarn(actions.filename.file_string(),1)
+ detail::outwarn(actions.filename.native(),1)
                     << (invalid_attributes.size() > 1 ?
                         "Invalid attributes" : "Invalid attribute")
                     << " for '" << actions.doc_type << " document info': "

Modified: trunk/tools/quickbook/src/input_path.cpp
==============================================================================
--- trunk/tools/quickbook/src/input_path.cpp (original)
+++ trunk/tools/quickbook/src/input_path.cpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -26,42 +26,11 @@
     }
 }}
 
-#elif defined(QUICKBOOK_CYGWIN_1_5)
-
-// Cygwin 1.5.x
-
-#include <boost/filesystem/v2/config.hpp>
-#include <windows.h>
-#include <sys/cygwin.h>
-
-namespace quickbook { namespace detail
-{
- void validate(boost::any& v,
- const std::vector<std::string>& values,
- input_path*, int)
- {
- std::string path
- = boost::program_options::validators::get_single_string(values);
-
- char result[MAX_PATH + 1];
-
-#if defined(BOOST_WINDOWS_PATH)
- cygwin_conv_to_win32_path(path.c_str(), result);
-#elif defined(BOOST_POSIX_PATH)
- cygwin_conv_to_posix_path(path.c_str(), result);
-#else
-# error "Boost filesystem path type doesn't seem to be set."
-#endif
-
- v = input_path(result);
- }
-}}
-
 #else
 
 // Cygwin 1.7.x
     
-#include <boost/filesystem/v2/config.hpp>
+#include <boost/filesystem/v3/config.hpp>
 #include <boost/scoped_array.hpp>
 #include <boost/program_options/errors.hpp>
 #include <windows.h>

Modified: trunk/tools/quickbook/src/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/src/quickbook.cpp (original)
+++ trunk/tools/quickbook/src/quickbook.cpp 2011-01-04 17:34:36 EST (Tue, 04 Jan 2011)
@@ -15,8 +15,8 @@
 #include "input_path.hpp"
 #include <boost/spirit/include/classic_iterator.hpp>
 #include <boost/program_options.hpp>
-#include <boost/filesystem/v2/path.hpp>
-#include <boost/filesystem/v2/operations.hpp>
+#include <boost/filesystem/v3/path.hpp>
+#include <boost/filesystem/v3/operations.hpp>
 #include <boost/ref.hpp>
 
 #include <stdexcept>


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