From: <bl...@us...> - 2003-04-01 08:26:22
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem In directory sc8-pr-cvs1:/tmp/cvs-serv17363/deplib/boostcvs/boost/filesystem Modified Files: exception.hpp fstream.hpp operations.hpp path.hpp Log Message: * upgraded to the official boost 1.30 Index: exception.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/exception.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** exception.hpp 23 Oct 2002 20:22:42 -0000 1.1.1.1 --- exception.hpp 1 Apr 2003 08:25:42 -0000 1.2 *************** *** 2,5 **** --- 2,6 ---- // < ----------------------------------------------------------------------- > + // < Copyright © 2002 Beman Dawes > // < Copyright © 2001 Dietmar Kühl, All Rights Reserved > // < > *************** *** 8,19 **** // < that the above copyright notice appears in all copies and that > // < both that copyright notice and this permission notice appear in > ! // < supporting documentation. Dietmar Kühl makes no representations about > // < the suitability of this software for any purpose. It is provided > // < "as is" without express or implied warranty. > // < ----------------------------------------------------------------------- > ! // Original author: Dietmar Kühl. Revised by Beman Dawes. ! ! // See http://www.boost.org for most recent version including documentation. //----------------------------------------------------------------------------// --- 9,18 ---- // < that the above copyright notice appears in all copies and that > // < both that copyright notice and this permission notice appear in > ! // < supporting documentation. The authors make no representations about > // < the suitability of this software for any purpose. It is provided > // < "as is" without express or implied warranty. > // < ----------------------------------------------------------------------- > ! // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// *************** *** 22,25 **** --- 21,26 ---- #define BOOST_FILESYSTEM_EXCEPTION_HPP + #include <boost/filesystem/path.hpp> + #include <string> #include <stdexcept> *************** *** 31,59 **** namespace filesystem { ! enum error_type { system_error }; ! class filesystem_error: ! public std::runtime_error { public: ! explicit filesystem_error( std::string const& msg ); ! // Effects: : std::runtime_error(implementation-defined), ! // m_msg(msg), m_err(0) ! explicit filesystem_error( std::string const& msg, error_type ); ! // Effects: : std::runtime_error(implementation-defined), ! // m_msg(msg), m_err(value), where value is appropriate ! // for the operating system (for example, GetLastError() on Windows, ! // errno on POSIX) ~filesystem_error() throw(); ! char const* what() const throw(); ! int error() const { return m_err; } ! // Note: a value of 0 implies an internal (rather than system) error private: ! mutable std::string m_msg; ! mutable int m_err; }; --- 32,101 ---- namespace filesystem { ! namespace detail ! { ! int system_error_code(); // artifact of POSIX and WINDOWS error reporting ! } ! enum error_code ! { ! no_error = 0, ! system_error, // system generated error; if possible, is translated ! // to one of the more specific errors below. ! other_error, // library generated error ! security_error, // includes access rights, permissions failures ! read_only_error, ! io_error, ! path_error, ! not_found_error, ! not_directory_error, ! busy_error, // implies trying again might succeed ! already_exists_error, ! not_empty_error, ! is_directory_error, ! out_of_space_error, ! out_of_memory_error, ! out_of_resource_error ! }; ! ! ! class filesystem_error : public std::runtime_error { public: ! filesystem_error( ! const std::string & who, ! const std::string & message ); // assumed to be error_code::other_error ! filesystem_error( ! const std::string & who, ! const path & path1, ! const std::string & message ); // assumed to be error_code::other_error ! ! filesystem_error( ! const std::string & who, ! const path & path1, ! int sys_err_code ); ! ! filesystem_error( ! const std::string & who, ! const path & path1, ! const path & path2, ! int sys_err_code ); ~filesystem_error() throw(); ! ! int native_error() const { return m_sys_err; } ! // Note: a value of 0 implies a library (rather than system) error ! error_code error() const { return m_err; } ! const std::string & who() const; // name of who throwing exception ! const path & path1() const; // argument 1 to who; may be empty() ! const path & path2() const; // argument 2 to who; may be empty() private: ! int m_sys_err; ! error_code m_err; ! std::string m_who; ! path m_path1; ! path m_path2; }; Index: fstream.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/fstream.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fstream.hpp 23 Oct 2002 20:22:43 -0000 1.1.1.1 --- fstream.hpp 1 Apr 2003 08:25:44 -0000 1.2 *************** *** 6,10 **** // warranty, and with no claim as to its suitability for any purpose. ! // See http://www.boost.org for most recent version including documentation. //----------------------------------------------------------------------------// --- 6,10 ---- // warranty, and with no claim as to its suitability for any purpose. ! // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// *************** *** 28,37 **** virtual ~basic_filebuf() {} std::basic_filebuf<charT,traits> * open( const path & file_ph, std::ios_base::openmode mode ) { return std::basic_filebuf<charT,traits>::open( ! file_ph.file_path().c_str(), mode ); } }; --- 28,39 ---- virtual ~basic_filebuf() {} + #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this std::basic_filebuf<charT,traits> * open( const path & file_ph, std::ios_base::openmode mode ) { return std::basic_filebuf<charT,traits>::open( ! file_ph.native_file_string().c_str(), mode ); } + #endif }; *************** *** 49,60 **** std::ios_base::openmode mode = std::ios_base::in ) : std::basic_ifstream<charT,traits>( ! file_ph.file_path().c_str(), mode ) {} virtual ~basic_ifstream() {} void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) { std::basic_ifstream<charT,traits>::open( ! file_ph.file_path().c_str(), mode ); } }; --- 51,64 ---- std::ios_base::openmode mode = std::ios_base::in ) : std::basic_ifstream<charT,traits>( ! file_ph.native_file_string().c_str(), mode ) {} virtual ~basic_ifstream() {} + #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in ) { std::basic_ifstream<charT,traits>::open( ! file_ph.native_file_string().c_str(), mode ); } + #endif }; *************** *** 72,83 **** std::ios_base::openmode mode = std::ios_base::out ) : std::basic_ofstream<charT,traits>( ! file_ph.file_path().c_str(), mode ) {} virtual ~basic_ofstream() {} void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) { std::basic_ofstream<charT,traits>::open( ! file_ph.file_path().c_str(), mode ); } }; --- 76,89 ---- std::ios_base::openmode mode = std::ios_base::out ) : std::basic_ofstream<charT,traits>( ! file_ph.native_file_string().c_str(), mode ) {} virtual ~basic_ofstream() {} + #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::out ) { std::basic_ofstream<charT,traits>::open( ! file_ph.native_file_string().c_str(), mode ); } + #endif }; *************** *** 95,106 **** std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) : std::basic_fstream<charT,traits>( ! file_ph.file_path().c_str(), mode ) {} virtual ~basic_fstream() {} void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) { std::basic_fstream<charT,traits>::open( ! file_ph.file_path().c_str(), mode ); } }; --- 101,114 ---- std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) : std::basic_fstream<charT,traits>( ! file_ph.native_file_string().c_str(), mode ) {} virtual ~basic_fstream() {} + #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // VC++ 6.0 can't handle this void open( const path & file_ph, std::ios_base::openmode mode = std::ios_base::in|std::ios_base::out ) { std::basic_fstream<charT,traits>::open( ! file_ph.native_file_string().c_str(), mode ); } + #endif }; Index: operations.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/operations.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** operations.hpp 23 Oct 2002 20:22:43 -0000 1.1.1.1 --- operations.hpp 1 Apr 2003 08:25:44 -0000 1.2 *************** *** 15,19 **** // < ----------------------------------------------------------------------- > ! // See http://www.boost.org for most recent version including documentation. //----------------------------------------------------------------------------// --- 15,19 ---- // < ----------------------------------------------------------------------- > ! // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// *************** *** 24,29 **** #include <boost/config.hpp> #include <boost/filesystem/path.hpp> ! #include <boost/smart_ptr.hpp> ! #include <boost/iterator_adaptors.hpp> #include <string> --- 24,29 ---- #include <boost/config.hpp> #include <boost/filesystem/path.hpp> ! #include <boost/shared_ptr.hpp> ! #include <boost/iterator.hpp> #include <string> *************** *** 57,125 **** void create_directory( const path & directory_ph ); ! void remove( const path & ph ); void rename( const path & from_path, const path & to_path ); - unsigned long remove_all( const path & ph ); - void copy_file( const path & from_file_ph, const path & to_file_ph ); ! const path & initial_directory(); ! // directory_iterator details ----------------------------------------------// ! namespace detail { ! const char * implementation_name(); ! class directory_iterator_imp; ! ! struct directory_iterator_internals ! { ! typedef boost::shared_ptr< detail::directory_iterator_imp > dii_ptr; ! dii_ptr imp; ! const path & deref() const; ! void inc(); ! }; ! struct dii_policies : public default_iterator_policies { ! ! template <class IteratorAdaptor> ! typename IteratorAdaptor::reference ! dereference(const IteratorAdaptor& x) const ! { return x.base().deref(); } ! ! template <class IteratorAdaptor> ! void increment(IteratorAdaptor& x) ! { x.base().inc(); } ! ! template <class IteratorAdaptor1, class IteratorAdaptor2> ! bool equal(const IteratorAdaptor1& x, const IteratorAdaptor2& y) const ! { return x.base().imp == y.base().imp; } }; - } - - // directory_iterator ------------------------------------------------------// ! class directory_iterator ! : public boost::iterator_adaptor< ! // because directory_iterator is an InputIterator, shallow copy- ! // semantics are required, and shared_ptr provides that. ! detail::directory_iterator_internals, ! detail::dii_policies, ! path, const path &, const path *, ! std::input_iterator_tag, std::ptrdiff_t > ! { ! public: ! directory_iterator(); // creates the "end" iterator ! explicit directory_iterator( const path & directory_path ); ! // workaround iterator_adaptor / compiler interactions ! const boost::filesystem::path * operator->() const ! { return &base().deref(); } }; --- 57,117 ---- void create_directory( const path & directory_ph ); ! bool remove( const path & ph ); ! unsigned long remove_all( const path & ph ); void rename( const path & from_path, const path & to_path ); void copy_file( const path & from_file_ph, const path & to_file_ph ); ! path current_path(); ! const path & initial_path(); ! path system_complete( const path & ph ); ! path complete( const path & ph, const path & base = initial_path() ); ! // directory_iterator ------------------------------------------------------// ! ! class directory_iterator ! : public boost::iterator< std::input_iterator_tag, ! path, std::ptrdiff_t, const path *, const path & > { ! private: ! typedef directory_iterator self; ! public: ! directory_iterator(); // creates the "end" iterator ! explicit directory_iterator( const path & p ); ! reference operator*() const { return m_deref(); } ! pointer operator->() const { return &m_deref(); } ! self & operator++() { m_inc(); return *this; } ! friend bool operator==( const self & x, const self & y ) ! { return x.m_imp == y.m_imp; } ! friend bool operator!=( const self & x, const self & y ) ! { return !(x.m_imp == y.m_imp); } ! struct path_proxy // allows *i++ to work, as required by std { ! path pv; ! explicit path_proxy( const path & p ) : pv(p) {} ! path operator*() const { return pv; } }; ! path_proxy operator++(int) ! { ! path_proxy pp( m_deref() ); ! ++*this; ! return pp; ! } ! private: ! class dir_itr_imp; ! // shared_ptr provides shallow-copy semantics required for InputIterators ! typedef boost::shared_ptr< dir_itr_imp > m_imp_ptr; ! m_imp_ptr m_imp; ! reference m_deref() const; ! void m_inc(); }; Index: path.hpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem/path.hpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** path.hpp 23 Oct 2002 20:22:44 -0000 1.1.1.1 --- path.hpp 1 Apr 2003 08:25:44 -0000 1.2 *************** *** 7,11 **** ! // See http://www.boost.org for most recent version including documentation. //----------------------------------------------------------------------------// --- 7,11 ---- ! // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// *************** *** 33,39 **** const path * path_ptr; // path being iterated over. std::string::size_type pos; // position of name in ! // path_ptr->generic_path(). The // end() iterator is indicated by ! // pos == path_ptr->generic_path().size() const std::string & operator*() const { return name; } --- 33,39 ---- const path * path_ptr; // path being iterated over. std::string::size_type pos; // position of name in ! // path_ptr->string(). The // end() iterator is indicated by ! // pos == path_ptr->string().size() const std::string & operator*() const { return name; } *************** *** 43,50 **** { return path_ptr == rhs.path_ptr && pos == rhs.pos; } }; ! } ! enum path_format { system_specific }; // ugly enough to discourage use ! // except when actually needed // path -------------------------------------------------------------------// --- 43,50 ---- { return path_ptr == rhs.path_ptr && pos == rhs.pos; } }; ! } // detail ! enum path_format { native }; // ugly enough to discourage use ! // except when actually needed // path -------------------------------------------------------------------// *************** *** 64,80 **** // append operations: ! path & operator <<=( const path & rhs ); ! const path operator << ( const path & rhs ) const ! { return path( *this ) <<= rhs; } // query functions: ! bool is_null() const { return m_path.size() == 0; } ! const std::string & generic_path() const { return m_path; } ! const std::string & file_path() const { return m_path; } // native format ! const std::string & directory_path() const { return m_path; } // ditto ! const std::string leaf() const; ! const path branch() const; // iteration over the names in the path: --- 64,95 ---- // append operations: ! path & operator /=( const path & rhs ); ! path operator /( const path & rhs ) const ! { return path( *this ) /= rhs; } ! ! // conversion functions: ! const std::string & string() const { return m_path; } ! std::string native_file_string() const; ! std::string native_directory_string() const; ! ! // decomposition functions: ! path root_path() const; ! std::string root_name() const; ! std::string root_directory() const; ! path relative_path() const; ! std::string leaf() const; ! path branch_path() const; // query functions: ! bool empty() const { return m_path.empty(); } // name consistent with std containers ! bool is_complete() const; ! bool has_root_path() const; ! bool has_root_name() const; ! bool has_root_directory() const; ! bool has_relative_path() const; ! bool has_leaf() const { return !m_path.empty(); } ! bool has_branch_path() const; // iteration over the names in the path: *************** *** 89,94 **** > iterator; ! const iterator begin() const; ! const iterator end() const { iterator itr; --- 104,109 ---- > iterator; ! iterator begin() const; ! iterator end() const { iterator itr; *************** *** 104,108 **** // in other implementations, particularly where there were wide // differences between generic and system-specific argument formats, ! // or between file_path() and directory_path() formats. std::string m_path; --- 119,123 ---- // in other implementations, particularly where there were wide // differences between generic and system-specific argument formats, ! // or between native_file_string() and native_directory_string() formats. std::string m_path; *************** *** 122,130 **** // path non-member functions ---------------------------------------------// ! inline const path operator << ( const char * lhs, const path & rhs ) ! { return path( lhs ) <<= rhs; } ! inline const path operator << ( const std::string & lhs, const path & rhs ) ! { return path( lhs ) <<= rhs; } // error checking --------------------------------------------------------// --- 137,145 ---- // path non-member functions ---------------------------------------------// ! inline path operator / ( const char * lhs, const path & rhs ) ! { return path( lhs ) /= rhs; } ! inline path operator / ( const std::string & lhs, const path & rhs ) ! { return path( lhs ) /= rhs; } // error checking --------------------------------------------------------// |