Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70130 - trunk/tools/bcp
From: john_at_[hidden]
Date: 2011-03-18 12:38:52


Author: johnmaddock
Date: 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
New Revision: 70130
URL: http://svn.boost.org/trac/boost/changeset/70130

Log:
Modify to use Filesystem V3 correctly.
Text files modified:
   trunk/tools/bcp/add_path.cpp | 6 ++++--
   trunk/tools/bcp/bcp_imp.cpp | 6 +++---
   trunk/tools/bcp/copy_path.cpp | 22 +++++++++++-----------
   trunk/tools/bcp/file_types.cpp | 8 ++++----
   trunk/tools/bcp/fileview.cpp | 2 +-
   trunk/tools/bcp/path_operations.cpp | 4 ++--
   6 files changed, 25 insertions(+), 23 deletions(-)

Modified: trunk/tools/bcp/add_path.cpp
==============================================================================
--- trunk/tools/bcp/add_path.cpp (original)
+++ trunk/tools/bcp/add_path.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -484,7 +484,8 @@
       //
       static const boost::regex lib1("boost/([^\\./]+)(?!detail).*");
       boost::smatch swhat;
- if(boost::regex_match(p.string(), swhat, lib1))
+ std::string gs(p.generic_string());
+ if(boost::regex_match(gs, swhat, lib1))
       {
          add_dependent_lib(swhat.str(1), p, view);
       }
@@ -492,7 +493,8 @@
       // and this one catches boost/x/y/whatever (for example numeric/ublas):
       //
       static const boost::regex lib2("boost/([^/]+/[^/]+)/(?!detail).*");
- if(boost::regex_match(p.string(), swhat, lib2))
+ gs = p.generic_string();
+ if(boost::regex_match(gs, swhat, lib2))
       {
          add_dependent_lib(swhat.str(1), p, view);
       }

Modified: trunk/tools/bcp/bcp_imp.cpp
==============================================================================
--- trunk/tools/bcp/bcp_imp.cpp (original)
+++ trunk/tools/bcp/bcp_imp.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -121,7 +121,7 @@
 fs::path get_short_path(const fs::path& p)
 {
    // truncate path no more than "x/y":
- std::string s = p.string();
+ std::string s = p.generic_string();
    std::string::size_type n = s.find('/');
    if(n != std::string::npos)
    {
@@ -244,7 +244,7 @@
       std::cout << "\n\nThe top level namespaces found for header and source files were:\n";
       while(i != j)
       {
- if(regex_match(i->second.string(), important_file))
+ if(regex_match(i->second.generic_string(), important_file))
             std::cout << i->first << " (from " << i->second << ")" << std::endl;
          ++i;
       }
@@ -253,7 +253,7 @@
       std::cout << "\n\nThe top level namespaces found for all other source files were:\n";
       while(i != j)
       {
- if(!regex_match(i->second.string(), important_file))
+ if(!regex_match(i->second.generic_string(), important_file))
             std::cout << i->first << " (from " << i->second << ")" << std::endl;
          ++i;
       }

Modified: trunk/tools/bcp/copy_path.cpp
==============================================================================
--- trunk/tools/bcp/copy_path.cpp (original)
+++ trunk/tools/bcp/copy_path.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -63,7 +63,7 @@
       static std::vector<char> v1, v2;
       v1.clear();
       v2.clear();
- std::ifstream is((m_boost_path / p).string().c_str());
+ std::ifstream is((m_boost_path / p).c_str());
       std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1));
 
       static boost::regex libname_matcher;
@@ -78,9 +78,9 @@
 
       std::ofstream os;
       if(m_unix_lines)
- os.open((m_dest_path / p).string().c_str(), std::ios_base::binary | std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out);
       else
- os.open((m_dest_path / p).string().c_str(), std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::out);
       os.write(&*v1.begin(), v1.size());
       os.close();
    }
@@ -89,7 +89,7 @@
       static std::vector<char> v1, v2;
       v1.clear();
       v2.clear();
- std::ifstream is((m_boost_path / p).string().c_str());
+ std::ifstream is((m_boost_path / p).c_str());
       std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1));
 
       static boost::regex libname_matcher;
