|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r50382 - in sandbox/filesystem-v3: boost/filesystem boost/filesystem/v3 libs/filesystem/build libs/filesystem/doc libs/filesystem/example libs/filesystem/src libs/filesystem/test libs/filesystem/v3/build libs/filesystem/v3/doc libs/filesystem/v3/example libs/filesystem/v3/src libs/filesystem/v3/test
From: bdawes_at_[hidden]
Date: 2008-12-24 09:39:03
Author: bemandawes
Date: 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
New Revision: 50382
URL: http://svn.boost.org/trac/boost/changeset/50382
Log:
filesystem-v3: move files around
Added:
sandbox/filesystem-v3/boost/filesystem/config.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/config.hpp
sandbox/filesystem-v3/boost/filesystem/convenience.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/convenience.hpp
sandbox/filesystem-v3/boost/filesystem/exception.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/exception.hpp
sandbox/filesystem-v3/boost/filesystem/fstream.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/fstream.hpp
sandbox/filesystem-v3/boost/filesystem/operations.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/operations.hpp
sandbox/filesystem-v3/boost/filesystem/path.hpp (props changed)
- copied unchanged from r50381, /sandbox/filesystem-v3/boost/filesystem/v3/path.hpp
sandbox/filesystem-v3/libs/filesystem/build/ (props changed)
- copied from r50381, /sandbox/filesystem-v3/libs/filesystem/v3/build/
sandbox/filesystem-v3/libs/filesystem/doc/ (props changed)
- copied from r50381, /sandbox/filesystem-v3/libs/filesystem/v3/doc/
sandbox/filesystem-v3/libs/filesystem/example/ (props changed)
- copied from r50381, /sandbox/filesystem-v3/libs/filesystem/v3/example/
sandbox/filesystem-v3/libs/filesystem/src/ (props changed)
- copied from r50381, /sandbox/filesystem-v3/libs/filesystem/v3/src/
sandbox/filesystem-v3/libs/filesystem/test/ (props changed)
- copied from r50381, /sandbox/filesystem-v3/libs/filesystem/v3/test/
Removed:
sandbox/filesystem-v3/boost/filesystem/v3/config.hpp
sandbox/filesystem-v3/boost/filesystem/v3/convenience.hpp
sandbox/filesystem-v3/boost/filesystem/v3/exception.hpp
sandbox/filesystem-v3/boost/filesystem/v3/fstream.hpp
sandbox/filesystem-v3/boost/filesystem/v3/operations.hpp
sandbox/filesystem-v3/boost/filesystem/v3/path.hpp
sandbox/filesystem-v3/libs/filesystem/v3/build/
sandbox/filesystem-v3/libs/filesystem/v3/doc/
sandbox/filesystem-v3/libs/filesystem/v3/example/
sandbox/filesystem-v3/libs/filesystem/v3/src/
sandbox/filesystem-v3/libs/filesystem/v3/test/
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/config.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/config.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,112 +0,0 @@
-// boost/filesystem/config.hpp ---------------------------------------------//
-
-// Copyright Beman Dawes 2003
-
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_CONFIG_HPP
-#define BOOST_FILESYSTEM_CONFIG_HPP
-
-#define BOOST_FILESYSTEM_I18N // aid users wishing to compile several versions
-
-// ability to change namespace aids path_table.cpp ------------------------//
-#ifndef BOOST_FILESYSTEM_NAMESPACE
-# define BOOST_FILESYSTEM_NAMESPACE filesystem
-#endif
-
-// This header implements separate compilation features as described in
-// http://www.boost.org/more/separate_compilation.html
-
-#include <boost/config.hpp>
-#include <boost/detail/workaround.hpp>
-
-// determine platform ------------------------------------------------------//
-
-// BOOST_POSIX_API or BOOST_WINDOWS_API specify which API to use
-
-#ifdef BOOST_WINDOWS_API
-# warning BOOST_WINDOWS_API defined
-#endif
-
-# if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
-# error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
-# elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
-# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(BOOST_NO_STD_WSTRING)
-# define BOOST_WINDOWS_API
-# else
-# define BOOST_POSIX_API
-# endif
-# endif
-
-# if defined( BOOST_WINDOWS_API ) && defined( BOOST_NO_STD_WSTRING )
-# error BOOST_WINDOWS_API can not be used when BOOST_NO_STD_WSTRING is defined
-# endif
-
-// BOOST_WINDOWS_PATH enables Windows path syntax recognition
-
-// filesystem.v2 defined BOOST_WINDOWS_PATH unconditionally for __CYGWIN__, but
-// that isn't possible for v3 because BOOST_WINDOWS_PATH requires wstring support
-
-# if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) \
- || (defined(__CYGWIN__) && !defined(BOOST_NO_STD_WSTRING)))
-# define BOOST_WINDOWS_PATH
-# endif
-
-// narrow support only for badly broken compilers or libraries -------------//
-
-# if defined(BOOST_NO_STD_WSTRING) || defined(BOOST_NO_SFINAE) || defined(BOOST_NO_STD_LOCALE) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
-# define BOOST_FILESYSTEM_NARROW_ONLY
-# endif
-
-// enable dynamic linking on Windows ---------------------------------------//
-
-# if (defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)) && defined(__BORLANDC__) && defined(__WIN32__)
-# error Dynamic linking Boost.Filesystem does not work for Borland; use static linking instead
-# endif
-
-#ifdef BOOST_HAS_DECLSPEC // defined in config system
-// we need to import/export our code only if the user has specifically
-// asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost
-// libraries to be dynamically linked, or BOOST_FILESYSTEM_DYN_LINK
-// if they want just this one to be dynamically liked:
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-// export if this is our own source, otherwise import:
-#ifdef BOOST_FILESYSTEM_SOURCE
-# define BOOST_FILESYSTEM_DECL __declspec(dllexport)
-#else
-# define BOOST_FILESYSTEM_DECL __declspec(dllimport)
-#endif // BOOST_FILESYSTEM_SOURCE
-#endif // DYN_LINK
-#endif // BOOST_HAS_DECLSPEC
-//
-// if BOOST_FILESYSTEM_DECL isn't defined yet define it now:
-#ifndef BOOST_FILESYSTEM_DECL
-#define BOOST_FILESYSTEM_DECL
-#endif
-
-// enable automatic library variant selection ------------------------------//
-
-#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
-//
-// Set the name of our library, this will get undef'ed by auto_link.hpp
-// once it's done with it:
-//
-#define BOOST_LIB_NAME boost_filesystem
-//
-// If we're importing code from a dll, then tell auto_link.hpp about it:
-//
-#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
-# define BOOST_DYN_LINK
-#endif
-//
-// And include the header that does the work:
-//
-#include <boost/config/auto_link.hpp>
-#endif // auto-linking disabled
-
-#endif // BOOST_FILESYSTEM_CONFIG_HPP
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/convenience.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/convenience.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,230 +0,0 @@
-// boost/filesystem/convenience.hpp ----------------------------------------//
-
-// Copyright Beman Dawes, 2002-2005
-// Copyright Vladimir Prus, 2002
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP
-#define BOOST_FILESYSTEM_CONVENIENCE_HPP
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/system/error_code.hpp>
-#include <vector>
-#include <stack>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost
-{
- namespace filesystem
- {
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-
- BOOST_FS_FUNC_STRING extension(const Path& ph)
- {
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = ph.filename();
-
- BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
- if (n != string_type::npos)
- return filename.substr(n);
- else
- return string_type();
- }
-
- BOOST_FS_FUNC_STRING basename(const Path& ph)
- {
- typedef BOOST_FS_TYPENAME Path::string_type string_type;
- string_type filename = ph.filename();
- BOOST_FS_TYPENAME string_type::size_type n = filename.rfind('.');
- return filename.substr(0, n);
- }
-
-
- BOOST_FS_FUNC(Path) change_extension( const Path & ph,
- const BOOST_FS_TYPENAME Path::string_type & new_extension )
- { return ph.parent_path() / (basename(ph) + new_extension); }
-
- inline std::string extension(const path& ph)
- { return extension<path>(ph); }
- inline std::wstring extension(const wpath& ph)
- { return extension<wpath>(ph); }
-
- inline std::string basename(const path& ph)
- { return basename<path>( ph ); }
- inline std::wstring basename(const wpath& ph)
- { return basename<wpath>( ph ); }
-
- inline path change_extension( const path & ph, const std::string& new_ex )
- { return change_extension<path>( ph, new_ex ); }
- inline wpath change_extension( const wpath & ph, const std::wstring& new_ex )
- { return change_extension<wpath>( ph, new_ex ); }
-# endif
-
-
- // basic_recursive_directory_iterator helpers --------------------------//
-
- namespace detail
- {
- struct recur_dir_itr_imp
- {
- typedef directory_iterator element_type;
- std::stack< element_type, std::vector< element_type > > m_stack;
- int m_level;
- bool m_no_push;
- bool m_no_throw;
-
- recur_dir_itr_imp() : m_level(0), m_no_push(false), m_no_throw(false) {}
- };
-
- } // namespace detail
-
- // recursive_directory_iterator ----------------------------------------//
-
- class recursive_directory_iterator
- : public boost::iterator_facade<
- recursive_directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >
- {
- public:
-
- recursive_directory_iterator(){} // creates the "end" iterator
-
- explicit recursive_directory_iterator( const path & dir_path )
- : m_imp( new detail::recur_dir_itr_imp )
- {
- m_imp->m_stack.push( directory_iterator( dir_path ) );
- if ( m_imp->m_stack.top () == directory_iterator() )
- { m_imp.reset (); }
- }
-
- recursive_directory_iterator( const path & dir_path,
- system::error_code & ec )
- : m_imp( new detail::recur_dir_itr_imp )
- {
- m_imp->m_no_throw = true;
- m_imp->m_stack.push( directory_iterator( dir_path, ec ) );
- if ( m_imp->m_stack.top () == directory_iterator() )
- { m_imp.reset (); }
- }
-
- int level() const { return m_imp->m_level; }
-
- void pop();
- void no_push()
- {
- BOOST_ASSERT( m_imp.get() && "no_push() on end recursive_directory_iterator" );
- m_imp->m_no_push = true;
- }
-
- file_status status() const
- {
- BOOST_ASSERT( m_imp.get()
- && "status() on end recursive_directory_iterator" );
- return m_imp->m_stack.top()->status();
- }
-
- file_status symlink_status() const
- {
- BOOST_ASSERT( m_imp.get()
- && "symlink_status() on end recursive_directory_iterator" );
- return m_imp->m_stack.top()->symlink_status();
- }
-
- private:
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::recur_dir_itr_imp > m_imp;
-
- friend class boost::iterator_core_access;
-
- boost::iterator_facade<
- recursive_directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >::reference
- dereference() const
- {
- BOOST_ASSERT( m_imp.get() && "dereference end recursive_directory_iterator" );
- return *m_imp->m_stack.top();
- }
-
- void increment();
-
- bool equal( const recursive_directory_iterator & rhs ) const
- { return m_imp == rhs.m_imp; }
-
- };
-
-# if !defined(BOOST_FILESYSTEM_NARROW_ONLY) && !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
- typedef recursive_directory_iterator wrecursive_directory_iterator;
-# endif
-
- // basic_recursive_directory_iterator implementation -------------------//
-
- // increment
- inline void recursive_directory_iterator::increment()
- {
- BOOST_ASSERT( m_imp.get() && "increment end recursive_directory_iterator" );
-
- static const directory_iterator end_itr;
-
- if ( m_imp->m_no_push )
- { m_imp->m_no_push = false; }
- else if ( is_directory( m_imp->m_stack.top()->status() ) )
- {
- system::error_code ec;
- m_imp->m_stack.push(
- m_imp->m_no_throw
- ? directory_iterator( *m_imp->m_stack.top(), ec )
- : directory_iterator( *m_imp->m_stack.top() ) );
- if ( m_imp->m_stack.top() != end_itr )
- {
- ++m_imp->m_level;
- return;
- }
- m_imp->m_stack.pop();
- }
-
- while ( !m_imp->m_stack.empty()
- && ++m_imp->m_stack.top() == end_itr )
- {
- m_imp->m_stack.pop();
- --m_imp->m_level;
- }
-
- if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
- }
-
- // pop
- inline void recursive_directory_iterator::pop()
- {
- BOOST_ASSERT( m_imp.get() && "pop end recursive_directory_iterator" );
- BOOST_ASSERT( m_imp->m_level > 0 && "pop recursive_directory_iterator with level < 1" );
-
- static const directory_iterator end_itr;
-
- do
- {
- m_imp->m_stack.pop();
- --m_imp->m_level;
- }
- while ( !m_imp->m_stack.empty()
- && ++m_imp->m_stack.top() == end_itr );
-
- if ( m_imp->m_stack.empty() ) m_imp.reset(); // done, so make end iterator
- }
-
- } // namespace filesystem
-} // namespace boost
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM_CONVENIENCE_HPP
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/exception.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/exception.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,9 +0,0 @@
-// boost/filesystem/exception.hpp -------------------------------------------//
-
-// Copyright Beman Dawes 2003
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This header is no long used. The contents have been moved to path.hpp.
-// It is provided so that user code #includes do not have to be changed.
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/fstream.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/fstream.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,584 +0,0 @@
-// boost/filesystem/fstream.hpp --------------------------------------------//
-
-// Copyright Beman Dawes 2002.
-// Use, modification, and distribution is subject to the Boost Software
-// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_FSTREAM_HPP
-#define BOOST_FILESYSTEM_FSTREAM_HPP
-
-#include <boost/filesystem/operations.hpp> // for 8.3 hack (see below)
-#include <boost/utility/enable_if.hpp>
-#include <boost/detail/workaround.hpp>
-
-#include <iosfwd>
-#include <fstream>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-// NOTE: fstream.hpp for Boost 1.32.0 and earlier supplied workarounds for
-// various compiler problems. They have been removed to ease development of the
-// basic i18n functionality. Once the new interface is stable, the workarounds
-// will be reinstated for any compilers that otherwise can support the rest of
-// the library after internationalization.
-
-namespace boost
-{
- namespace filesystem
- {
- namespace detail
- {
-# if defined(BOOST_WINDOWS_API) && !defined(BOOST_FILESYSTEM_NARROW_ONLY)
-# if !defined(BOOST_DINKUMWARE_STDLIB) || BOOST_DINKUMWARE_STDLIB < 405
- // The 8.3 hack:
- // C++98 does not supply a wchar_t open, so try to get an equivalent
- // narrow char name based on the short, so-called 8.3, name.
- // Not needed for Dinkumware 405 and later as they do supply wchar_t open.
- BOOST_FILESYSTEM_DECL bool create_file_api( const std::wstring & ph,
- std::ios_base::openmode mode ); // true if succeeds
- BOOST_FILESYSTEM_DECL std::string narrow_path_api(
- const std::wstring & ph ); // return is empty if fails
-
- inline std::string path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode mode )
- // Return a non-existant path if cannot supply narrow short path.
- // An empty path doesn't work because some Dinkumware versions
- // assert the path is non-empty.
- {
- std::string narrow_ph;
- bool created_file( false );
- if ( !exists( file_ph )
- && (mode & std::ios_base::out) != 0
- && create_file_api( file_ph, mode ) )
- {
- created_file = true;
- }
- narrow_ph = narrow_path_api( file_ph );
- if ( narrow_ph.empty() )
- {
- if ( created_file ) remove_api( file_ph );
- narrow_ph = "\x01";
- }
- return narrow_ph;
- }
-# else
- // Dinkumware 405 and later does supply wchar_t functions
- inline const std::wstring & path_proxy( const std::wstring & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-# endif
-# endif
-
- inline const std::string & path_proxy( const std::string & file_ph,
- std::ios_base::openmode )
- { return file_ph; }
-
- } // namespace detail
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_filebuf : public std::basic_filebuf<charT,traits>
- {
- private: // disallow copying
- basic_filebuf( const basic_filebuf & );
- const basic_filebuf & operator=( const basic_filebuf & );
- public:
- basic_filebuf() {}
- virtual ~basic_filebuf() {}
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
- basic_filebuf<charT,traits> *
- open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- basic_filebuf<charT,traits> *
- open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ifstream : public std::basic_ifstream<charT,traits>
- {
- private: // disallow copying
- basic_ifstream( const basic_ifstream & );
- const basic_ifstream & operator=( const basic_ifstream & );
- public:
- basic_ifstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- template<class Path>
- explicit basic_ifstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- basic_ifstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
-
- explicit basic_ifstream( const wpath & file_ph );
- basic_ifstream( const wpath & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-# endif
-
- explicit basic_ifstream( const path & file_ph );
- basic_ifstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_ifstream() {}
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_ofstream : public std::basic_ofstream<charT,traits>
- {
- private: // disallow copying
- basic_ofstream( const basic_ofstream & );
- const basic_ofstream & operator=( const basic_ofstream & );
- public:
- basic_ofstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
- template<class Path>
- explicit basic_ofstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_ofstream( const wpath & file_ph );
-
- template<class Path>
- basic_ofstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_ofstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_ofstream( const path & file_ph );
- basic_ofstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_ofstream() {}
- };
-
- template < class charT, class traits = std::char_traits<charT> >
- class basic_fstream : public std::basic_fstream<charT,traits>
- {
- private: // disallow copying
- basic_fstream( const basic_fstream & );
- const basic_fstream & operator=( const basic_fstream & );
- public:
- basic_fstream() {}
-
- // use two signatures, rather than one signature with default second
- // argument, to workaround VC++ 7.1 bug (ID VSWhidbey 38416)
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
- template<class Path>
- explicit basic_fstream( const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- explicit basic_fstream( const wpath & file_ph );
-
- template<class Path>
- basic_fstream( const Path & file_ph, std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* dummy = 0 );
- basic_fstream( const wpath & file_ph, std::ios_base::openmode mode );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph );
- void open( const wpath & file_ph );
-
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- open( const Path & file_ph, std::ios_base::openmode mode );
- void open( const wpath & file_ph, std::ios_base::openmode mode );
-
-# endif
-
- explicit basic_fstream( const path & file_ph );
- basic_fstream( const path & file_ph, std::ios_base::openmode mode );
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- void open( const path & file_ph );
- void open( const path & file_ph, std::ios_base::openmode mode );
-# endif
- virtual ~basic_fstream() {}
-
- };
-
- typedef basic_filebuf<char> filebuf;
- typedef basic_ifstream<char> ifstream;
- typedef basic_ofstream<char> ofstream;
- typedef basic_fstream<char> fstream;
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- typedef basic_filebuf<wchar_t> wfilebuf;
- typedef basic_ifstream<wchar_t> wifstream;
- typedef basic_fstream<wchar_t> wfstream;
- typedef basic_ofstream<wchar_t> wofstream;
-# endif
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
-// basic_filebuf definitions -----------------------------------------------//
-
- template <class charT, class traits>
- template<class Path>
- typename boost::enable_if<is_basic_path<Path>,
- basic_filebuf<charT,traits> *>::type
- basic_filebuf<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- return (std::basic_filebuf<charT,traits>::open( detail::path_proxy(
- file_ph.external_file_string(), mode ).c_str(), mode )
- == 0) ? 0 : this;
- }
-
- template <class charT, class traits>
- basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- return this->BOOST_NESTED_TEMPLATE open<wpath>( file_ph, mode );
- }
-
-// basic_ifstream definitions ----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ifstream<charT,traits>::basic_ifstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in ).c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ifstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in );
- }
-
-// basic_ofstream definitions ----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_ofstream<charT,traits>::basic_ofstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::out ).c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_ofstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::out );
- }
-
-// basic_fstream definitions -----------------------------------------------//
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream(const Path & file_ph,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- basic_fstream<charT,traits>::basic_fstream( const Path & file_ph,
- std::ios_base::openmode mode,
- typename boost::enable_if<is_basic_path<Path> >::type* )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const wpath & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out ) {}
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- std::ios_base::in|std::ios_base::out ).c_str(),
- std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits> template<class Path>
- typename boost::enable_if<is_basic_path<Path>, void>::type
- basic_fstream<charT,traits>::open( const Path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const wpath & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- detail::path_proxy( file_ph.external_file_string(),
- mode ).c_str(), mode | std::ios_base::in | std::ios_base::out );
- }
-
-# endif
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- basic_filebuf<charT,traits> *
- basic_filebuf<charT, traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- return std::basic_filebuf<charT,traits>::open(
- file_ph.file_string().c_str(), mode ) == 0 ? 0 : this;
- }
-# endif
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::in ) {}
-
- template <class charT, class traits>
- basic_ifstream<charT,traits>::basic_ifstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ifstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in );
- }
-
- template <class charT, class traits>
- void basic_ifstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ifstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), std::ios_base::out ) {}
-
- template <class charT, class traits>
- basic_ofstream<charT,traits>::basic_ofstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_ofstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_ofstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_ofstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(),
- std::ios_base::in|std::ios_base::out ) {}
-
-
- template <class charT, class traits>
- basic_fstream<charT,traits>::basic_fstream( const path & file_ph,
- std::ios_base::openmode mode )
- : std::basic_fstream<charT,traits>(
- file_ph.file_string().c_str(), mode ) {}
-
-# if !BOOST_WORKAROUND( BOOST_MSVC, <= 1200 ) // VC++ 6.0 can't handle this
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), std::ios_base::in|std::ios_base::out );
- }
-
- template <class charT, class traits>
- void basic_fstream<charT,traits>::open( const path & file_ph,
- std::ios_base::openmode mode )
- {
- std::basic_fstream<charT,traits>::open(
- file_ph.file_string().c_str(), mode );
- }
-# endif
- } // namespace filesystem
-} // namespace boost
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM_FSTREAM_HPP
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/operations.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/operations.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,671 +0,0 @@
-// boost/filesystem/operations.hpp -----------------------------------------//
-
-// Copyright Beman Dawes 2002-2008
-// Copyright Jan Langer 2002
-// Copyright Dietmar Kuehl 2001
-// Copyright Vladimir Prus 2002
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-//----------------------------------------------------------------------------//
-/*
-* TODO List
-*
-* Scoped enum workaround for file_type.
-* Enable all BOOST_FILESYSTEM_NO_DEPRECATED code.
-* Vista symlink_status support.
-* Merge fixes from trunk
-* rename and remove really need to be renamed. If users says "using namespace boost::filesystem"
- and some header included stdio, there is just too much chance of silent error.
-* create_directories error handling.
-* Review any commented out code, both in operations.hpp and operations.cpp
-* Finish refactoring operations_test.
-* Fold convenience.hpp into operations.hpp
-* Two argument recursive_directory_iterator ctor isn't recognizing system::throws.
- would it be better to fold into a single two argument ctor with default?
-* Add the push_directory class from tools/release/required_files.cpp
-
-*/
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_OPERATIONS_HPP
-#define BOOST_FILESYSTEM_OPERATIONS_HPP
-
-#include <boost/filesystem/path.hpp>
-
-#include <boost/system/error_code.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/iterator.hpp>
-#include <boost/cstdint.hpp>
-#include <boost/assert.hpp>
-
-#include <string>
-#include <utility> // for pair
-#include <ctime>
-
-#ifdef BOOST_WINDOWS_API
-# include <fstream>
-# if !defined(_WIN32_WINNT)
-# define _WIN32_WINNT 0x0500 // assume Windows 2000 or later SDK
-# endif
-#endif
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-# ifdef BOOST_NO_STDC_NAMESPACE
- namespace std { using ::time_t; }
-# endif
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
- namespace filesystem
- {
-
-//----------------------------------------------------------------------------//
-// //
-// support classes and enums //
-// //
-//----------------------------------------------------------------------------//
-
- enum file_type
- {
- status_unknown,
- file_not_found,
- regular_file,
- directory_file,
- // the following will never be reported by some operating or file systems
- symlink_file,
- block_file,
- character_file,
- fifo_file,
- socket_file,
- type_unknown // file does exist, but isn't one of the above types or
- // we don't have strong enough permission to find its type
- };
-
- class BOOST_FILESYSTEM_DECL file_status
- {
- public:
- explicit file_status( file_type v = status_unknown ) : m_value(v) {}
-
- void type( file_type v ) { m_value = v; }
- file_type type() const { return m_value; }
-
- bool operator==( const file_status & rhs ) const { return type() == rhs.type(); }
- bool operator!=( const file_status & rhs ) const { return !(*this == rhs); }
-
- private:
- // the internal representation is unspecified so that additional state
- // information such as permissions can be added in the future; this
- // implementation just uses status_type as the internal representation
-
- file_type m_value;
- };
-
- inline bool status_known( file_status f ) { return f.type() != status_unknown; }
- inline bool exists( file_status f ) { return f.type() != status_unknown && f.type() != file_not_found; }
- inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
- inline bool is_directory( file_status f ) { return f.type() == directory_file; }
- inline bool is_symlink( file_status f ) { return f.type() == symlink_file; }
- inline bool is_other( file_status f ) { return exists(f) && !is_regular_file(f) && !is_directory(f) && !is_symlink(f); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool is_regular( file_status f ) { return f.type() == regular_file; }
-# endif
-
- struct space_info
- {
- // all values are byte counts
- boost::uintmax_t capacity;
- boost::uintmax_t free; // <= capacity
- boost::uintmax_t available; // <= free
- };
-
-//----------------------------------------------------------------------------//
-// //
-// query functions //
-// //
-//----------------------------------------------------------------------------//
-
- BOOST_FILESYSTEM_DECL
- file_status status( const path & p,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- file_status symlink_status( const path & p,
- system::error_code & ec = system::throws );
-
- inline bool exists( const path & p, system::error_code & ec = system::throws ) { return exists( status( p, ec ) ); }
- inline bool is_directory( const path & p, system::error_code & ec = system::throws ) { return is_directory( status( p, ec ) ); }
- inline bool is_regular_file( const path & p, system::error_code & ec = system::throws ) { return is_regular_file( status( p, ec ) ); }
- inline bool is_other( const path & p, system::error_code & ec = system::throws ) { return is_other( status( p, ec ) ); }
- inline bool is_symlink( const path & p, system::error_code & ec = system::throws ) { return is_symlink( symlink_status( p, ec ) ); }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- inline bool is_regular( const path & p, system::error_code & ec = system::throws ) { return is_regular( status( p, ec ) ); }
-# endif
-
-
-// // VC++ 7.0 and earlier has a serious namespace bug that causes a clash
-// // between boost::filesystem::is_empty and the unrelated type trait
-// // boost::is_empty.
-//
-//# if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300
-// BOOST_FS_FUNC(bool) is_empty( const Path & ph )
-//# else
-// BOOST_FS_FUNC(bool) _is_empty( const Path & ph )
-//# endif
-// {
-// detail::query_pair result(
-// detail::is_empty_api( ph.external_file_string() ) );
-// if ( result.first )
-// boost::throw_exception( basic_filesystem_error<Path>(
-// "boost::filesystem::is_empty", ph, result.first ) );
-// return result.second;
-// }
-
- BOOST_FILESYSTEM_DECL
- bool is_empty( const path & p, system::error_code & ec = system::throws );
-
-//----------------------------------------------------------------------------//
-// //
-// operational functions //
-// in alphabetical order, unless otherwise noted //
-// //
-//----------------------------------------------------------------------------//
-
- BOOST_FILESYSTEM_DECL // declaration must precede complete()
- path initial_path( system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- path complete( const path & p, const path & base = initial_path() );
-
- BOOST_FILESYSTEM_DECL
- void copy_file( const path & from, const path & to,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- bool create_directories( const path & p/*,
- system::error_code & ec = system::throws*/ );
-
- BOOST_FILESYSTEM_DECL
- bool create_directory( const path & p, system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void create_directory_symlink( const path & to, const path & from,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void create_hard_link( const path & to, const path & from,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void create_symlink( const path & to, const path & from,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- path current_path( system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void current_path( const path & p, system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- bool equivalent( const path & p1, const path & p2,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- boost::uintmax_t file_size( const path & p,
- system::error_code & ec = system::throws );
-
- // initial_path() declaration precedes complete()
-
- BOOST_FILESYSTEM_DECL
- std::time_t last_write_time( const path & p,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void last_write_time( const path & p, const std::time_t new_time,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- bool remove( const path & p, system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- boost::uintmax_t remove_all( const path & p,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- void rename( const path & from, const path & to,
- system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- space_info space( const path & p, system::error_code & ec = system::throws );
-
- BOOST_FILESYSTEM_DECL
- path system_complete( const path & p, system::error_code & ec = system::throws );
-
-//----------------------------------------------------------------------------//
-// //
-// directory_entry //
-// //
-//----------------------------------------------------------------------------//
-
-// GCC has a problem with a member function named path within a namespace or
-// sub-namespace that also has a class named path. The workaround is to always
-// fully qualify the name path when it refers to the class name.
-
-class BOOST_FILESYSTEM_DECL directory_entry
-{
-public:
-
- // compiler generated copy-ctor, copy assignment, and destructor apply
-
- directory_entry() {}
- explicit directory_entry( const boost::filesystem::path & p,
- file_status st = file_status(), file_status symlink_st=file_status() )
- : m_path(p), m_status(st), m_symlink_status(symlink_st)
- {}
-
- void assign( const boost::filesystem::path & p,
- file_status st, file_status symlink_st )
- { m_path = p; m_status = st; m_symlink_status = symlink_st; }
-
- void replace_filename( const boost::filesystem::path & p,
- file_status st, file_status symlink_st )
- {
- m_path.remove_filename();
- m_path /= p;
- m_status = st;
- m_symlink_status = symlink_st;
- }
-
-# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
- void replace_leaf( const boost::filesystem::path & p,
- file_status st, file_status symlink_st )
- { replace_filename( p, st, symlink_st ); }
-# endif
-
- const boost::filesystem::path & path() const { return m_path; }
- file_status status( system::error_code & ec = system::throws ) const;
- file_status symlink_status( system::error_code & ec = system::throws ) const;
-
- // conversion simplifies the most common use of directory_entry
- operator const boost::filesystem::path &() const { return m_path; }
-
-//# ifndef BOOST_FILESYSTEM_NO_DEPRECATED
-// // deprecated functions preserve common use cases in legacy code
-// typename Path::string_type filename() const
-// {
-// return path().filename();
-// }
-// typename Path::string_type leaf() const
-// {
-// return path().filename();
-// }
-// typename Path::string_type string() const
-// {
-// return path().string();
-// }
-//# endif
-
-private:
- boost::filesystem::path m_path;
- mutable file_status m_status; // stat()-like
- mutable file_status m_symlink_status; // lstat()-like
-
-}; // directory_entry
-
-//----------------------------------------------------------------------------//
-// //
-// directory_iterator helpers //
-// //
-//----------------------------------------------------------------------------//
-
-class directory_iterator;
-
-namespace detail
-{
- BOOST_FILESYSTEM_DECL
- system::error_code dir_itr_close( // never throws
- void *& handle
-# if defined(BOOST_POSIX_API)
- , void *& buffer
-# endif
- );
-
- struct BOOST_FILESYSTEM_DECL dir_itr_imp
- {
- directory_entry dir_entry;
- void * handle;
-
-# ifdef BOOST_POSIX_API
- void * buffer; // see dir_itr_increment implementation
-# endif
-
- dir_itr_imp() : handle(0)
-# ifdef BOOST_POSIX_API
- , buffer(0)
-# endif
- {}
-
- ~dir_itr_imp() // never throws
- {
- dir_itr_close( handle
-# if defined(BOOST_POSIX_API)
- , buffer
-# endif
- );
- }
- };
-
- // see path::iterator: comment below
- BOOST_FILESYSTEM_DECL void directory_iterator_construct( directory_iterator & it,
- const path & p, system::error_code & ec );
- BOOST_FILESYSTEM_DECL void directory_iterator_increment( directory_iterator & it );
-
-} // namespace detail
-
-//----------------------------------------------------------------------------//
-// //
-// directory_iterator //
-// //
-//----------------------------------------------------------------------------//
-
- class directory_iterator
- : public boost::iterator_facade<
- directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >
- {
- public:
-
- directory_iterator(){} // creates the "end" iterator
-
- // iterator_facade derived classes don't seem to like implementations in
- // separate translation unit dll's, so forward to detail functions
- directory_iterator( const path & p,
- system::error_code & ec = system::throws )
- : m_imp( new detail::dir_itr_imp )
- { detail::directory_iterator_construct( *this, p, ec ); }
-
- ~directory_iterator() {} // never throws
-
- private:
- friend struct detail::dir_itr_imp;
- friend void detail::directory_iterator_construct( directory_iterator & it,
- const path & p, system::error_code & ec);
- friend void detail::directory_iterator_increment( directory_iterator & it );
-
- // shared_ptr provides shallow-copy semantics required for InputIterators.
- // m_imp.get()==0 indicates the end iterator.
- boost::shared_ptr< detail::dir_itr_imp > m_imp;
-
- friend class boost::iterator_core_access;
-
- boost::iterator_facade<
- directory_iterator,
- directory_entry,
- boost::single_pass_traversal_tag >::reference dereference() const
- {
- BOOST_ASSERT( m_imp.get() && "attempt to dereference end iterator" );
- return m_imp->dir_entry;
- }
-
- void increment() { detail::directory_iterator_increment( *this ); }
-
- bool equal( const directory_iterator & rhs ) const
- { return m_imp == rhs.m_imp; }
- };
-
-//----------------------------------------------------------------------------//
-// //
-// class filesystem_error //
-// //
-//----------------------------------------------------------------------------//
-
- class filesystem_error : public system::system_error
- {
- // see http://www.boost.org/more/error_handling.html for design rationale
-
- // all functions are inline to avoid issues with crossing dll boundaries
-
- public:
- // compiler generates copy constructor and copy assignment
-
- // constructors without path arguments
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- // constructors with one path argument
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, const path & path1_arg,
- system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, const path & path1_arg,
- system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, const path & path1_arg,
- int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, const path & path1_arg,
- int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- // constructors with two path arguments
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, const path & path1_arg,
- const path & path2_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, const path & path1_arg,
- const path & path2_arg, system::error_code ec )
- : system::system_error(ec, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const std::string & what_arg, const path & path1_arg,
- const path & path2_arg, int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- filesystem_error::filesystem_error(
- const char * what_arg, const path & path1_arg,
- const path & path2_arg, int ev, const system::error_category & ecat )
- : system::system_error(ev, ecat, what_arg)
- {
- try
- {
- m_imp_ptr.reset( new m_imp );
- m_imp_ptr->m_path1 = path1_arg;
- m_imp_ptr->m_path2 = path2_arg;
- }
- catch (...) { m_imp_ptr.reset(); }
- }
-
- ~filesystem_error() throw() {}
-
- const path & path1() const
- {
- static const path empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path1 : empty_path ;
- }
- const path & path2() const
- {
- static const path empty_path;
- return m_imp_ptr.get() ? m_imp_ptr->m_path2 : empty_path ;
- }
-
- const char * filesystem_error::what() const throw()
- {
- if ( !m_imp_ptr.get() )
- return system::system_error::what();
-
- try
- {
- if ( m_imp_ptr->m_what.empty() )
- {
- m_imp_ptr->m_what = system::system_error::what();
- if ( !m_imp_ptr->m_path1.empty() )
- {
- m_imp_ptr->m_what += ": \"";
- m_imp_ptr->m_what += m_imp_ptr->m_path1.string();
- m_imp_ptr->m_what += "\"";
- }
- if ( !m_imp_ptr->m_path2.empty() )
- {
- m_imp_ptr->m_what += ", \"";
- m_imp_ptr->m_what += m_imp_ptr->m_path2.string();
- m_imp_ptr->m_what += "\"";
- }
- }
- return m_imp_ptr->m_what.c_str();
- }
- catch (...)
- {
- return system::system_error::what();
- }
- }
-
- private:
- struct m_imp
- {
- path m_path1; // may be empty()
- path m_path2; // may be empty()
- std::string m_what; // not built until needed
- };
- boost::shared_ptr<m_imp> m_imp_ptr;
- };
-
-// test helper -------------------------------------------------------------//
-
-// Not part of the documented interface since false positives are possible;
-// there is no law that says that an OS that has large stat.st_size
-// actually supports large file sizes.
-
- namespace detail
- {
- BOOST_FILESYSTEM_DECL bool possible_large_file_size_support();
- }
-
- } // namespace filesystem
-} // namespace boost
-
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_FILESYSTEM_OPERATIONS_HPP
Deleted: sandbox/filesystem-v3/boost/filesystem/v3/path.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/v3/path.hpp 2008-12-24 09:39:02 EST (Wed, 24 Dec 2008)
+++ (empty file)
@@ -1,858 +0,0 @@
-// filesystem path.hpp -----------------------------------------------------//
-
-// Copyright Beman Dawes 2002-2005, 2008
-// Copyright Vladimir Prus 2002
-
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-// See library home page at http://www.boost.org/libs/filesystem
-
-// basic_path's stem(), extension(), and replace_extension() are based on
-// basename(), extension(), and change_extension() from the original
-// filesystem/convenience.hpp header by Vladimir Prus.
-
-//----------------------------------------------------------------------------//
-/*
- TO DO
-
- * Windows, POSIX, conversions for char16_t, char32_t for supporting compilers.
- * Add Alternate Data Stream test cases. See http://en.wikipedia.org/wiki/NTFS Features.
- * test case: relational on paths differing only in trailing separator. rationale?
- * Behavior of root_path() has been changed. Change needs to be propagated to trunk.
- reference.html#Path-decomposition-table needs rows for //, //netname, //netname/foo
- Make sure current trunk has passing tests for those cases, all decompositions.
- See test_decompositions() in path_unit_test.cpp
- * Get the deprecated names working.
- * path_test ~line 1200 replace_extension() tests commented out
- * Document leading //: no longer treated specially.
- * reference.html: operator /= is underspecified as to when a "/" is appended, and
- whether a '/' or '\' is appended.
- * path_unit_test needs to probe error handling, verify exceptions are thrown when
- requested.
- * Provide the name check functions for more character types. Templatize?
-
- Design Questions
-
- * Should path_locale use thread local storage?
- * Will locale overloads be needed in practice?
- * Is it OK for single-element decomposition functions to return paths? Yes;
- keep the interface simple and usable in generic code at the expense of some
- notational convenience.
- * Are generic versions of string(), native_string() needed? IE:
- template< class T >
- T string( const error_code ec = throws );
- TODO: Yes; all member functions need to be usable in generic code.
- Can string() and native_string() make use of detail::convert()?
- * Assuming generic versions of string(), native_string(), are the w flavors needed?
- No. KISS. basic_string<char> is special because it is the predominent
- use case. w (and other) flavors can be added later.
- * Should UDT's be supported? Yes. Easy to do and pretty harmless.
- * What to do about Cygwin and other environments that don't support wchar_t?
- * Should path iteration to a separator result in:
- -- the actual separator used
- -- the preferred separator
- -- the generic separator <-- makes it easier to write portable code
- * Should the preferred native separator be available?
- */
-//----------------------------------------------------------------------------//
-
-#ifndef BOOST_FILESYSTEM_PATH_HPP
-#define BOOST_FILESYSTEM_PATH_HPP
-
-#include <boost/filesystem/config.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/static_assert.hpp>
-#include <string>
-#include <cstring>
-#include <iosfwd> // needed by basic_path inserter and extractor
-#include <stdexcept>
-#include <cassert>
-#include <locale>
-#include <algorithm>
-
-# ifdef BOOST_WINDOWS_API
-# else // BOOST_POSIX_API
-# endif
-
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-//----------------------------------------------------------------------------//
-
-namespace boost
-{
-namespace filesystem
-{
- // exception classes -----------------------------------------------------//
-
- // filesystem_error is not used because errors are sometimes thrown during
- // path construction when there isn't a complete path to include.
- // system_error is not used because most uses will be conversion errors, and
- // thus it is useful to include the source string causing the error. Since
- // processing source string errors is by its nature type dependent, the
- // exception class is templated on the string type.
-
- // path_error can be caught when further type distinctions aren't needed.
- class path_error : public std::runtime_error
- {
- public:
- path_error( const char * what_, boost::system::error_code ec_ )
- : std::runtime_error( what_ ), m_ec( ec_ ) {}
-
- boost::system::error_code error_code() const throw() { return m_ec; }
-
- private:
- boost::system::error_code m_ec;
- };
-
- template < class String >
- class basic_path_error : public path_error
- {
- public:
- basic_path_error( const char * what_, boost::system::error_code ec_,
- const String & source_ )
- : path_error( what_, ec_ ), m_source( source_ ) {}
-
- const String & source() const { return m_source; }
-
- private:
- String m_source;
- };
-
- //--------------------------------------------------------------------------//
- // //
- // implementation details //
- // //
- //--------------------------------------------------------------------------//
-
- namespace detail
- {
-
- BOOST_FILESYSTEM_DECL extern const std::locale * path_locale;
-
-# ifdef BOOST_WINDOWS_PATH
-
- const wchar_t separator = L'/';
- const wchar_t preferred_separator = L'\\';
- const wchar_t * const separators = L"/\\";
- const wchar_t colon = L':';
- const wchar_t dot = L'.';
-
-# else // BOOST_POSIX_PATH
-
- const char separator = '/';
- const char preferred_separator = '/';
- const char * const separators = "/";
- const char colon = ':';
- const char dot = '.';
-
-# endif
-
-# ifdef BOOST_WINDOWS_API
-
- typedef std::wstring string_type;
- typedef string_type::value_type value_type;
- typedef string_type::size_type size_type;
-
- // class path has a number of generic functions that are implemented by
- // detail::convert_append() or detail::convert(). detail::convert_append()
- // functions called indirectly via detail::convert_append_helper() functions
- // to reduce the number of overloads required. Overloads are supplied
- // for all supported character array types to string_type.
-
- // ----- char[] to wstring -----
-
- BOOST_FILESYSTEM_DECL
- void convert_append( const char * begin,
- const char * end, // 0 for null terminated MBCS
- std::wstring & target,
- system::error_code & ec );
-
- inline void convert_append( const char * begin, std::wstring & target,
- system::error_code & ec )
- {
- convert_append( begin, 0, target, ec );
- }
-
- // ----- wchar_t[] to wstring -----
-
- inline void convert_append( const wchar_t * begin, const wchar_t * end,
- std::wstring & target, system::error_code & ec )
- {
- ec.clear();
- target.assign( begin, end ); // but what if throws bad_alloc?
- }
-
- inline void convert_append( const wchar_t * begin, std::wstring & target,
- system::error_code & ec )
- {
- ec.clear();
- target += begin; // but what if throws bad_alloc?
- }
-
- // ----- convert ----
-
- BOOST_FILESYSTEM_DECL
- std::string convert( const std::wstring & src, system::error_code & ec );
-
-# else // BOOST_POSIX_API
-
- typedef std::string string_type;
- typedef string_type::value_type value_type;
- typedef string_type::size_type size_type;
-
- // See comment at equivalent location in Windows API detail above
-
- // ----- char[] to string -----
-
- inline void convert_append( const char * begin,
- const char * end, // 0 for null terminated MBCS
- std::string & target,
- system::error_code & ec )
- {
- ec.clear();
- target.assign( begin, end ); // but what if this throws bad_alloc?
- }
-
- inline void convert_append( const char * begin, std::string & target,
- system::error_code & ec )
- {
- ec.clear();
- target += begin; // but what if throws bad_alloc?
- }
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
-
- // ----- wchar_t[] to string -----
-
- inline void convert_append( const wchar_t * begin, const wchar_t * end,
- std::string & target, system::error_code & ec );
-
- inline void convert_append( const wchar_t * begin, std::string & target,
- system::error_code & ec )
- {
- convert_append( begin, 0, target, ec );
- }
-
- // ----- convert ----
-
- BOOST_FILESYSTEM_DECL
- std::wstring convert( const std::string & src, system::error_code & ec );
-
-# endif
-
-# endif // BOOST_POSIX_API
-
- // helpers ---------------------------------------------------------------//
-
- inline bool is_separator( value_type c )
- {
- return c == separator
-# ifdef BOOST_WINDOWS_PATH
- || c == L'\\'
-# endif
- ;
- }
-
- // These helpers factor out common code, convert iterators to pointers,
- // and add the locale. Thus they reduce the number of detail::convert_append
- // overloads required.
-
- template< class InputIterator >
- inline void convert_append_helper( InputIterator begin,
- string_type & target, system::error_code & ec )
- {
- BOOST_ASSERT( &*begin );
- convert_append( &*begin, target, ec );
- }
-
- template< class FowardIterator >
- inline void convert_append_helper( FowardIterator begin, FowardIterator end,
- string_type & target, system::error_code & ec )
- {
- if ( begin == end ) return;
- BOOST_ASSERT( &*begin );
- convert_append( &*begin,
- &*begin + std::distance( begin, end ), // avoid dereference of end iterator
- target, ec );
- }
-
- BOOST_FILESYSTEM_DECL
- void first_element(
- const string_type & src,
- size_type & element_pos,
- size_type & element_size,
- # if !BOOST_WORKAROUND( BOOST_MSVC, <= 1310 ) // VC++ 7.1
- size_type size = string_type::npos
- # else
- size_type size = -1
- # endif
- );
-
- BOOST_FILESYSTEM_DECL
- bool is_non_root_separator( const string_type & str, size_type pos );
- // pos is position of the separator
-
- BOOST_FILESYSTEM_DECL
- size_type filename_pos( const string_type & str,
- size_type end_pos ); // end_pos is past-the-end position
- // Returns: 0 if str itself is filename (or empty)
-
- BOOST_FILESYSTEM_DECL
- size_type root_directory_start( const string_type & path, size_type size );
- // Returns: npos if no root_directory found
-
-} // namespace detail
-
- //--------------------------------------------------------------------------//
- // //
- // traits and conversions //
- // //
- // users are permitted to add specializations for user defined types // //
- // //
- //--------------------------------------------------------------------------//
-
- template< class T > struct pathable_iterator { static const bool value = false; };
- template<> struct pathable_iterator<const char *> { static const bool value = true; };
- template<> struct pathable_iterator<char *> { static const bool value = true; };
- template<> struct pathable_iterator<std::string::iterator> { static const bool value = true; };
- template<> struct pathable_iterator<std::string::const_iterator> { static const bool value = true; };
-
- template< class T > struct pathable_container { static const bool value = false; };
- template<> struct pathable_container<std::string> { static const bool value = true; };
-
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- template<> struct pathable_iterator<const wchar_t *> { static const bool value = true; };
- template<> struct pathable_iterator<wchar_t *> { static const bool value = true; };
- template<> struct pathable_iterator<std::wstring::iterator> { static const bool value = true; };
- template<> struct pathable_iterator<std::wstring::const_iterator> { static const bool value = true; };
-
- template<> struct pathable_container<std::wstring> { static const bool value = true; };
-# endif
-
- template< class T >
- T convert( const detail::string_type & src, system::error_code & ec );
-
-# ifdef BOOST_WINDOWS_API
- template<> inline std::string convert<std::string>( const std::wstring & s, system::error_code & ec )
- { return detail::convert( s, ec ); }
- template<> inline std::wstring convert<std::wstring>( const std::wstring & s, system::error_code & ec )
- { return s; }
-# endif
-
- //--------------------------------------------------------------------------//
- // //
- // class path //
- // //
- //--------------------------------------------------------------------------//
-
- class BOOST_FILESYSTEM_DECL path
- {
- public:
-
- // string_type is the std::basic_string type corresponding to the character
- // type for paths used by the native operating system API.
- //
- // Thus string_type is std::string for POSIX and std::wstring for Windows.
- // value_type is char for POSIX and wchar_t for Windows.
-
- typedef detail::string_type string_type;
- typedef string_type::value_type value_type;
- typedef string_type::size_type size_type;
-
- // ----- character encoding conversions -----
-
- // Following the principle of least astonishment, path input arguments
- // passed to or obtained from the operating system via objects of
- // class path behave as if they were directly passed to or
- // obtained from the O/S API, unless conversion is explicitly requested.
- //
- // POSIX specfies that path strings are passed unchanged to and from the
- // API. Note that this is different from the POSIX command line utilities,
- // which convert according to a locale.
- //
- // Thus for POSIX, char strings do not undergo conversion. wchar_t strings
- // are converted to/from char using the path locale or, if a conversion
- // argument is given, using a conversion object modeled on
- // std::wstring_convert.
- //
- // The path locale, which is global to the thread, can be changed by the
- // imbue() function. It is initialized to an implementation defined locale.
- //
- // For Windows, wchar_t strings do not undergo conversion. char strings
- // are converted using the "ANSI" or "OEM" code pages, as determined by
- // the AreFileApisANSI() function, or, if a conversion argument is given,
- // using a conversion object modeled on std::wstring_convert.
- //
- // See m_path comments for further important rationale.
-
- // Design alternative; each function can have an additional overload that
- // supplies a conversion locale. For example:
- //
- // template< class ForwardIterator, class WStringConvert >
- // path( ForwardIterator begin, ForwardIterator end,
- // const std::locale & loc,
- // system::error_code & ec = system::throws );
- //
- // This alternative was rejected as too complex for the limited benefits;
- // it nearly doubles the size of the interface, and adds a lot of
- // implementation and test code, yet would likely be rarely used. The same
- // effect can be achieved via the much simpler imbue() mechanism.
-
-
- // TODO: rules needed for operating systems that use / or .
- // differently, or format directory paths differently from file paths.
- //
- // ************************************************************************
- //
- // More work needed: How to handle an operating system that may have
- // slash characters or dot characters in valid filenames, either because
- // it doesn't follow the POSIX standard, or because it allows MBCS
- // filename encodings that may contain slash or dot characters. For
- // example, ISO/IEC 2022 (JIS) encoding which allows switching to
- // JIS x0208-1983 encoding. A valid filename in this set of encodings is
- // 0x1B 0x24 0x42 [switch to X0208-1983] 0x24 0x2F [U+304F Kiragana letter KU]
- // ^^^^
- // Note that 0x2F is the ASCII slash character
- //
- // ************************************************************************
-
- // ----- constructors -----
-
- path(){} // #1
-
- path( const path & p ) : m_path(p.m_path) {} // #2
-
- // construct from null terminated sequence
-
- template< class InputIterator >
- path( InputIterator begin,
- system::error_code & ec = system::throws,
- typename boost::enable_if<pathable_iterator<InputIterator> >::type* dummy=0 ) // #3
- { detail::convert_append_helper( begin, m_path, ec ); }
-
- // construct from (potentially) multi-byte character string, which may have
- // embedded nulls. Embedded null support is required for some Asian languages on
- // Windows.
-
- template< class ForwardIterator >
- path( ForwardIterator begin, ForwardIterator end,
- system::error_code & ec = system::throws ) // #4
- { detail::convert_append_helper( begin, end, m_path, ec ); }
-
- // construct from container of (potentially) multi-byte character string,
- // which may have embedded nulls. Embedded null support is required for
- // some Asian languages on Windows.
-
- template< class Container >
- path( const Container & ctr,
- system::error_code & ec = system::throws,
- typename boost::enable_if<pathable_container<Container> >::type* dummy=0 ) // #5
- { detail::convert_append_helper( ctr.begin(), ctr.end(), m_path, ec ); }
-
-
- // ----- assignments -----
-
- path & operator=( const path & p ) // #1
- {
- m_path = p.m_path;
- return *this;
- }
-
- template< class InputIterator >
- typename boost::enable_if<pathable_iterator<InputIterator>, path &>::type
- operator=( InputIterator begin ) // #2
- {
- m_path.clear();
- detail::convert_append_helper( begin, m_path, system::throws );
- return *this;
- }
-
- template< class InputIterator >
- typename boost::enable_if<pathable_iterator<InputIterator>, path &>::type
- assign( InputIterator begin,
- system::error_code & ec = system::throws ) // #3
- {
- m_path.clear();
- detail::convert_append_helper( begin, m_path, ec );
- return *this;
- }
-
- template< class FowardIterator >
- path & assign( FowardIterator begin, FowardIterator end,
- system::error_code & ec = system::throws ) // #4
- {
- m_path.clear();
- detail::convert_append_helper( begin, end, m_path, ec );
- return *this;
- }
-
- template< class Container >
- typename boost::enable_if<pathable_container<Container>, path &>::type
- operator=( const Container & ctr ) // #5
- {
- m_path.clear();
- detail::convert_append_helper( ctr.begin(), ctr.end(), m_path, system::throws );
- return *this;
- }
-
- template< class Container >
- typename boost::enable_if<pathable_container<Container>, path &>::type
- assign( const Container & ctr,
- system::error_code & ec = system::throws ) // #6
- {
- m_path.clear();
- detail::convert_append_helper( ctr.begin(), ctr.end(), m_path, ec );
- return *this;
- }
-
- // ----- appends -----
-
- path & operator/=( const path & p ) // #1
- {
- append_separator_if_needed_();
- m_path += p.m_path;
- return *this;
- }
-
- template< class InputIterator >
- typename boost::enable_if<pathable_iterator<InputIterator>, path &>::type
- operator/=( InputIterator begin ) // #2
- {
- append_separator_if_needed_();
- detail::convert_append_helper( begin, m_path, system::throws );
- return *this;
- }
-
- template< class InputIterator >
- typename boost::enable_if<pathable_iterator<InputIterator>, path &>::type
- append( InputIterator begin,
- system::error_code & ec = system::throws ) // #3
- {
- append_separator_if_needed_();
- detail::convert_append_helper( begin, m_path, ec );
- return *this;
- }
-
- template< class FowardIterator >
- path & append( FowardIterator begin, FowardIterator end,
- system::error_code & ec = system::throws ) // #4
- {
- append_separator_if_needed_();
- detail::convert_append_helper( begin, end, m_path, ec );
- return *this;
- }
-
- template< class Container >
- typename boost::enable_if<pathable_container<Container>, path &>::type
- operator/=( const Container & ctr ) // #5
- {
- append_separator_if_needed_();
- detail::convert_append_helper( ctr.begin(), ctr.end(), m_path, system::throws );
- return *this;
- }
-
- template< class Container >
- typename boost::enable_if<pathable_container<Container>, path &>::type
- append( const Container & ctr,
- system::error_code & ec = system::throws ) // #6
- {
- append_separator_if_needed_();
- detail::convert_append_helper( ctr.begin(), ctr.end(), m_path, ec );
- return *this;
- }
-
- // ----- modifiers -----
-
- void clear() { m_path.clear(); }
-
- void swap( path & rhs )
- {
- m_path.swap( rhs.m_path );
-# ifdef BOOST_CYGWIN_PATH
- std::swap( m_cygwin_root, rhs.m_cygwin_root );
-# endif
- }
-
- path & remove_filename()
- {
- m_path.erase(
- detail::filename_pos( m_path, m_path.size() ) );
- return *this;
- }
-
- // ----- conversion operators -----
-
- // return formatted "as input"
-
-# ifdef BOOST_WINDOWS_API
-
- operator const std::string() const { return detail::convert( m_path, system::throws ); }
- operator const std::wstring&() const { return m_path; }
-
-# else // BOOST_POSIX_API
-
- operator const std::string&() const { return m_path; }
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- operator const std::wstring() const { return detail::convert( m_path, system::throws ); }
-# endif
-
-# endif
-
- // ----- observers -----
-
- // For operating systems that format file paths differently than directory
- // paths, returns from observers are formatted as file names unless there
- // is a trailing separator, in which case returns are formatted as directory
- // paths. POSIX and Windows make no such distinction.
-
- // Implementations are permitted to return const values or const references.
-
- template< class T >
- T string( system::error_code & ec = system::throws ) const
- { return convert<T>( m_path, ec ); }
-
-# ifdef BOOST_WINDOWS_API
-
- // return formatted "as input"
- const std::string string( system::error_code & ec = system::throws ) const { return detail::convert( m_path, ec ); }
- const std::wstring & wstring() const { return m_path; }
- const std::wstring & wstring( system::error_code & ec ) const { ec.clear(); return m_path; }
-
-# else // BOOST_POSIX_API
-
- // return formatted "as input"
- const std::string & string() const { return m_path; }
- const std::string & string( system::error_code & ec ) const { ec.clear(); return m_path; }
-# ifndef BOOST_FILESYSTEM_NARROW_ONLY
- const std::wstring wstring( system::error_code & ec = system::throws ) const { return detail::convert( m_path, ec ); }
-# endif
-# endif
-
-
- // return formatted as indicated by function name
-# ifdef BOOST_WINDOWS_PATH
-
- const path native() const;
- const path generic() const;
-
-# else // BOOST_POSIX_PATH
-
- const path native() const { return m_path; }
- const path generic() const { return m_path; }
-
-# endif
-
- const value_type * c_str() const { return m_path.c_str(); } // native format
-
- // ----- decomposition -----
-
- path root_path() const;
- path root_name() const; // returns 0 or 1 element path
- // even on POSIX, root_name() is non-empty() for network paths
- path root_directory() const; // returns 0 or 1 element path
- path relative_path() const;
- path parent_path() const;
- path filename() const; // returns 0 or 1 element path
- path stem() const; // returns 0 or 1 element path
- path extension() const; // returns 0 or 1 element path
-
- // ----- query -----
-
- bool empty() const { return m_path.empty(); } // name consistent with std containers
- bool has_root_path() const { return has_root_directory() || has_root_name(); }
- bool has_root_name() const { return !root_name().empty(); }
- bool has_root_directory() const { return !root_directory().empty(); }
- bool has_relative_path() const { return !relative_path().empty(); }
- bool has_filename() const { return !m_path.empty(); }
- bool has_parent_path() const { return !parent_path().empty(); }
- bool is_complete() const
- {
-# ifdef BOOST_WINDOWS_PATH
- return has_root_name() && has_root_directory();
-# else
- return has_root_directory();
-# endif
- }
-
- // ----- locale -----
-
- static std::locale imbue( const std::locale & loc )
- {
- std::locale tmp;
- tmp = *detail::path_locale;
- detail::path_locale = &loc;
- return tmp;
- }
-
- static std::locale getloc() { return *detail::path_locale; }
-
- // ----- iterators -----
-
- class iterator;
- typedef iterator const_iterator;
-
- iterator begin() const;
- iterator end() const;
-
- private:
-
- // m_path has the type, encoding, and format required by the native
- // operating system. Thus for POSIX and Windows there is no conversion for
- // passing m_path.c_str() to the O/S API or when obtaining a path from the
- // O/S API. POSIX encoding is unspecified other than for dot and slash
- // characters; POSIX just treats paths as a sequence of bytes. Windows
- // encoding is UCS-2 or UTF-16 depending on the version.
-
- string_type m_path; // Windows: backslashes NOT converted to slashes
-
-
- void append_separator_if_needed_();
-
- // Was qualified; como433beta8 reports:
- // warning #427-D: qualified name is not allowed in member declaration
- friend class iterator;
- friend bool operator<( const path & lhs, const path & rhs );
-
- static bool m_path_lex_compare( iterator first1, iterator last1,
- iterator first2, iterator last2 );
-
- // see path::iterator::increment/decrement comment below
- static void m_path_iterator_increment( path::iterator & it );
- static void m_path_iterator_decrement( path::iterator & it );
- };
-
- //--------------------------------------------------------------------------//
- // //
- // class path::iterator //
- // //
- //--------------------------------------------------------------------------//
-
- class path::iterator
- : public boost::iterator_facade<
- iterator,
- path const,
- boost::bidirectional_traversal_tag >
- {
- private:
- friend class boost::iterator_core_access;
- friend class boost::filesystem::path;
- friend void m_path_iterator_increment( path::iterator & it );
- friend void m_path_iterator_decrement( path::iterator & it );
-
- const path & dereference() const { return m_element; }
-
- bool equal( const iterator & rhs ) const
- {
- return m_path_ptr == rhs.m_path_ptr && m_pos == rhs.m_pos;
- }
-
- // iterator_facade derived classes don't seem to like implementations in
- // separate translation unit dll's, so forward to class path static members
- void increment() { m_path_iterator_increment( *this ); }
- void decrement() { m_path_iterator_decrement( *this ); }
-
- path m_element; // current element
- const path * m_path_ptr; // path being iterated over
- string_type::size_type m_pos; // position of name in
- // m_path_ptr->m_path. The
- // end() iterator is indicated by
- // m_pos == m_path_ptr->m_path.size()
- }; // path::iterator
-
- //--------------------------------------------------------------------------//
- // //
- // non-member functions //
- // //
- //--------------------------------------------------------------------------//
-
- inline bool operator<( const path & lhs, const path & rhs )
- {
- // because path iterators yield paths, std::lexicographical_compare
- // infinately recurses, so use a path aware version
- return path::m_path_lex_compare(
- lhs.begin(), lhs.end(), rhs.begin(), rhs.end() );
- }
-
- inline bool operator==( const path & lhs, const path & rhs ) { return !(lhs < rhs) && !(rhs < lhs); }
- inline bool operator!=( const path & lhs, const path & rhs ) { return !(lhs == rhs); }
- inline bool operator<=( const path & lhs, const path & rhs ) { return !(rhs < lhs); }
- inline bool operator> ( const path & lhs, const path & rhs ) { return rhs < lhs; }
- inline bool operator>=( const path & lhs, const path & rhs ) { return !(lhs < rhs); }
-
- inline void swap( path & lhs, path & rhs ) { lhs.swap( rhs ); }
-
- inline path operator/( const path & lhs, const path & rhs ) { return path( lhs ) /= rhs; }
-
- // inserters and extractors
-
- // templated versions are too aggressive; path_test gets ambiguous overloads
- // with std::basic_string.
- //
- //template < class Ostream >
- //Ostream & operator<<( Ostream & os, const path & p )
- //{
- // os << p.string< std::basic_string<typename Ostream::char_type,
- // typename Ostream::traits_type > >();
- // return os;
- //}
- //
- //template < class Istream >
- //Istream & operator>>( Istream & is, path & p )
- //{
- // std::basic_string<typename Istream::char_type,
- // typename Istream::traits_type > > str;
- // is >> str;
- // p = str;
- // return is;
- //}
-
- inline std::ostream & operator<<( std::ostream & os, const path & p )
- {
- os << p.string();
- return os;
- }
-
- inline std::wostream & operator<<( std::wostream & os, const path & p )
- {
- os << p.wstring();
- return os;
- }
-
- inline std::istream & operator>>( std::istream & is, path & p )
- {
- std::string str;
- is >> str;
- p = str;
- return is;
- }
-
- inline std::wistream & operator>>( std::wistream & is, path & p )
- {
- std::wstring str;
- is >> str;
- p = str;
- return is;
- }
- // name_checks
-
- BOOST_FILESYSTEM_DECL bool portable_posix_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool windows_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_directory_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool portable_file_name( const std::string & name );
- BOOST_FILESYSTEM_DECL bool native( const std::string & name );
-
-} // namespace filesystem
-} // namespace boost
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-
-#endif // BOOST_FILESYSTEM_PATH_HPP
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