Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68394 - branches/quickbook-filenames/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-01-23 11:46:06


Author: danieljames
Date: 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
New Revision: 68394
URL: http://svn.boost.org/trac/boost/changeset/68394

Log:
Use filesystem alias more consistently.
Text files modified:
   branches/quickbook-filenames/tools/quickbook/src/code_snippet.cpp | 2 +-
   branches/quickbook-filenames/tools/quickbook/src/input_path.hpp | 6 +++++-
   branches/quickbook-filenames/tools/quickbook/src/quickbook.cpp | 10 ++++++----
   branches/quickbook-filenames/tools/quickbook/src/quickbook.hpp | 8 +++++---
   branches/quickbook-filenames/tools/quickbook/src/template_stack.hpp | 8 +++++---
   branches/quickbook-filenames/tools/quickbook/src/utils.cpp | 10 +++++-----
   branches/quickbook-filenames/tools/quickbook/src/utils.hpp | 12 ++++++++----
   7 files changed, 35 insertions(+), 21 deletions(-)

Modified: branches/quickbook-filenames/tools/quickbook/src/code_snippet.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/code_snippet.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/code_snippet.cpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -65,7 +65,7 @@
         std::string code;
         std::string id;
         std::vector<template_symbol>& storage;
- boost::filesystem::path filename;
+ fs::path filename;
         std::string const doc_id;
         char const* const source_type;
     };

Modified: branches/quickbook-filenames/tools/quickbook/src/input_path.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/input_path.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/input_path.hpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -14,7 +14,11 @@
 #include <boost/any.hpp>
 #include <string>
 
-namespace quickbook { namespace detail
+namespace quickbook
+{
+ namespace fs = boost::filesystem;
+
+namespace detail
 {
     // Use this class with Boost.Program Options to convert paths to the format
     // the Boost.Filesystem expects. This is needed on cygwin to convert cygwin

Modified: branches/quickbook-filenames/tools/quickbook/src/quickbook.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/quickbook.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/quickbook.cpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -165,6 +165,8 @@
 {
     try
     {
+ namespace fs = boost::filesystem;
+
         using boost::program_options::options_description;
         using boost::program_options::variables_map;
         using boost::program_options::store;
@@ -175,7 +177,7 @@
         using boost::program_options::positional_options_description;
 
         // First thing, the filesystem should record the current working directory.
- boost::filesystem::initial_path<boost::filesystem::path>();
+ fs::initial_path<fs::path>();
 
         options_description desc("Allowed options");
         desc.add_options()
@@ -257,7 +259,7 @@
                 = vm["include-path"].as<
                     std::vector<quickbook::detail::input_path> >();
             quickbook::include_path
- = std::vector<boost::filesystem::path>(paths.begin(), paths.end());
+ = std::vector<fs::path>(paths.begin(), paths.end());
         }
 
         if (vm.count("define"))
@@ -268,9 +270,9 @@
 
         if (vm.count("input-file"))
         {
- boost::filesystem::path filein(
+ fs::path filein(
                 vm["input-file"].as<quickbook::detail::input_path>());
- boost::filesystem::path fileout;
+ fs::path fileout;
 
             if (vm.count("output-file"))
             {

Modified: branches/quickbook-filenames/tools/quickbook/src/quickbook.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/quickbook.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/quickbook.hpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -15,18 +15,20 @@
 #include <time.h>
 #include <vector>
 #include <string>
-#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/v3/path.hpp>
 #include "fwd.hpp"
 
 namespace quickbook
 {
+ namespace fs = boost::filesystem;
+
     extern tm* current_time; // the current time
     extern tm* current_gm_time; // the current UTC time
     extern bool debug_mode;
- extern std::vector<boost::filesystem::path> include_path;
+ extern std::vector<fs::path> include_path;
     extern std::vector<std::string> preset_defines;
 
- int parse_file(boost::filesystem::path const& filein_, actions& actor, bool ignore_docinfo = false);
+ int parse_file(fs::path const& filein_, actions& actor, bool ignore_docinfo = false);
 }
 
 #endif

Modified: branches/quickbook-filenames/tools/quickbook/src/template_stack.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/template_stack.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/template_stack.hpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -22,11 +22,13 @@
 
 namespace quickbook
 {
+ namespace fs = boost::filesystem;
+
     struct template_body
     {
         template_body(
                 std::string const& content,
- boost::filesystem::path const& filename,
+ fs::path const& filename,
                 file_position const& position,
                 bool is_block
             )
@@ -38,7 +40,7 @@
         }
 
         std::string content;
- boost::filesystem::path filename;
+ fs::path filename;
         file_position position;
         bool is_block;
     };
@@ -51,7 +53,7 @@
                 std::string const& identifier,
                 std::vector<std::string> const& params,
                 std::string const& body,
- boost::filesystem::path const& filename,
+ fs::path const& filename,
                 file_position const& position,
                 bool is_block,
                 template_scope const* parent = 0)

Modified: branches/quickbook-filenames/tools/quickbook/src/utils.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/utils.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/utils.cpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -142,7 +142,7 @@
         return std::clog << "Error: ";
     }
 
- std::ostream& outerr(boost::filesystem::path const& file, int line)
+ std::ostream& outerr(fs::path const& file, int line)
     {
         if (line >= 0)
         {
@@ -157,7 +157,7 @@
         }
     }
 
- std::ostream& outwarn(boost::filesystem::path const& file, int line)
+ std::ostream& outwarn(fs::path const& file, int line)
     {
         if (line >= 0)
         {
@@ -229,7 +229,7 @@
 
     template <class InputIterator, class OutputIterator>
     bool normalize(InputIterator begin, InputIterator end,
- OutputIterator out, boost::filesystem::path const& filename)
+ OutputIterator out, fs::path const& filename)
     {
         std::string encoding = read_bom(begin, end, out);
 
@@ -254,7 +254,7 @@
         return true;
     }
 
- int load(boost::filesystem::path const& filename, std::string& storage)
+ int load(fs::path const& filename, std::string& storage)
     {
         using std::cerr;
         using std::endl;
@@ -262,7 +262,7 @@
         using std::ifstream;
         using std::istream_iterator;
 
- boost::filesystem::ifstream in(filename, std::ios_base::in);
+ fs::ifstream in(filename, std::ios_base::in);
 
         if (!in)
         {

Modified: branches/quickbook-filenames/tools/quickbook/src/utils.hpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/utils.hpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/utils.hpp 2011-01-23 11:45:57 EST (Sun, 23 Jan 2011)
@@ -17,7 +17,11 @@
 #include <boost/assert.hpp>
 #include <boost/filesystem/v3/path.hpp>
 
-namespace quickbook { namespace detail
+namespace quickbook {
+
+ namespace fs = boost::filesystem;
+
+namespace detail
 {
     void print_char(char ch, std::ostream& out);
     void print_string(std::basic_string<char> const& str, std::ostream& out);
@@ -62,12 +66,12 @@
     // or GCC format. Returns the stream to continue ouput of the verbose
     // error message.
     std::ostream & outerr();
- std::ostream & outerr(boost::filesystem::path const& file, int line = -1);
- std::ostream & outwarn(boost::filesystem::path const& file, int line = -1);
+ std::ostream & outerr(fs::path const& file, int line = -1);
+ std::ostream & outwarn(fs::path const& file, int line = -1);
 
     // load file into memory with extra trailing newlines to eliminate
     // the need to check for end of file in the grammar.
- int load(boost::filesystem::path const& filename, std::string& storage);
+ int load(fs::path const& filename, std::string& storage);
 
     // given a file extension, return the type of the source file
     // we'll have an internal database for known file types.


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