@@ -111,9 +111,9 @@
 
       std::ofstream os;
       if(m_unix_lines)
- os.open((m_dest_path / p).string().c_str(), std::ios_base::binary | std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out);
       else
- os.open((m_dest_path / p).string().c_str(), std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::out);
       os.write(&*v1.begin(), v1.size());
       os.close();
    }
@@ -127,7 +127,7 @@
       static std::vector<char> v1, v2;
       v1.clear();
       v2.clear();
- std::ifstream is((m_boost_path / p).string().c_str());
+ std::ifstream is((m_boost_path / p).c_str());
       std::copy(std::istreambuf_iterator<char>(is), std::istreambuf_iterator<char>(), std::back_inserter(v1));
 
       static const boost::regex namespace_matcher(
@@ -202,20 +202,20 @@
 
       std::ofstream os;
       if(m_unix_lines)
- os.open((m_dest_path / p).string().c_str(), std::ios_base::binary | std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out);
       else
- os.open((m_dest_path / p).string().c_str(), std::ios_base::out);
+ os.open((m_dest_path / p).c_str(), std::ios_base::out);
       if(v1.size())
          os.write(&*v1.begin(), v1.size());
       os.close();
    }
    else if(m_unix_lines && !is_binary_file(p))
    {
- std::ifstream is((m_boost_path / p).string().c_str());
+ std::ifstream is((m_boost_path / p).c_str());
       std::istreambuf_iterator<char> isi(is);
       std::istreambuf_iterator<char> end;
 
- std::ofstream os((m_dest_path / p).string().c_str(), std::ios_base::binary | std::ios_base::out);
+ std::ofstream os((m_dest_path / p).c_str(), std::ios_base::binary | std::ios_base::out);
       std::ostreambuf_iterator<char> osi(os);
 
       std::copy(isi, end, osi);

Modified: trunk/tools/bcp/file_types.cpp
==============================================================================
--- trunk/tools/bcp/file_types.cpp (original)
+++ trunk/tools/bcp/file_types.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -23,7 +23,7 @@
       ")",
       boost::regex::perl | boost::regex::icase
       );
- return boost::regex_match(p.filename().string(), e);
+ return boost::regex_match(p.filename().generic_string(), e);
 }
 
 bool bcp_implementation::is_html_file(const fs::path& p)
@@ -34,7 +34,7 @@
          "html?|css"
       ")"
       );
- return boost::regex_match(p.filename().string(), e);
+ return boost::regex_match(p.filename().generic_string(), e);
 }
 
 bool bcp_implementation::is_binary_file(const fs::path& p)
@@ -52,7 +52,7 @@
       "|"
       "(Jamfile|makefile|configure)",
       boost::regex::perl | boost::regex::icase);
- return !boost::regex_match(p.leaf().string(), e);
+ return !boost::regex_match(p.leaf().generic_string(), e);
 
 }
 
@@ -67,6 +67,6 @@
       "(Jamfile|Jamroot)\\.?",
       boost::regex::perl | boost::regex::icase
       );
- return boost::regex_match(p.filename().string(), e);
+ return boost::regex_match(p.filename().generic_string(), e);
 }
 

Modified: trunk/tools/bcp/fileview.cpp
==============================================================================
--- trunk/tools/bcp/fileview.cpp (original)
+++ trunk/tools/bcp/fileview.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -57,7 +57,7 @@
 void fileview::open(const boost::filesystem::path& p)
 {
    cow();
- std::ifstream is(p.string().c_str());
+ std::ifstream is(p.c_str());
    if(!is)
    {
       std::string msg("Bad file name: ");

Modified: trunk/tools/bcp/path_operations.cpp
==============================================================================
--- trunk/tools/bcp/path_operations.cpp (original)
+++ trunk/tools/bcp/path_operations.cpp 2011-03-18 12:38:51 EDT (Fri, 18 Mar 2011)
@@ -21,8 +21,8 @@
 
 int compare_paths(const fs::path& a, const fs::path& b)
 {
- const std::string& as = a.string();
- const std::string& bs = b.string();
+ const std::string& as = a.generic_string();
+ const std::string& bs = b.generic_string();
    std::string::const_iterator i, j, k, l;
    i = as.begin();
    j = as.end();


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