|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62476 - in trunk/tools/quickbook: . detail
From: daniel_james_at_[hidden]
Date: 2010-06-06 05:38:21
Author: danieljames
Date: 2010-06-06 05:38:20 EDT (Sun, 06 Jun 2010)
New Revision: 62476
URL: http://svn.boost.org/trac/boost/changeset/62476
Log:
Remove a lot of deprecated filesystem functions.
Still calls `normalize`. Refs #2923.
Text files modified:
trunk/tools/quickbook/Jamfile.v2 | 2 ++
trunk/tools/quickbook/detail/actions.cpp | 28 ++++++++++++++--------------
trunk/tools/quickbook/detail/actions_class.cpp | 4 ++--
trunk/tools/quickbook/detail/quickbook.cpp | 4 ++--
4 files changed, 20 insertions(+), 18 deletions(-)
Modified: trunk/tools/quickbook/Jamfile.v2
==============================================================================
--- trunk/tools/quickbook/Jamfile.v2 (original)
+++ trunk/tools/quickbook/Jamfile.v2 2010-06-06 05:38:20 EDT (Sun, 06 Jun 2010)
@@ -30,6 +30,8 @@
/boost//program_options
/boost//filesystem
: #<define>QUICKBOOK_NO_DATES
+ # Still using 'normalize' which has been deprecated.
+ #<define>BOOST_FILESYSTEM_NO_DEPRECATED
<toolset>msvc:<cxxflags>/wd4355
<toolset>msvc:<cxxflags>/wd4511
<toolset>msvc:<cxxflags>/wd4512
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2010-06-06 05:38:20 EDT (Sun, 06 Jun 2010)
@@ -453,12 +453,12 @@
fs::path const img_path(image_fileref);
attribute_map::iterator it = attributes.find("alt");
- std::string alt_text = it != attributes.end() ? it->second : fs::basename(img_path);
+ std::string alt_text = it != attributes.end() ? it->second : img_path.stem();
attributes.erase("alt");
attributes.insert(attribute_map::value_type("fileref", image_fileref));
- if(fs::extension(img_path) == ".svg")
+ if(img_path.extension() == ".svg")
{
//
// SVG's need special handling:
@@ -755,7 +755,7 @@
else if (!is_block)
{
// do a phrase level parse
- iterator first(body.begin(), body.end(), actions.filename.native_file_string().c_str());
+ iterator first(body.begin(), body.end(), actions.filename.file_string().c_str());
first.set_position(template_pos);
iterator last(body.end(), body.end());
r = boost::spirit::classic::parse(first, last, phrase_p).full;
@@ -770,7 +770,7 @@
body.push_back('\n');
while (iter != body.end() && ((*iter == '\r') || (*iter == '\n')))
++iter; // skip initial newlines
- iterator first(iter, body.end(), actions.filename.native_file_string().c_str());
+ iterator first(iter, body.end(), actions.filename.file_string().c_str());
first.set_position(template_pos);
iterator last(body.end(), body.end());
r = boost::spirit::classic::parse(first, last, block_p).full;
@@ -1149,7 +1149,7 @@
if (!path.is_complete())
{
fs::path infile = fs::complete(actions.filename).normalize();
- path = (infile.branch_path() / path).normalize();
+ path = (infile.parent_path() / path).normalize();
fs::path outdir = fs::complete(actions.outdir).normalize();
path = path_difference(outdir, path);
}
@@ -1289,7 +1289,7 @@
{
fs::path include_search(fs::path const & current, std::string const & name)
{
- fs::path path(name,fs::native);
+ fs::path path(name);
// If the path is relative, try and resolve it.
if (!path.is_complete())
@@ -1303,7 +1303,7 @@
// Search in each of the include path locations.
BOOST_FOREACH(std::string const & p, include_path)
{
- fs::path full(p,fs::native);
+ fs::path full(p);
full /= path;
if (fs::exists(full))
{
@@ -1318,8 +1318,8 @@
void import_action::operator()(iterator first, iterator last) const
{
- fs::path path = include_search(actions.filename.branch_path(), std::string(first,last));
- std::string ext = fs::extension(path);
+ fs::path path = include_search(actions.filename.parent_path(), std::string(first,last));
+ std::string ext = path.extension();
std::vector<template_symbol> storage;
actions.error_count +=
load_snippets(path.string(), storage, ext, actions.doc_id);
@@ -1343,7 +1343,7 @@
void include_action::operator()(iterator first, iterator last) const
{
- fs::path filein = include_search(actions.filename.branch_path(), std::string(first,last));
+ fs::path filein = include_search(actions.filename.parent_path(), std::string(first,last));
std::string doc_type, doc_id, doc_dirname, doc_last_revision;
// swap the filenames
@@ -1369,10 +1369,10 @@
}
// update the __FILENAME__ macro
- *boost::spirit::classic::find(actions.macro, "__FILENAME__") = actions.filename.native_file_string();
+ *boost::spirit::classic::find(actions.macro, "__FILENAME__") = actions.filename.file_string();
// parse the file
- quickbook::parse(actions.filename.native_file_string().c_str(), actions, true);
+ quickbook::parse(actions.filename.file_string().c_str(), actions, true);
// restore the values
std::swap(actions.filename, filein);
@@ -1458,7 +1458,7 @@
qbk_major_version = 1;
qbk_minor_version = 1;
qbk_version_n = 101;
- detail::outwarn(actions.filename.native_file_string(),1)
+ detail::outwarn(actions.filename.file_string(),1)
<< "Warning: Quickbook version undefined. "
"Version 1.1 is assumed" << std::endl;
}
@@ -1608,7 +1608,7 @@
if(!invalid_attributes.empty())
{
- detail::outwarn(actions.filename.native_file_string(),1)
+ detail::outwarn(actions.filename.file_string(),1)
<< (invalid_attributes.size() > 1 ?
"Invalid attributes" : "Invalid attribute")
<< " for '" << actions.doc_type << "': "
Modified: trunk/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions_class.cpp (original)
+++ trunk/tools/quickbook/detail/actions_class.cpp 2010-06-06 05:38:20 EDT (Sun, 06 Jun 2010)
@@ -43,7 +43,7 @@
, list_buffer()
// state
- , filename(fs::complete(fs::path(filein_, fs::native)))
+ , filename(fs::complete(fs::path(filein_)))
, outdir(outdir_)
, macro()
, section_level(0)
@@ -185,7 +185,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.native_file_string();
+ filename.file_string();
// add the predefined macros
macro.add
Modified: trunk/tools/quickbook/detail/quickbook.cpp
==============================================================================
--- trunk/tools/quickbook/detail/quickbook.cpp (original)
+++ trunk/tools/quickbook/detail/quickbook.cpp 2010-06-06 05:38:20 EDT (Sun, 06 Jun 2010)
@@ -196,7 +196,7 @@
{
int result = 0;
std::ofstream fileout(fileout_);
- fs::path outdir = fs::path(fileout_, fs::native).branch_path();
+ fs::path outdir = fs::path(fileout_).parent_path();
if (outdir.empty())
outdir = ".";
if (pretty_print)
@@ -238,7 +238,7 @@
using boost::program_options::positional_options_description;
// First thing, the filesystem should record the current working directory.
- boost::filesystem::initial_path();
+ boost::filesystem::initial_path<boost::filesystem::path>();
options_description desc("Allowed options");
desc.add_options()
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