You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(15) |
Feb
(26) |
Mar
(97) |
Apr
(224) |
May
(226) |
Jun
|
Jul
(3) |
Aug
(22) |
Sep
(48) |
Oct
|
Nov
|
Dec
(38) |
2004 |
Jan
(28) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(37) |
Jul
|
Aug
(73) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <bl...@us...> - 2003-04-05 11:23:28
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test In directory sc8-pr-cvs1:/tmp/cvs-serv1289/deplib/boostcvs/libs/filesystem/test Added Files: convenience_test.cpp Jamfile Log Message: * upgraded to the official boost 1.30 filesystem --- NEW FILE: convenience_test.cpp --- // libs/filesystem/test/convenience_test.cpp -------------------------------// // (C) Copyright Beman Dawes, 2002 // (C) Copyright Vladimir Prus, 2002 // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org/libs/filesystem for documentation. #include <boost/filesystem/convenience.hpp> namespace fs = boost::filesystem; using fs::path; #include <boost/test/minimal.hpp> int test_main( int, char*[] ) { // create_directories() tests ----------------------------------------------// fs::create_directories( "" ); // should be harmless fs::create_directories( "/" ); // ditto fs::remove_all( "xx/yy/zz" ); // make sure slate is blank fs::create_directories( "xx" ); BOOST_TEST( fs::exists( "xx" ) ); BOOST_TEST( fs::is_directory( "xx" ) ); fs::create_directories( "xx/ww/zz" ); BOOST_TEST( fs::exists( "xx" ) ); BOOST_TEST( fs::exists( "xx/ww" ) ); BOOST_TEST( fs::exists( "xx/ww/zz" ) ); BOOST_TEST( fs::is_directory( "xx" ) ); BOOST_TEST( fs::is_directory( "xx/ww" ) ); BOOST_TEST( fs::is_directory( "xx/ww/zz" ) ); return 0; } --- NEW FILE: Jamfile --- # Boost Filesystem Library test Jamfile subproject libs/filesystem/test ; # bring in rules for testing SEARCH on testing.jam = $(BOOST_BUILD_PATH) ; include testing.jam ; # Make tests run by default. DEPENDS all : test ; { # look in BOOST_ROOT for sources first, just in this Jamfile local SEARCH_SOURCE = $(BOOST_ROOT) $(SEARCH_SOURCE) ; test-suite "filesystem" : [ run libs/filesystem/test/path_test.cpp <lib>../../../libs/filesystem/build/boost_filesystem ] [ run libs/filesystem/test/operations_test.cpp <lib>../../../libs/filesystem/build/boost_filesystem ] [ run libs/filesystem/test/fstream_test.cpp <lib>../../../libs/filesystem/build/boost_filesystem ] [ run libs/filesystem/test/convenience_test.cpp <lib>../../../libs/filesystem/build/boost_filesystem ] # [ run libs/filesystem/test/recursive_dir_itr_test.cpp # <lib>../../../libs/filesystem/build/boost_filesystem # ] ; } |
From: <bl...@us...> - 2003-04-05 11:23:28
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src In directory sc8-pr-cvs1:/tmp/cvs-serv1289/deplib/boostcvs/libs/filesystem/src Added Files: convenience.cpp Log Message: * upgraded to the official boost 1.30 filesystem --- NEW FILE: convenience.cpp --- // libs/filesystem/src/convenience.cpp -------------------------------------// // (C) Copyright Beman Dawes, 2002 // (C) Copyright Vladimir Prus, 2002 // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org/libs/filesystem for documentation. #include <boost/filesystem/convenience.hpp> namespace boost { namespace filesystem { // create_directories (contributed by Vladimir Prus) -----------------------// void create_directories(const path& ph) { if (ph.empty() || exists(ph)) return; // First create branch, by calling ourself recursively create_directories(ph.branch_path()); // Now that parent's path exists, create the directory create_directory(ph); } } // namespace filesystem } // namespace boost |
From: <bl...@us...> - 2003-04-05 11:23:28
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/boost/filesystem In directory sc8-pr-cvs1:/tmp/cvs-serv1289/deplib/boostcvs/boost/filesystem Added Files: convenience.hpp Log Message: * upgraded to the official boost 1.30 filesystem --- NEW FILE: convenience.hpp --- // boost/filesystem/convenience.hpp ----------------------------------------// // (C) Copyright Beman Dawes, 2002 // (C) Copyright Vladimir Prus, 2002 // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// #ifndef BOOST_FILESYSTEM_CONVENIENCE_HPP #define BOOST_FILESYSTEM_CONVENIENCE_HPP #include <boost/filesystem/path.hpp> #include <boost/filesystem/operations.hpp> namespace boost { namespace filesystem { // create_directories (contributed by Vladimir Prus) -----------------------// /** Creates directory 'ph' and all necessary parent directories. @post exists(directory_ph) && is_directory(directory_ph) && is_empty(directory_ph) */ void create_directories(const path& ph); } // namespace filesystem } // namespace boost #endif // BOOST_FILESYSTEM_CONVENIENCE_HPP |
From: <bl...@us...> - 2003-04-05 11:23:28
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/example In directory sc8-pr-cvs1:/tmp/cvs-serv1289/deplib/boostcvs/libs/filesystem/example Added Files: Jamfile.v2 simple_ls.cpp Log Message: * upgraded to the official boost 1.30 filesystem --- NEW FILE: Jamfile.v2 --- project : requirements <library>../build/fs ; exe simple_ls : simple_ls.cpp ; --- NEW FILE: simple_ls.cpp --- // simple_ls program -------------------------------------------------------// // (C) Copyright Jeff Garland and Beman Dawes, 2002. Permission to copy, use, // modify, sell and distribute this software is granted provided this copyright // notice appears in all copies. This software is provided "as is" without // express or implied warranty, and with no claim as to its suitability for // any purpose. // See http://www.boost.org/libs/filesystem for documentation. #include "boost/filesystem/operations.hpp" #include "boost/filesystem/path.hpp" #include <iostream> namespace fs = boost::filesystem; int main( int argc, char* argv[] ) { fs::path full_path( fs::initial_path() ); if ( argc > 1 ) full_path = fs::system_complete( fs::path( argv[1], fs::native ) ); else std::cout << "\nusage: simple_ls [path]" << std::endl; unsigned long file_count = 0; unsigned long dir_count = 0; unsigned long err_count = 0; if ( !fs::exists( full_path ) ) { std::cout << "\nNot found: " << full_path.native_file_string() << std::endl; return 1; } if ( fs::is_directory( full_path ) ) { std::cout << "\nIn directory: " << full_path.native_directory_string() << "\n\n"; fs::directory_iterator end_iter; for ( fs::directory_iterator dir_itr( full_path ); dir_itr != end_iter; ++dir_itr ) { try { if ( fs::is_directory( *dir_itr ) ) { ++dir_count; std::cout << dir_itr->leaf()<< " [directory]\n"; } else { ++file_count; std::cout << dir_itr->leaf() << "\n"; } } catch ( const std::exception & ex ) { ++err_count; std::cout << dir_itr->leaf() << " " << ex.what() << std::endl; } } std::cout << "\n" << file_count << " files\n" << dir_count << " directories\n" << err_count << " errors\n"; } else // must be a file { std::cout << "\nFound: " << full_path.native_file_string() << "\n"; } return 0; } |
From: <bl...@us...> - 2003-04-02 16:23:03
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv3921/src/pyrfta Modified Files: pyrfta.cpp Log Message: * added a few statements * struggling with virtual functions overiding in python Index: pyrfta.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pyrfta.cpp 1 Apr 2003 08:43:36 -0000 1.2 --- pyrfta.cpp 2 Apr 2003 16:22:54 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- #include <boost/python.hpp> + #include <rfta/refactoring/CodeModelVisitor.h> #include <rfta/refactoring/CodeModelStatements.h> #include <rfta/refactoring/CodeModelExpressions.h> *************** *** 6,10 **** // Notes: compiler memory allocation limits was reached after declaring two classes. // => fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit ! // Flags /Zm added to command line to increase the memory allocation limits. using namespace boost::python; --- 7,11 ---- // Notes: compiler memory allocation limits was reached after declaring two classes. // => fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit ! // Flags /Zm200 added to command line to increase the memory allocation limits. using namespace boost::python; *************** *** 13,26 **** BOOST_PYTHON_MODULE(pyrfta) { ! class_<Element>( "Element" ) ! .def( "isFromSource", &Element::isFromSource ) ! .def( "getSourceText", &Element::getSourceText ) ! .def( "getSourceRange", &Element::getSourceRange ) ! // .def( "setSource", &Element::setSource ) ! .def( "accept", &Element::accept ) ; class_<Change>( "Change" ) --- 14,252 ---- + /* Boost.Python documentation bug: + + ** Virtual Functions with Default Implementations + struct BaseWrap : Base + { + BaseWrap(PyObject* self_) + : self(self_) {} + int f() { return call_method<int>(self, "f"); } + int default_f() { return Base::f(); } // <<=== ***ADDED*** + PyObject* self; + }; + + The following constructor is missing for successful compilation with VC6: + + BaseWrap(PyObject* self_, const Base &other) + : Base(other) + , self(self_) {} + + */ + + + class StatementVisitorWrap : public StatementVisitor + { + public: + PyObject *self; + + StatementVisitorWrap( PyObject *self_ ) + : self(self_) + { + } + + void visit( BreakStatement &statement ) + { + call_method<void>( self, "visitBreakStatement" ); + } + + void visit( CaseStatement &statement ) + { + call_method<void>( self, "visitCaseStatement" ); + } + + void visit( CompoundStatement &statement ) + { + call_method<void>( self, "visitCompoundStatement" ); + } + + void visit( ConditionStatement &statement ) + { + call_method<void>( self, "visitConditionStatement" ); + } + + void visit( ContinueStatement &statement ) + { + call_method<void>( self, "visitContinueStatement" ); + } + + void visit( DefaultStatement &statement ) + { + call_method<void>( self, "visitDefaultStatement" ); + } + + void visit( DeclarationStatement &statement ) + { + call_method<void>( self, "visitDeclarationStatement" ); + } + + void visit( DoStatement &statement ) + { + call_method<void>( self, "visitDoStatement" ); + } + + void visit( ExpressionStatement &statement ) + { + call_method<void>( self, "visitExpressionStatement" ); + } + + void visit( FlowControlStatement &statement ) + { + call_method<void>( self, "visitFlowControlStatement" ); + } + + void visit( ForStatement &statement ) + { + call_method<void>( self, "visitForStatementStatement" ); + } + + void visit( GotoStatement &statement ) + { + call_method<void>( self, "visitGotoStatement" ); + } + + void visit( IfStatement &statement ) + { + call_method<void>( self, "visitIfStatement" ); + } + + void visit( IterationStatement &statement ) + { + call_method<void>( self, "visitIterationStatement" ); + } + + void visit( LabelStatement &statement ) + { + call_method<void>( self, "visitLabelStatement" ); + } + + void visit( NullStatement &statement ) + { + call_method<void>( self, "visitNullStatement" ); + } + + void visit( ReturnStatement &statement ) + { + call_method<void>( self, "visitReturnStatement" ); + } + + void visit( SwitchLabelStatement &statement ) + { + call_method<void>( self, "visitSwitchLabelStatement" ); + } + + void visit( SwitchStatement &statement ) + { + call_method<void>( self, "visitSwitchStatement" ); + } + + void visit( WhileStatement &statement ) + { + call_method<void>( self, "visitWhileStatement" ); + } + }; + + + class ExpressionVisitorWrap : public ExpressionVisitor + { + public: + PyObject *self; + + ExpressionVisitorWrap( PyObject *self_ ) + : self(self_) + { + } + + void visit( AssignInitializerExpression &expression ) + { + call_method<void>( self, "visitAssignInitializerExpression" ); + } + + void visit( ConstructorInitializerExpression &expression ) + { + call_method<void>( self, "visitConstructorInitializerExpression" ); + } + + void visit( DeclaratorExpression &expression ) + { + call_method<void>( self, "visitDeclaratorExpression" ); + } + + void visit( DefaultConditionExpression &expression ) + { + call_method<void>( self, "visitDefaultConditionExpression" ); + } + + void visit( Expression &expression ) + { + call_method<void>( self, "visitExpression" ); + } + + void visit( GenericExpression &expression ) + { + call_method<void>( self, "visitGenericExpression" ); + } + + void visit( NullExpression &expression ) + { + call_method<void>( self, "visitNullExpression" ); + } + }; + + + class ElementVisitorWrap : public ElementVisitor + , public StatementVisitorWrap + , public ExpressionVisitorWrap + { + ElementVisitorWrap( PyObject *self_ ) + : StatementVisitorWrap( self_ ) + , ExpressionVisitorWrap( self_ ) + { + } + }; + + + void statementAccept( StatementVisitor &visitor ) + { + // statement->accept( visitor ); + } + + + + + + + struct Base + { + virtual int f() + { + return 1; + } + }; + + int call_f(Base& b) { return b.f(); } + + + struct BaseWrap : Base + { + BaseWrap(PyObject* self_) + : self(self_) {} + BaseWrap(PyObject* self_, const Base &other) + : Base(other) + , self(self_) {} + int f() { return call_method<int>(self, "f"); } + int default_f() { return Base::f(); } // <<=== ***ADDED*** + PyObject* self; + }; + + BOOST_PYTHON_MODULE(pyrfta) { ! class_<Base, BaseWrap>("Base") ! .def("f", &Base::f, &BaseWrap::default_f) ; + def("call_f", call_f); + + class_<Change>( "Change" ) *************** *** 55,57 **** --- 281,336 ---- ; + class_<StatementVisitor, StatementVisitorWrap, boost::noncopyable>( "StatementVisitor" ) + ; + + // class_<ExpressionVisitor, ExpressionVisitorWrap, boost::noncopyable>( "ExpressionVisitor", no_init ) + ; + + // class_<ElementVisitor, ElementVisitorWrap, boost::noncopyable>( "ElementVisitor", no_init ) + ; + + void (Element::*mfAcceptElementVisitor)( ElementVisitor & ) = &Element::accept; + class_<Element>( "Element" ) + .def( "isFromSource", &Element::isFromSource ) + .def( "getSourceText", &Element::getSourceText ) + .def( "getSourceRange", &Element::getSourceRange ) + // .def( "setSource", &Element::setSource ) + // .def( "accept", mfAcceptElementVisitor ) + ; + + void (Statement::*mfAcceptStatementVisitor)( StatementVisitor & ) = &Statement::accept; + class_<Statement, bases<Element>, boost::noncopyable >( "Statement", no_init ) + .def( "accept", mfAcceptStatementVisitor ) + ; + + + class_<NullStatement, bases<Statement> >( "NullStatement" ) + ; + + class_<Label, bases<Element> >( "Label" ) + .def( init<std::string>() ) + .add_property( "labelName", &Label::getLabelName ) + ; + + class_<LabelHolderStatement>( "LabelHolderStatement", init<LabelPtr>() ) + .add_property( "label", &LabelHolderStatement::getLabel, &LabelHolderStatement::setLabel ) + ; + + class_<LabelStatement, bases<Statement,LabelHolderStatement> >( "LabelStatement", init<LabelPtr>() ) + ; + + def( "statementAccept", &statementAccept ); } + + + /* + class Visitor(StatementVisitor): + ... def __init__( self ): + ... pass + ... + ... def visitNullStatement( self, statement ): + ... print "NullStatement visited" + ... + ... v = Visitor() + ... s = NullStatement() + */ \ No newline at end of file |
From: <bl...@us...> - 2003-04-01 18:49:06
|
Update of /cvsroot/cpptool/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv32715 Modified Files: README Log Message: * added short instructions to build pyrfta Index: README =================================================================== RCS file: /cvsroot/cpptool/rfta/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 23 Dec 2002 22:29:28 -0000 1.3 --- README 1 Apr 2003 18:49:02 -0000 1.4 *************** *** 2,20 **** http://cpptool.sourceforge.net ! To compile the project, you need to grab boost library release 1.29. It can be found at http://boost.org. The boost archive has the following structure: ! boost_1_29/ boost/ libs/ ... ! You need to make sure that boost_1_29 is in your include path (with Microsoft Visual C++ 6.0, add the directory in Tools/Options/Directory dialog). Available projects are: - rftaparser: the parser library - rfta: the refactoring library, which use rftaparser - astdump: an application using rftaparser which dump the AST of a given source range in HTML. bin/test.bat run this binary on test datas contains --- 2,27 ---- http://cpptool.sourceforge.net ! To compile the project, you need to grab boost library release 1.30. It can be found at http://boost.org. The boost archive has the following structure: ! boost_1_30/ boost/ libs/ ... ! You need to make sure that boost_1_30 is in your include path (with Microsoft Visual C++ 6.0, add the directory in Tools/Options/Directory dialog). + To compile pyrfta (binding binding for the rfta library), you will also need + to compile the Boost.Python library, and copy that libraries found in + boost_1_30/libs/python/build/bin-stage in rfta/deplib/libs/. Refer to + Boost.Python documentation ("Building and Testing") section. + + Available projects are: - rftaparser: the parser library - rfta: the refactoring library, which use rftaparser + - pyrfta: python binding for the refactoring library. - astdump: an application using rftaparser which dump the AST of a given source range in HTML. bin/test.bat run this binary on test datas contains |
From: <bl...@us...> - 2003-04-01 18:49:06
|
Update of /cvsroot/cpptool/rfta/deplib/libs In directory sc8-pr-cvs1:/tmp/cvs-serv32715/deplib/libs Added Files: ReadMe.txt Log Message: * added short instructions to build pyrfta --- NEW FILE: ReadMe.txt --- Copy Boost.Python libraries here. |
From: <bl...@us...> - 2003-04-01 18:42:34
|
Update of /cvsroot/cpptool/rfta/deplib/libs In directory sc8-pr-cvs1:/tmp/cvs-serv30162/libs Log Message: Directory /cvsroot/cpptool/rfta/deplib/libs added to the repository |
From: <bl...@us...> - 2003-04-01 18:23:02
|
Update of /cvsroot/cpptool/rfta/src/rftavc6addin In directory sc8-pr-cvs1:/tmp/cvs-serv21310/src/rftavc6addin Modified Files: rftavc6addin.dsp Log Message: * added missing rtti settings * pyrfta output is in the build and bin directories Index: rftavc6addin.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftavc6addin/rftavc6addin.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rftavc6addin.dsp 31 Jan 2003 21:37:04 -0000 1.3 --- rftavc6addin.dsp 1 Apr 2003 18:22:57 -0000 1.4 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 76,80 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 76,80 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /D "_USRDLL" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 |
From: <bl...@us...> - 2003-04-01 18:23:01
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv21310/src/rftaparser Modified Files: rftaparser.dsp Log Message: * added missing rtti settings * pyrfta output is in the build and bin directories Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** rftaparser.dsp 1 Apr 2003 08:30:29 -0000 1.30 --- rftaparser.dsp 1 Apr 2003 18:22:57 -0000 1.31 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_EXPORTS" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTAPARSER_DLL_BUILD" /D "RFTAPARSER_NO_UT" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_EXPORTS" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTAPARSER_DLL_BUILD" /D "RFTAPARSER_NO_UT" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
From: <bl...@us...> - 2003-04-01 18:23:00
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv21310/src/pyrfta Modified Files: pyrfta.dsp Log Message: * added missing rtti settings * pyrfta output is in the build and bin directories Index: pyrfta.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyrfta.dsp 1 Apr 2003 08:32:29 -0000 1.1 --- pyrfta.dsp 1 Apr 2003 18:22:56 -0000 1.2 *************** *** 39,47 **** # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 ! # PROP Output_Dir "Release" ! # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BOOST_PYTHON_DYNAMIC_LIB" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 39,48 ---- # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 ! # PROP Output_Dir "..\..\build\pyrfta\Release" ! # PROP Intermediate_Dir "..\..\build\pyrfta\Release" ! # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "_USRDLL" /YX /FD /Zm200 /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 53,57 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python.lib /nologo /dll /machine:I386 /libpath:"../../lib" /libpath:"../../deplib/libs" !ELSEIF "$(CFG)" == "pyrfta - Win32 Debug" --- 54,63 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python.lib /nologo /dll /machine:I386 /out:"..\..\build\pyrfta\Release/pyrfta.pyd" /libpath:"../../lib" /libpath:"../../deplib/libs" ! # Begin Special Build Tool ! TargetPath=\prg\vc\Rfta\build\pyrfta\Release\pyrfta.pyd ! SOURCE="$(InputPath)" ! PostBuild_Cmds=copy $(TargetPath) ..\..\bin\pyrfta.pyd ! # End Special Build Tool !ELSEIF "$(CFG)" == "pyrfta - Win32 Debug" *************** *** 64,69 **** # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 ! # PROP Output_Dir "Debug" ! # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c --- 70,76 ---- # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 ! # PROP Output_Dir "..\..\build\pyrfta\Debug" ! # PROP Intermediate_Dir "..\..\build\pyrfta\Debug" ! # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c *************** *** 78,82 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../lib" /libpath:"../../deplib/libs" !ENDIF --- 85,94 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python_debug.lib /nologo /dll /debug /machine:I386 /out:"..\..\build\pyrfta\Debug/pyrfta.pyd" /pdbtype:sept /libpath:"../../lib" /libpath:"../../deplib/libs" ! # Begin Special Build Tool ! TargetPath=\prg\vc\Rfta\build\pyrfta\Debug\pyrfta.pyd ! SOURCE="$(InputPath)" ! PostBuild_Cmds=copy $(TargetPath) ..\..\bin\pyrfta.pyd ! # End Special Build Tool !ENDIF |
From: <bl...@us...> - 2003-04-01 18:23:00
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv21310/src/rfta Modified Files: rfta.dsp Log Message: * added missing rtti settings * pyrfta output is in the build and bin directories Index: rfta.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/rfta.dsp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** rfta.dsp 1 Apr 2003 08:30:26 -0000 1.41 --- rfta.dsp 1 Apr 2003 18:22:57 -0000 1.42 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_EXPORTS" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_DLL_BUILD" /D "RFTA_NO_UT" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_EXPORTS" /Yu"stdafx.h" /FD /c ! # ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /I "../../deplib/cppunit/include" /I "../../deplib/boostcvs" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RFTA_DLL_BUILD" /D "RFTA_NO_UT" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 |
From: <bl...@us...> - 2003-04-01 08:43:44
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv26554/src/pyrfta Modified Files: pyrfta.cpp Log Message: * added SourceRange Index: pyrfta.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/pyrfta/pyrfta.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyrfta.cpp 1 Apr 2003 08:32:27 -0000 1.1 --- pyrfta.cpp 1 Apr 2003 08:43:36 -0000 1.2 *************** *** 42,73 **** class_<SourceRange>( "SourceRange" ) ; - /* - SourceRange(); - - SourceRange( int startIndex, - int length ); - - int getStartIndex() const; - - int getEndIndex() const; - - void moveStartIndexBy( int delta ); - - int getLength() const; - void setLength( int length ); - - bool isEmpty() const; - - bool contains( const SourceRange &other ) const; - - bool overlap( const SourceRange &other ) const; - - bool operator ==( const SourceRange &other ) const; - - bool operator <( const SourceRange &other ) const; - - std::string toString() const; - */ } --- 42,57 ---- class_<SourceRange>( "SourceRange" ) + .def( init<int,int>() ) + .def( "moveStartIndexBy", &SourceRange::moveStartIndexBy ) + .add_property( "startIndex", &SourceRange::getStartIndex ) + .add_property( "endIndex", &SourceRange::getEndIndex ) + .add_property( "length", &SourceRange::getLength, &SourceRange::setLength ) + .def( "isEmpty", &SourceRange::isEmpty ) + .def( "contains", &SourceRange::contains ) + .def( "overlap", &SourceRange::overlap ) + .def( "toString", &SourceRange::toString ) // should use str(self) + .def( self == self ) + .def( self < self ) ; } |
From: <bl...@us...> - 2003-04-01 08:43:08
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv26298/include/rfta/refactoring Modified Files: CodeModelStatements.h Log Message: * added missing dll export Index: CodeModelStatements.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelStatements.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CodeModelStatements.h 18 Mar 2003 22:37:46 -0000 1.17 --- CodeModelStatements.h 1 Apr 2003 08:43:05 -0000 1.18 *************** *** 17,21 **** ! class Statement : public Element { public: --- 17,21 ---- ! class RFTA_API Statement : public Element { public: *************** *** 28,32 **** ! class CompoundStatement : public Statement { public: --- 28,32 ---- ! class RFTA_API CompoundStatement : public Statement { public: *************** *** 76,80 **** ! class ConditionStatement : public Statement { public: --- 76,80 ---- ! class RFTA_API ConditionStatement : public Statement { public: *************** *** 98,102 **** ! class IfStatement : public ConditionStatement { public: --- 98,102 ---- ! class RFTA_API IfStatement : public ConditionStatement { public: *************** *** 132,136 **** ! class IterationStatement : public ConditionStatement { public: --- 132,136 ---- ! class RFTA_API IterationStatement : public ConditionStatement { public: *************** *** 155,159 **** ! class WhileStatement : public IterationStatement { public: --- 155,159 ---- ! class RFTA_API WhileStatement : public IterationStatement { public: *************** *** 166,170 **** ! class DoStatement : public IterationStatement { public: --- 166,170 ---- ! class RFTA_API DoStatement : public IterationStatement { public: *************** *** 177,181 **** ! class ForStatement : public IterationStatement { public: --- 177,181 ---- ! class RFTA_API ForStatement : public IterationStatement { public: *************** *** 209,213 **** ! class SwitchStatement : public ConditionStatement { public: --- 209,213 ---- ! class RFTA_API SwitchStatement : public ConditionStatement { public: *************** *** 229,233 **** ! class FlowControlStatement : public Statement { public: --- 229,233 ---- ! class RFTA_API FlowControlStatement : public Statement { public: *************** *** 237,241 **** ! class SwitchLabelStatement : public Statement { public: --- 237,241 ---- ! class RFTA_API SwitchLabelStatement : public Statement { public: *************** *** 245,249 **** ! class CaseStatement : public SwitchLabelStatement { public: --- 245,249 ---- ! class RFTA_API CaseStatement : public SwitchLabelStatement { public: *************** *** 267,271 **** ! class DefaultStatement : public SwitchLabelStatement { public: --- 267,271 ---- ! class RFTA_API DefaultStatement : public SwitchLabelStatement { public: *************** *** 275,279 **** ! class BreakStatement : public FlowControlStatement { public: --- 275,279 ---- ! class RFTA_API BreakStatement : public FlowControlStatement { public: *************** *** 283,287 **** ! class ContinueStatement : public FlowControlStatement { public: --- 283,287 ---- ! class RFTA_API ContinueStatement : public FlowControlStatement { public: *************** *** 291,295 **** ! class ReturnStatement : public FlowControlStatement { public: --- 291,295 ---- ! class RFTA_API ReturnStatement : public FlowControlStatement { public: *************** *** 317,321 **** ! class ExpressionStatement : public Statement { public: --- 317,321 ---- ! class RFTA_API ExpressionStatement : public Statement { public: *************** *** 339,343 **** ! class DeclarationStatement : public Statement { public: --- 339,343 ---- ! class RFTA_API DeclarationStatement : public Statement { public: *************** *** 355,359 **** ! class NullStatement : public Statement { public: --- 355,359 ---- ! class RFTA_API NullStatement : public Statement { public: *************** *** 363,367 **** ! class Label : public Element { public: --- 363,367 ---- ! class RFTA_API Label : public Element { public: *************** *** 377,381 **** ! class LabelHolderStatement { public: --- 377,381 ---- ! class RFTA_API LabelHolderStatement { public: *************** *** 398,402 **** ! class LabelStatement : public Statement , public LabelHolderStatement { --- 398,402 ---- ! class RFTA_API LabelStatement : public Statement , public LabelHolderStatement { *************** *** 409,413 **** ! class GotoStatement : public FlowControlStatement , public LabelHolderStatement { --- 409,413 ---- ! class RFTA_API GotoStatement : public FlowControlStatement , public LabelHolderStatement { |
From: <bl...@us...> - 2003-04-01 08:33:01
|
Update of /cvsroot/cpptool/rfta/src In directory sc8-pr-cvs1:/tmp/cvs-serv19848/src Modified Files: rfta.dsw Log Message: * added pyrfta: python binding project Index: rfta.dsw =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta.dsw,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rfta.dsw 15 Feb 2003 13:39:11 -0000 1.5 --- rfta.dsw 1 Apr 2003 08:32:25 -0000 1.6 *************** *** 64,67 **** --- 64,82 ---- ############################################################################### + Project: "pyrfta"=.\pyrfta\pyrfta.dsp - Package Owner=<4> + + Package=<5> + {{{ + }}} + + Package=<4> + {{{ + Begin Project Dependency + Project_Dep_Name rfta + End Project Dependency + }}} + + ############################################################################### + Project: "rfta"=.\rfta\rfta.dsp - Package Owner=<4> |
From: <bl...@us...> - 2003-04-01 08:32:36
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv19848/src/pyrfta Added Files: pyrfta.cpp pyrfta.dsp Log Message: * added pyrfta: python binding project --- NEW FILE: pyrfta.cpp --- #include <boost/python.hpp> #include <rfta/refactoring/CodeModelStatements.h> #include <rfta/refactoring/CodeModelExpressions.h> #include <rfta/refactoring/PlainTextDocument.h> // Notes: compiler memory allocation limits was reached after declaring two classes. // => fatal error C1076: compiler limit : internal heap limit reached; use /Zm to specify a higher limit // Flags /Zm added to command line to increase the memory allocation limits. using namespace boost::python; using namespace Refactoring::CodeModel; using Refactoring::SourceRange; BOOST_PYTHON_MODULE(pyrfta) { class_<Element>( "Element" ) .def( "isFromSource", &Element::isFromSource ) .def( "getSourceText", &Element::getSourceText ) .def( "getSourceRange", &Element::getSourceRange ) // .def( "setSource", &Element::setSource ) .def( "accept", &Element::accept ) ; class_<Change>( "Change" ) .def( init<Change::ChangeType, Refactoring::SourceRange>() ) .def( "wasReplaced", &Change::wasReplaced ) .def( "wasRemoved", &Change::wasRemoved ) .def( "wasAdded", &Change::wasAdded ) .def( "isUnmodified", &Change::isUnmodified ) .def_readwrite( "type", &Change::type_ ) .def_readwrite( "oldRange", &Change::oldRange_ ) ; enum_<Change::ChangeType>( "ChangeType" ) .value( "added", Change::added ) .value( "replaced", Change::replaced ) .value( "removed", Change::removed ) .value( "unmodified", Change::unmodified ) ; class_<SourceRange>( "SourceRange" ) ; /* SourceRange(); SourceRange( int startIndex, int length ); int getStartIndex() const; int getEndIndex() const; void moveStartIndexBy( int delta ); int getLength() const; void setLength( int length ); bool isEmpty() const; bool contains( const SourceRange &other ) const; bool overlap( const SourceRange &other ) const; bool operator ==( const SourceRange &other ) const; bool operator <( const SourceRange &other ) const; std::string toString() const; */ } --- NEW FILE: pyrfta.dsp --- # Microsoft Developer Studio Project File - Name="pyrfta" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=pyrfta - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pyrfta.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pyrfta.mak" CFG="pyrfta - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pyrfta - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "pyrfta - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pyrfta - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "BOOST_PYTHON_STATIC_LINK" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BOOST_PYTHON_DYNAMIC_LIB" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x40c /d "NDEBUG" # ADD RSC /l 0x40c /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python.lib /nologo /dll /machine:I386 /libpath:"../../lib" /libpath:"../../deplib/libs" !ELSEIF "$(CFG)" == "pyrfta - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PYRFTA_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GR /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "BOOST_PYTHON_DYNAMIC_LIB" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /Zm200 /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x40c /d "_DEBUG" # ADD RSC /l 0x40c /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib python22.lib boost_python_debug.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"../../lib" /libpath:"../../deplib/libs" !ENDIF # Begin Target # Name "pyrfta - Win32 Release" # Name "pyrfta - Win32 Debug" # Begin Source File SOURCE=.\pyrfta.cpp # End Source File # End Target # End Project |
From: <bl...@us...> - 2003-04-01 08:31:12
|
Update of /cvsroot/cpptool/rfta/src/rftaparser In directory sc8-pr-cvs1:/tmp/cvs-serv19207/src/rftaparser Modified Files: rftaparser.dsp Log Message: * upgraded to the official boost 1.30 filesystem Index: rftaparser.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rftaparser/rftaparser.dsp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** rftaparser.dsp 8 Mar 2003 13:09:52 -0000 1.29 --- rftaparser.dsp 1 Apr 2003 08:30:29 -0000 1.30 *************** *** 1017,1020 **** --- 1017,1029 ---- # Begin Source File + SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\convenience.cpp + # SUBTRACT CPP /YX /Yc /Yu + # End Source File + # Begin Source File + + SOURCE=..\..\deplib\boostcvs\boost\filesystem\convenience.hpp + # End Source File + # Begin Source File + SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\exception.cpp # SUBTRACT CPP /YX /Yc /Yu *************** *** 1045,1052 **** SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\path_posix_windows.cpp # SUBTRACT CPP /YX /Yc /Yu - # End Source File - # Begin Source File - - SOURCE=..\..\deplib\boostcvs\boost\filesystem\recursive_directory_iterator.hpp # End Source File # End Group --- 1054,1057 ---- |
From: <bl...@us...> - 2003-04-01 08:31:03
|
Update of /cvsroot/cpptool/rfta/src/rfta In directory sc8-pr-cvs1:/tmp/cvs-serv19207/src/rfta Modified Files: rfta.dsp Log Message: * upgraded to the official boost 1.30 filesystem Index: rfta.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/rfta/rfta.dsp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** rfta.dsp 16 Mar 2003 07:37:05 -0000 1.40 --- rfta.dsp 1 Apr 2003 08:30:26 -0000 1.41 *************** *** 928,931 **** --- 928,940 ---- SOURCE=.\CodeWriterInsertTest.cpp + + !IF "$(CFG)" == "rfta - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rfta - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File *************** *** 962,965 **** --- 971,983 ---- SOURCE=.\CodeWriterTestBase.cpp + + !IF "$(CFG)" == "rfta - Win32 Release" + + # PROP Exclude_From_Build 1 + + !ELSEIF "$(CFG)" == "rfta - Win32 Debug" + + !ENDIF + # End Source File # Begin Source File |
From: <bl...@us...> - 2003-04-01 08:29:51
|
Update of /cvsroot/cpptool/rfta/include/rfta/refactoring In directory sc8-pr-cvs1:/tmp/cvs-serv18894/include/rfta/refactoring Modified Files: CodeModelElement.h CodeModelExpressions.h Log Message: * added missing dll export Index: CodeModelElement.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelElement.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CodeModelElement.h 16 Mar 2003 16:18:39 -0000 1.11 --- CodeModelElement.h 1 Apr 2003 08:29:48 -0000 1.12 *************** *** 16,20 **** /// This class represents ! class Element { public: --- 16,20 ---- /// This class represents ! class RFTA_API Element { public: *************** *** 51,55 **** ! class Change { public: --- 51,55 ---- ! class RFTA_API Change { public: Index: CodeModelExpressions.h =================================================================== RCS file: /cvsroot/cpptool/rfta/include/rfta/refactoring/CodeModelExpressions.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CodeModelExpressions.h 24 Mar 2003 07:57:49 -0000 1.11 --- CodeModelExpressions.h 1 Apr 2003 08:29:48 -0000 1.12 *************** *** 17,21 **** ! class Expression : public Element { public: --- 17,21 ---- ! class RFTA_API Expression : public Element { public: *************** *** 28,32 **** ! class GenericExpression : public Expression { public: --- 28,32 ---- ! class RFTA_API GenericExpression : public Expression { public: *************** *** 51,55 **** ! class TypePart : public Element { public: --- 51,55 ---- ! class RFTA_API TypePart : public Element { public: *************** *** 63,67 **** ! class DeclaratorExpression : public Expression { public: --- 63,67 ---- ! class RFTA_API DeclaratorExpression : public Expression { public: *************** *** 93,97 **** ! class Declarator { public: --- 93,97 ---- ! class RFTA_API Declarator { public: *************** *** 128,132 **** ! class ConstructorInitializerExpression : public Expression { public: --- 128,132 ---- ! class RFTA_API ConstructorInitializerExpression : public Expression { public: *************** *** 144,148 **** ! class AssignInitializerExpression : public Expression { public: --- 144,148 ---- ! class RFTA_API AssignInitializerExpression : public Expression { public: *************** *** 160,164 **** ! class DefaultConditionExpression : public Expression { public: --- 160,164 ---- ! class RFTA_API DefaultConditionExpression : public Expression { public: *************** *** 168,172 **** ! class NullExpression : public Expression { public: --- 168,172 ---- ! class RFTA_API NullExpression : public Expression { public: |
From: <bl...@us...> - 2003-04-01 08:29:10
|
Update of /cvsroot/cpptool/rfta/src/astdumper In directory sc8-pr-cvs1:/tmp/cvs-serv18693/src/astdumper Modified Files: astdump.dsp ASTDumper.cpp Main.cpp Log Message: * upgraded to the official boost 1.30 filesystem Index: astdump.dsp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/astdumper/astdump.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** astdump.dsp 31 Jan 2003 21:37:03 -0000 1.2 --- astdump.dsp 1 Apr 2003 08:29:04 -0000 1.3 *************** *** 99,158 **** # Begin Source File ! SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\exception.cpp ! ! !IF "$(CFG)" == "astdump - Win32 Release" ! ! # SUBTRACT CPP /YX ! ! !ELSEIF "$(CFG)" == "astdump - Win32 Debug" ! ! !ENDIF ! ! # End Source File ! # Begin Source File ! ! SOURCE=..\..\deplib\boostcvs\boost\filesystem\exception.hpp ! # End Source File ! # Begin Source File ! ! SOURCE=..\..\deplib\boostcvs\boost\filesystem\fstream.hpp # End Source File # Begin Source File ! SOURCE=..\..\deplib\boostcvs\boost\filesystem\operations.hpp # End Source File # Begin Source File SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\operations_posix_windows.cpp - - !IF "$(CFG)" == "astdump - Win32 Release" - - # SUBTRACT CPP /YX - - !ELSEIF "$(CFG)" == "astdump - Win32 Debug" - - !ENDIF - - # End Source File - # Begin Source File - - SOURCE=..\..\deplib\boostcvs\boost\filesystem\path.hpp # End Source File # Begin Source File SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\path_posix_windows.cpp - - !IF "$(CFG)" == "astdump - Win32 Release" - - # SUBTRACT CPP /YX - - !ELSEIF "$(CFG)" == "astdump - Win32 Debug" - - !ENDIF - - # End Source File - # Begin Source File - - SOURCE=..\..\deplib\boostcvs\boost\filesystem\recursive_directory_iterator.hpp # End Source File # End Group --- 99,115 ---- # Begin Source File ! SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\convenience.cpp # End Source File # Begin Source File ! SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\exception.cpp # End Source File # Begin Source File SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\operations_posix_windows.cpp # End Source File # Begin Source File SOURCE=..\..\deplib\boostcvs\libs\filesystem\src\path_posix_windows.cpp # End Source File # End Group Index: ASTDumper.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/astdumper/ASTDumper.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASTDumper.cpp 20 Dec 2002 08:30:50 -0000 1.4 --- ASTDumper.cpp 1 Apr 2003 08:29:05 -0000 1.5 *************** *** 160,164 **** { std::string fileName = (boost::format( "dump-%05d.html" ) % serialNo).str(); ! boost::filesystem::path filePath = logDir << fileName; if ( !boost::filesystem::exists( filePath ) ) return filePath; --- 160,164 ---- { std::string fileName = (boost::format( "dump-%05d.html" ) % serialNo).str(); ! boost::filesystem::path filePath = logDir / fileName; if ( !boost::filesystem::exists( filePath ) ) return filePath; Index: Main.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/src/astdumper/Main.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Main.cpp 23 Oct 2002 20:25:17 -0000 1.1.1.1 --- Main.cpp 1 Apr 2003 08:29:05 -0000 1.2 *************** *** 37,46 **** int lastLineNumber = boost::lexical_cast<int>( argv[2] ); boost::filesystem::path path( argv[3], ! boost::filesystem::system_specific ); std::string outputPathName = "astdump"; if ( argc == 5 ) outputPathName = argv[4]; boost::filesystem::path outputPath( outputPathName, ! boost::filesystem::system_specific ); boost::filesystem::ifstream stream( path ); --- 37,46 ---- int lastLineNumber = boost::lexical_cast<int>( argv[2] ); boost::filesystem::path path( argv[3], ! boost::filesystem::native ); std::string outputPathName = "astdump"; if ( argc == 5 ) outputPathName = argv[4]; boost::filesystem::path outputPath( outputPathName, ! boost::filesystem::native ); boost::filesystem::ifstream stream( path ); *************** *** 64,68 **** Refactoring::ASTDumper dumper; ! dumper.dump( source, outputPath, path.generic_path() ); } catch ( std::exception &e ) --- 64,68 ---- Refactoring::ASTDumper dumper; ! dumper.dump( source, outputPath, path.string() ); } catch ( std::exception &e ) |
From: <bl...@us...> - 2003-04-01 08:26:35
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test In directory sc8-pr-cvs1:/tmp/cvs-serv17363/deplib/boostcvs/libs/filesystem/test Modified Files: fstream_test.cpp operations_test.cpp path_test.cpp Log Message: * upgraded to the official boost 1.30 Index: fstream_test.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test/fstream_test.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** fstream_test.cpp 23 Oct 2002 20:22:58 -0000 1.1.1.1 --- fstream_test.cpp 1 Apr 2003 08:25:51 -0000 1.2 *************** *** 19,25 **** #endif ! ! #define BOOST_INCLUDE_MAIN ! #include <boost/test/test_tools.hpp> int test_main( int, char*[] ) --- 19,23 ---- #endif ! #include <boost/test/minimal.hpp> int test_main( int, char*[] ) Index: operations_test.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test/operations_test.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** operations_test.cpp 23 Oct 2002 20:22:59 -0000 1.1.1.1 --- operations_test.cpp 1 Apr 2003 08:25:54 -0000 1.2 *************** *** 13,19 **** namespace fs = boost::filesystem; ! //#include <boost/test/test_tools.hpp> #include <boost/test/minimal.hpp> ! #include <boost/bind.hpp> using boost::bind; --- 13,19 ---- namespace fs = boost::filesystem; ! #include <boost/config.hpp> #include <boost/test/minimal.hpp> ! #include <boost/concept_check.hpp> #include <boost/bind.hpp> using boost::bind; *************** *** 21,34 **** #include <fstream> #include <iostream> namespace { fs::directory_iterator end_itr; void create_file( const fs::path & ph, const std::string & contents ) { ! std::ofstream f( ph.file_path().c_str() ); if ( !f ) ! throw fs::filesystem_error( "ofstream(): " + ph.generic_path() ); if ( !contents.empty() ) f << contents; } --- 21,38 ---- #include <fstream> #include <iostream> + #include <string> + #include <cerrno> namespace { + bool report_throws; fs::directory_iterator end_itr; void create_file( const fs::path & ph, const std::string & contents ) { ! std::ofstream f( ph.native_file_string().c_str() ); if ( !f ) ! throw fs::filesystem_error( "operations_test create_file", ! ph, errno ); if ( !contents.empty() ) f << contents; } *************** *** 36,61 **** void verify_file( const fs::path & ph, const std::string & expected ) { ! std::ifstream f( ph.file_path().c_str() ); if ( !f ) ! throw fs::filesystem_error( "ifstream(): " + ph.generic_path() ); std::string contents; f >> contents; if ( contents != expected ) ! throw fs::filesystem_error("verify_file(): " + ph.generic_path() ! + " contents \"" + contents + "\" != \"" + expected + "\"" ); } template< typename F > ! bool throws_fs_error( F func ) { try { func(); } ! catch ( const fs::filesystem_error & /*ex*/ ) { ! // std::cout << ex.what() << "\n"; ! return true; } - return false; } --- 40,70 ---- void verify_file( const fs::path & ph, const std::string & expected ) { ! std::ifstream f( ph.native_file_string().c_str() ); if ( !f ) ! throw fs::filesystem_error( "operations_test verify_file", ! ph, errno ); std::string contents; f >> contents; if ( contents != expected ) ! throw fs::filesystem_error( "operations_test verify_file", ! ph, " contents \"" + contents + "\" != \"" + expected + "\"" ); } template< typename F > ! bool throws_fs_error( F func, fs::error_code ec = ! ::boost::filesystem::no_error ) // VC++ 7.1 build 2292 won't accept fs:: { try { func(); } ! catch ( const fs::filesystem_error & ex ) { ! if ( report_throws ) std::cout << ex.what() << "\n"; ! if ( ec == fs::no_error || ec == ex.error() ) return true; ! std::cout << "filesystem_error::error() reports " << ex.error() ! << ", should be " << ec ! << "\n native_error() is " << ex.native_error() ! << std::endl; } return false; } *************** *** 65,84 **** // test_main ---------------------------------------------------------------// ! int test_main( int, char * [] ) { ! std::cout << "implemenation name: " ! << fs::detail::implementation_name() << "\n"; ! std::cout << "initial_directory() is \"" ! << fs::initial_directory().generic_path() << "\"\n"; ! fs::path dir( fs::initial_directory() << "temp_fs_test_directory" ); ! #ifdef BOOST_WINDOWS ! BOOST_TEST( dir.generic_path().size() > 1 ! && dir.generic_path()[1] == ':' ); // verify path includes drive ! #endif ! fs::path ng( " no-way, Jose ", fs::system_specific ); fs::remove_all( dir ); // in case residue from prior failed tests --- 74,160 ---- // test_main ---------------------------------------------------------------// ! int test_main( int argc, char * argv[] ) { ! if ( argc > 1 && *argv[1]=='-' && *(argv[1]+1)=='t' ) report_throws = true; ! ! std::string platform( BOOST_PLATFORM ); ! platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" ) ! ? "Windows" ! : "POSIX"; ! ! std::cout << "BOOST_PLATFORM: " ! << BOOST_PLATFORM << "\n"; ! std::cout << "Operating system family: " ! << platform << "\n"; ! std::cout << "initial_path().string() is\n \"" ! << fs::initial_path().string() ! << "\"\n"; ! std::cout << "initial_path().native_file_string() is\n \"" ! << fs::initial_path().native_file_string() << "\"\n"; ! BOOST_TEST( fs::initial_path().is_complete() ); ! BOOST_TEST( fs::current_path().is_complete() ); ! BOOST_TEST( fs::initial_path().string() == fs::current_path().string() ); ! ! BOOST_TEST( fs::complete( "" ).empty() ); ! BOOST_TEST( fs::complete( "/" ).string() ! == fs::initial_path().root_path().string() ); ! BOOST_TEST( fs::complete( "foo" ).string() ! == fs::initial_path().string()+"/foo" ); ! BOOST_TEST( fs::complete( "/foo" ).string() ! == fs::initial_path().root_path().string()+"foo" ); ! ! fs::path dir( fs::initial_path() / "temp_fs_test_directory" ); ! // Windows only tests ! if ( platform == "Windows" ) ! { ! BOOST_TEST( dir.string().size() > 1 ! && dir.string()[1] == ':' ); // verify path includes drive ! BOOST_TEST( fs::system_complete( "" ).empty() ); ! BOOST_TEST( fs::system_complete( "/" ).string() ! == fs::initial_path().root_path().string() ); ! BOOST_TEST( fs::system_complete( "foo" ).string() ! == fs::initial_path().string()+"/foo" ); ! BOOST_TEST( fs::system_complete( "/foo" ).string() ! == fs::initial_path().root_path().string()+"foo" ); ! ! // BOOST_TEST( fs::complete( fs::path( "c:", fs::native ) ).string() ! // == fs::initial_path().string() ); ! // BOOST_TEST( fs::complete( fs::path( "c:foo", fs::native ) ).string() ! // == fs::initial_path().string()+"/foo" ); ! BOOST_TEST( fs::complete( fs::path( "c:/", fs::native ) ).string() ! == "c:/" ); ! BOOST_TEST( fs::complete( fs::path( "c:/foo", fs::native ) ).string() ! == "c:/foo" ); ! BOOST_TEST( fs::complete( fs::path( "//share", fs::native ) ).string() ! == "//share" ); ! ! BOOST_TEST( fs::system_complete( fs::path( fs::initial_path().root_name(), ! fs::native ) ).string() == fs::initial_path().string() ); ! BOOST_TEST( fs::system_complete( fs::path( fs::initial_path().root_name() ! + "foo", fs::native ) ).string() == fs::initial_path().string()+"/foo" ); ! BOOST_TEST( fs::system_complete( fs::path( "c:/", fs::native ) ).string() ! == "c:/" ); ! BOOST_TEST( fs::system_complete( fs::path( "c:/foo", fs::native ) ).string() ! == "c:/foo" ); ! BOOST_TEST( fs::system_complete( fs::path( "//share", fs::native ) ).string() ! == "//share" ); ! } ! ! else if ( platform == "POSIX" ) ! { ! BOOST_TEST( fs::system_complete( "" ).empty() ); ! BOOST_TEST( fs::initial_path().root_path().string() == "/" ); ! BOOST_TEST( fs::system_complete( "/" ).string() == "/" ); ! BOOST_TEST( fs::system_complete( "foo" ).string() ! == fs::initial_path().string()+"/foo" ); ! BOOST_TEST( fs::system_complete( "/foo" ).string() ! == fs::initial_path().root_path().string()+"foo" ); ! } ! ! fs::path ng( " no-way, Jose ", fs::native ); fs::remove_all( dir ); // in case residue from prior failed tests *************** *** 86,90 **** // the bound functions should throw, so throws_fs_error() should return true ! BOOST_TEST( throws_fs_error( bind( fs::is_directory, ng ) ) ); BOOST_TEST( throws_fs_error( bind( fs::is_directory, dir ) ) ); BOOST_TEST( throws_fs_error( bind( fs::_is_empty, dir ) ) ); --- 162,166 ---- // the bound functions should throw, so throws_fs_error() should return true ! BOOST_TEST( throws_fs_error( bind( fs::is_directory, ng ), fs::not_found_error ) ); BOOST_TEST( throws_fs_error( bind( fs::is_directory, dir ) ) ); BOOST_TEST( throws_fs_error( bind( fs::_is_empty, dir ) ) ); *************** *** 97,101 **** BOOST_TEST( fs::is_directory( dir ) ); ! fs::path d1( dir << "d1" ); fs::create_directory( d1 ); BOOST_TEST( fs::exists( d1 ) ); --- 173,177 ---- BOOST_TEST( fs::is_directory( dir ) ); ! fs::path d1( dir / "d1" ); fs::create_directory( d1 ); BOOST_TEST( fs::exists( d1 ) ); *************** *** 103,106 **** --- 179,184 ---- BOOST_TEST( fs::_is_empty( d1 ) ); + boost::function_requires< boost::InputIteratorConcept< fs::directory_iterator > >(); + { fs::directory_iterator dir_itr( dir ); *************** *** 109,119 **** // create a second directory named d2 ! fs::path d2( dir << "d2" ); fs::create_directory(d2 ); BOOST_TEST( fs::exists( d2 ) ); BOOST_TEST( fs::is_directory( d2 ) ); // create an empty file named "f0" ! fs::path file_ph( dir << "f0"); create_file( file_ph, "" ); BOOST_TEST( fs::exists( file_ph ) ); --- 187,225 ---- // create a second directory named d2 ! fs::path d2( dir / "d2" ); fs::create_directory(d2 ); BOOST_TEST( fs::exists( d2 ) ); BOOST_TEST( fs::is_directory( d2 ) ); + { + fs::directory_iterator dir_itr( dir ); + BOOST_TEST( dir_itr->leaf() == "d1" || dir_itr->leaf() == "d2" ); + if ( dir_itr->leaf() == "d1" ) + { + BOOST_TEST( (++dir_itr)->leaf() == "d2" ); + } + else + { + BOOST_TEST( (++dir_itr)->leaf() == "d1" ); + } + } + + { // *i++ must work to meet the standard's InputIterator requirements + fs::directory_iterator dir_itr( dir ); + BOOST_TEST( dir_itr->leaf() == "d1" || dir_itr->leaf() == "d2" ); + if ( dir_itr->leaf() == "d1" ) + { + BOOST_TEST( (*dir_itr++).leaf() == "d1" ); + BOOST_TEST( dir_itr->leaf() == "d2" ); + } + else + { + BOOST_TEST( (*dir_itr++).leaf() == "d2" ); + BOOST_TEST( dir_itr->leaf() == "d1" ); + } + } + // create an empty file named "f0" ! fs::path file_ph( dir / "f0"); create_file( file_ph, "" ); BOOST_TEST( fs::exists( file_ph ) ); *************** *** 122,126 **** // create a file named "f1" ! file_ph = dir << "f1"; create_file( file_ph, "foobar1" ); BOOST_TEST( fs::exists( file_ph ) ); --- 228,232 ---- // create a file named "f1" ! file_ph = dir / "f1"; create_file( file_ph, "foobar1" ); BOOST_TEST( fs::exists( file_ph ) ); *************** *** 129,133 **** // there was an inital bug in directory_iterator that caused premature ! // close of an OS handle. The next five lines will detect regression. { fs::directory_iterator di; --- 235,239 ---- // there was an inital bug in directory_iterator that caused premature ! // close of an OS handle. This block will detect regression. { fs::directory_iterator di; *************** *** 137,185 **** // copy_file() tests ! fs::copy_file( file_ph, d1 << "f2" ); BOOST_TEST( fs::exists( file_ph ) ); ! BOOST_TEST( fs::exists( d1 << "f2" ) ); ! BOOST_TEST( !fs::is_directory( d1 << "f2" ) ); ! verify_file( d1 << "f2", "foobar1" ); // rename() on file d1/f2 to d2/f3 ! fs::rename( d1 << "f2", d2 << "f3" ); ! BOOST_TEST( !fs::exists( d1 << "f2" ) ); ! BOOST_TEST( !fs::exists( d2 << "f2" ) ); ! BOOST_TEST( fs::exists( d2 << "f3" ) ); ! BOOST_TEST( !fs::is_directory( d2 << "f3" ) ); ! verify_file( d2 << "f3", "foobar1" ); // make sure can't rename() a non-existent file ! BOOST_TEST( throws_fs_error( bind( fs::rename, d1 << "f2", d2 << "f4" ) ) ); // make sure can't rename() to an existent file ! BOOST_TEST( throws_fs_error( bind( fs::rename, dir << "f1", d2 << "f3" ) ) ); // make sure can't rename() to a nonexistent parent directory ! BOOST_TEST( throws_fs_error( bind( fs::rename, dir << "f1", dir << "d3/f3" ) ) ); // rename() on directory ! fs::path d3( dir << "d3" ); fs::rename( d2, d3 ); BOOST_TEST( !fs::exists( d2 ) ); BOOST_TEST( fs::exists( d3 ) ); BOOST_TEST( fs::is_directory( d3 ) ); ! BOOST_TEST( !fs::exists( d2 << "f3" ) ); ! BOOST_TEST( fs::exists( d3 << "f3" ) ); // remove() tests on file ! file_ph = dir << "shortlife"; BOOST_TEST( !fs::exists( file_ph ) ); create_file( file_ph, "" ); BOOST_TEST( fs::exists( file_ph ) ); BOOST_TEST( !fs::is_directory( file_ph ) ); ! fs::remove( file_ph ); BOOST_TEST( !fs::exists( file_ph ) ); ! fs::remove( "no-such-file" ); // should be harmless ! fs::remove( "no-such-directory/no-such-file" ); // ditto // remove test on directory ! d1 = dir << "shortlife_dir"; BOOST_TEST( !fs::exists( d1 ) ); fs::create_directory( d1 ); --- 243,299 ---- // copy_file() tests ! fs::copy_file( file_ph, d1 / "f2" ); BOOST_TEST( fs::exists( file_ph ) ); ! BOOST_TEST( fs::exists( d1 / "f2" ) ); ! BOOST_TEST( !fs::is_directory( d1 / "f2" ) ); ! verify_file( d1 / "f2", "foobar1" ); // rename() on file d1/f2 to d2/f3 ! fs::rename( d1 / "f2", d2 / "f3" ); ! BOOST_TEST( !fs::exists( d1 / "f2" ) ); ! BOOST_TEST( !fs::exists( d2 / "f2" ) ); ! BOOST_TEST( fs::exists( d2 / "f3" ) ); ! BOOST_TEST( !fs::is_directory( d2 / "f3" ) ); ! verify_file( d2 / "f3", "foobar1" ); // make sure can't rename() a non-existent file ! BOOST_TEST( !fs::exists( d1 / "f2" ) ); ! BOOST_TEST( throws_fs_error( bind( fs::rename, d1 / "f2", d2 / "f4" ), ! fs::not_found_error ) ); // make sure can't rename() to an existent file ! BOOST_TEST( fs::exists( dir / "f1" ) ); ! BOOST_TEST( fs::exists( d2 / "f3" ) ); ! BOOST_TEST( throws_fs_error( bind( fs::rename, dir / "f1", d2 / "f3" ) ) ); ! // several POSIX implementations (cygwin, openBSD) report ENOENT instead of EEXIST, ! // so we don't verify error type on the above test. // make sure can't rename() to a nonexistent parent directory ! BOOST_TEST( throws_fs_error( bind( fs::rename, dir / "f1", dir / "d3/f3" ), ! fs::not_found_error ) ); // rename() on directory ! fs::path d3( dir / "d3" ); ! BOOST_TEST( !fs::exists( d3 ) ); fs::rename( d2, d3 ); BOOST_TEST( !fs::exists( d2 ) ); BOOST_TEST( fs::exists( d3 ) ); BOOST_TEST( fs::is_directory( d3 ) ); ! BOOST_TEST( !fs::exists( d2 / "f3" ) ); ! BOOST_TEST( fs::exists( d3 / "f3" ) ); // remove() tests on file ! file_ph = dir / "shortlife"; BOOST_TEST( !fs::exists( file_ph ) ); create_file( file_ph, "" ); BOOST_TEST( fs::exists( file_ph ) ); BOOST_TEST( !fs::is_directory( file_ph ) ); ! BOOST_TEST( fs::remove( file_ph ) ); BOOST_TEST( !fs::exists( file_ph ) ); ! BOOST_TEST( !fs::remove( "no-such-file" ) ); ! BOOST_TEST( !fs::remove( "no-such-directory/no-such-file" ) ); // remove test on directory ! d1 = dir / "shortlife_dir"; BOOST_TEST( !fs::exists( d1 ) ); fs::create_directory( d1 ); *************** *** 187,192 **** BOOST_TEST( fs::is_directory( d1 ) ); BOOST_TEST( fs::_is_empty( d1 ) ); ! BOOST_TEST( throws_fs_error( bind( fs::remove, dir ) ) ); ! fs::remove( d1 ); BOOST_TEST( !fs::exists( d1 ) ); --- 301,306 ---- BOOST_TEST( fs::is_directory( d1 ) ); BOOST_TEST( fs::_is_empty( d1 ) ); ! BOOST_TEST( throws_fs_error( bind( fs::remove, dir ), fs::not_empty_error ) ); ! BOOST_TEST( fs::remove( d1 ) ); BOOST_TEST( !fs::exists( d1 ) ); Index: path_test.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/test/path_test.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** path_test.cpp 23 Oct 2002 20:23:00 -0000 1.1.1.1 --- path_test.cpp 1 Apr 2003 08:25:54 -0000 1.2 *************** *** 13,16 **** --- 13,18 ---- #include <boost/utility.hpp> #include <iostream> + #include <string> + #include <cstring> #include <cassert> *************** *** 20,25 **** using boost::prior; ! #define BOOST_INCLUDE_MAIN ! #include <boost/test/test_tools.hpp> namespace { --- 22,28 ---- using boost::prior; ! #include <boost/test/minimal.hpp> ! ! #define PATH_CHECK( a, b ) check( a, b, __LINE__ ) namespace { *************** *** 27,37 **** void check( const fs::path & source, ! const std::string & expected ) { ! if ( source.generic_path()== expected ) return; ++errors; ! std::cout << "source.generic_path(): \"" << source.generic_path() << "\" != expected: \"" << expected << "\"" << std::endl; --- 30,40 ---- void check( const fs::path & source, ! const std::string & expected, int line ) { ! if ( source.string()== expected ) return; ++errors; ! std::cout << '(' << line << ") source.string(): \"" << source.string() << "\" != expected: \"" << expected << "\"" << std::endl; *************** *** 57,67 **** int test_main( int, char*[] ) { path p1( "fe/fi/fo/fum" ); path p2( p1 ); path p3; p3 = p2; ! // p1.branch() = p2; // should fail // *p1.begin() = ""; // should fail --- 60,77 ---- int test_main( int, char*[] ) { + std::string platform( BOOST_PLATFORM ); + platform = ( platform == "Win32" || platform == "Win64" || platform == "Cygwin" ) + ? "Windows" + : "POSIX"; + + boost::function_requires< boost::ForwardIteratorConcept< fs::path::iterator > >(); path p1( "fe/fi/fo/fum" ); path p2( p1 ); path p3; + BOOST_TEST( p1.string() != p3.string() ); p3 = p2; ! // p1.branch_path() = p2; // should fail // *p1.begin() = ""; // should fail *************** *** 70,148 **** fs::exists( std::string( "foo" ) ); fs::exists( p1 ); ! fs::exists( "foo" << p1 ); ! fs::exists( std::string( "foo" ) << p1 ); fs::exists( fs::check_posix_leaf( "foo" ) ); ! BOOST_TEST( p1.generic_path() == p2.generic_path() ); ! BOOST_TEST( p1.generic_path() == p3.generic_path() ); BOOST_TEST( path( "foo" ).leaf() == "foo" ); ! BOOST_TEST( path( "foo" ).branch().generic_path() == "" ); BOOST_TEST( p1.leaf() == "fum" ); ! BOOST_TEST( p1.branch().generic_path() == "fe/fi/fo" ); ! BOOST_TEST( path( "" ).is_null() == true ); ! BOOST_TEST( path( "foo" ).is_null() == false ); ! check( "", "" ); ! check( "foo", "foo" ); ! check( path("") << "foo", "foo" ); ! check( path("foo") << "", "foo" ); ! check( "foo/bar", "foo/bar" ); ! check( path("foo") << "bar", "foo/bar" ); ! check( path("foo") << path("bar"), "foo/bar" ); ! check( "foo" << path("bar"), "foo/bar" ); ! check( "a/b", "a/b" ); // probe for length effects ! check( path("a") << "b", "a/b" ); ! check( "..", ".." ); ! check( path("..") << "", ".." ); ! check( path("") << "..", ".." ); ! check( "../..", "../.." ); ! check( path("..") << ".." , "../.." ); ! check( "../foo", "../foo" ); ! check( path("..") << "foo" , "../foo" ); ! check( "foo/..", "" ); ! check( path("foo") << ".." , "" ); ! check( "../f", "../f" ); ! check( path("..") << "f" , "../f" ); ! check( "f/..", "" ); ! check( path("f") << ".." , "" ); ! check( "foo/../..", ".." ); ! check( path("foo") << ".." << ".." , ".." ); ! check( "foo/../../..", "../.." ); ! check( path("foo") << ".." << ".." << ".." , "../.." ); ! check( "foo/../bar", "bar" ); ! check( path("foo") << ".." << "bar" , "bar" ); ! check( "foo/bar/..", "foo" ); ! check( path("foo") << "bar" << ".." , "foo" ); ! check( "foo/bar/../blah", "foo/blah" ); ! check( path("foo") << "bar" << ".." << "blah", "foo/blah" ); ! check( "f/../b", "b" ); ! check( path("f") << ".." << "b" , "b" ); ! check( "f/b/..", "f" ); ! check( path("f") << "b" << ".." , "f" ); ! check( "f/b/../a", "f/a" ); ! check( path("f") << "b" << ".." << "a", "f/a" ); ! check( "foo/bar/blah/../..", "foo" ); ! check( path("foo") << "bar" << "blah" << ".." << "..", "foo" ); ! check( "foo/bar/blah/../../bletch", "foo/bletch" ); ! check( path("foo") << "bar" << "blah" << ".." << ".." << "bletch", "foo/bletch" ); BOOST_TEST( fs::posix_name("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-_") ); --- 80,172 ---- fs::exists( std::string( "foo" ) ); fs::exists( p1 ); ! fs::exists( "foo" / p1 ); ! fs::exists( std::string( "foo" ) / p1 ); fs::exists( fs::check_posix_leaf( "foo" ) ); ! BOOST_TEST( p1.string() == p2.string() ); ! BOOST_TEST( p1.string() == p3.string() ); BOOST_TEST( path( "foo" ).leaf() == "foo" ); ! BOOST_TEST( path( "foo" ).branch_path().string() == "" ); BOOST_TEST( p1.leaf() == "fum" ); ! BOOST_TEST( p1.branch_path().string() == "fe/fi/fo" ); ! BOOST_TEST( path( "" ).empty() == true ); ! BOOST_TEST( path( "foo" ).empty() == false ); ! PATH_CHECK( "", "" ); ! PATH_CHECK( "foo", "foo" ); ! PATH_CHECK( path("") / "foo", "foo" ); ! PATH_CHECK( path("foo") / "", "foo" ); ! PATH_CHECK( path( "/" ), "/" ); ! PATH_CHECK( path( "/" ) / "", "/" ); ! PATH_CHECK( path( "/f" ), "/f" ); ! PATH_CHECK( "/foo", "/foo" ); ! PATH_CHECK( path("") / "/foo", "/foo" ); ! PATH_CHECK( path("/foo") / "", "/foo" ); ! PATH_CHECK( "foo/", "foo" ); ! PATH_CHECK( path("") / "foo/", "foo" ); ! PATH_CHECK( path("foo") / "/", "foo" ); ! PATH_CHECK( "foo/bar", "foo/bar" ); ! PATH_CHECK( path("foo") / "bar", "foo/bar" ); ! PATH_CHECK( path("foo") / path("bar"), "foo/bar" ); ! PATH_CHECK( "foo" / path("bar"), "foo/bar" ); ! PATH_CHECK( "a/b", "a/b" ); // probe for length effects ! PATH_CHECK( path("a") / "b", "a/b" ); ! PATH_CHECK( "..", ".." ); ! PATH_CHECK( path("..") / "", ".." ); ! PATH_CHECK( path("") / "..", ".." ); ! PATH_CHECK( "../..", "../.." ); ! PATH_CHECK( path("..") / ".." , "../.." ); ! PATH_CHECK( "../foo", "../foo" ); ! PATH_CHECK( path("..") / "foo" , "../foo" ); ! PATH_CHECK( "foo/..", "" ); ! PATH_CHECK( path("foo") / ".." , "" ); ! PATH_CHECK( "../f", "../f" ); ! PATH_CHECK( path("..") / "f" , "../f" ); ! PATH_CHECK( "f/..", "" ); ! PATH_CHECK( path("f") / ".." , "" ); ! PATH_CHECK( "foo/../..", ".." ); ! PATH_CHECK( path("foo") / ".." / ".." , ".." ); ! PATH_CHECK( "foo/../../..", "../.." ); ! PATH_CHECK( path("foo") / ".." / ".." / ".." , "../.." ); ! PATH_CHECK( "foo/../bar", "bar" ); ! PATH_CHECK( path("foo") / ".." / "bar" , "bar" ); ! PATH_CHECK( "foo/bar/..", "foo" ); ! PATH_CHECK( path("foo") / "bar" / ".." , "foo" ); ! PATH_CHECK( "foo/bar/../..", "" ); ! PATH_CHECK( path("foo") / "bar" / ".." / "..", "" ); ! PATH_CHECK( "foo/bar/../blah", "foo/blah" ); ! PATH_CHECK( path("foo") / "bar" / ".." / "blah", "foo/blah" ); ! PATH_CHECK( "f/../b", "b" ); ! PATH_CHECK( path("f") / ".." / "b" , "b" ); ! PATH_CHECK( "f/b/..", "f" ); ! PATH_CHECK( path("f") / "b" / ".." , "f" ); ! ! PATH_CHECK( "f/b/../a", "f/a" ); ! PATH_CHECK( path("f") / "b" / ".." / "a", "f/a" ); ! ! PATH_CHECK( "foo/bar/blah/../..", "foo" ); ! PATH_CHECK( path("foo") / "bar" / "blah" / ".." / "..", "foo" ); ! ! PATH_CHECK( "foo/bar/blah/../../bletch", "foo/bletch" ); ! PATH_CHECK( path("foo") / "bar" / "blah" / ".." / ".." / "bletch", "foo/bletch" ); BOOST_TEST( fs::posix_name("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.-_") ); *************** *** 163,170 **** BOOST_TEST( !fs::boost_directory_name("F$O") ); - check_throw( "/" ); check_throw( "...." ); - check_throw( "/foo" ); - check_throw( "foo/" ); check_throw( "foo/...." ); check_throw( "foo//bar" ); --- 187,191 ---- *************** *** 185,191 **** check_throw( "prn:" ); ! path itr_ck( "/foo/bar", fs::system_specific ); path::iterator itr( itr_ck.begin() ); - //std::cout << "\"" << *itr << "\"" << std::endl; BOOST_TEST( *itr == std::string( "/" ) ); BOOST_TEST( *++itr == std::string( "foo" ) ); --- 206,211 ---- check_throw( "prn:" ); ! path itr_ck( "/foo/bar" ); path::iterator itr( itr_ck.begin() ); BOOST_TEST( *itr == std::string( "/" ) ); BOOST_TEST( *++itr == std::string( "foo" ) ); *************** *** 199,203 **** BOOST_TEST( itr_ck.begin() == itr_ck.end() ); ! itr_ck = path( "/", fs::system_specific ); BOOST_TEST( *itr_ck.begin() == std::string( "/" ) ); BOOST_TEST( next(itr_ck.begin()) == itr_ck.end() ); --- 219,223 ---- BOOST_TEST( itr_ck.begin() == itr_ck.end() ); ! itr_ck = path( "/" ); BOOST_TEST( *itr_ck.begin() == std::string( "/" ) ); BOOST_TEST( next(itr_ck.begin()) == itr_ck.end() ); *************** *** 205,209 **** BOOST_TEST( prior(itr_ck.end()) == itr_ck.begin() ); ! itr_ck = path( "/foo", fs::system_specific ); BOOST_TEST( *itr_ck.begin() == std::string( "/" ) ); BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); --- 225,229 ---- BOOST_TEST( prior(itr_ck.end()) == itr_ck.begin() ); ! itr_ck = path( "/foo" ); BOOST_TEST( *itr_ck.begin() == std::string( "/" ) ); BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); *************** *** 220,310 **** BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! # ifdef BOOST_WINDOWS ! itr_ck = path( "c:", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); ! BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); ! BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "c:" ) ); ! itr_ck = path( "c:/", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "c:/" ) ); ! BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); ! BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "c:/" ) ); ! itr_ck = path( "c:foo", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); ! BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); ! BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() ); ! BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); ! BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "c:" ) ); ! itr_ck = path( "c:/foo", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "c:/" ) ); ! BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); ! BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() ); ! BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); ! BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "c:/" ) ); ! itr_ck = path( "//share", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "//share" ) ); ! BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); ! BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "//share" ) ); ! itr_ck = path( "//share/foo", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "//share" ) ); ! BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); ! BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() ); ! BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); ! BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "//share" ) ); ! itr_ck = path( "prn:", fs::system_specific ); ! BOOST_TEST( *itr_ck.begin() == std::string( "prn:" ) ); ! BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); ! BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! BOOST_TEST( *prior( itr_ck.end() ) == std::string( "prn:" ) ); ! check( path( "/", fs::system_specific ), "/" ); ! check( path( "/f", fs::system_specific ), "/f" ); ! check( path( "/foo", fs::system_specific ), "/foo" ); ! check( path( "\\", fs::system_specific ), "/" ); ! check( path( "\\f", fs::system_specific ), "/f" ); ! check( path( "\\foo", fs::system_specific ), "/foo" ); ! check( path( "foo\\bar", fs::system_specific ), "foo/bar" ); ! check( path( "foo bar", fs::system_specific ), "foo bar" ); ! check( path( "c:", fs::system_specific ), "c:" ); ! check( path( "c:/", fs::system_specific ), "c:/" ); ! check( path( "c:foo", fs::system_specific ), "c:foo" ); ! check( path( "c:/foo", fs::system_specific ), "c:/foo" ); ! check( path( "//share", fs::system_specific ), "//share" ); ! check( path( "//share/foo", fs::system_specific ), "//share/foo" ); ! check( path( "\\\\share", fs::system_specific ), "//share" ); ! check( path( "\\\\share\\foo", fs::system_specific ), "//share/foo" ); ! check( path( "c:/foo", fs::system_specific ), "c:/foo" ); ! check( path( "prn:", fs::system_specific ), "prn:" ); ! BOOST_TEST( path( "/", fs::system_specific ).leaf() == "/" ); ! BOOST_TEST( path( "c:", fs::system_specific ).leaf() == "c:" ); ! BOOST_TEST( path( "c:/", fs::system_specific ).leaf() == "c:/" ); ! BOOST_TEST( path( "c:foo", fs::system_specific ).leaf() == "foo" ); ! BOOST_TEST( path( "c:/foo", fs::system_specific ).leaf() == "foo" ); ! BOOST_TEST( path( "//share", fs::system_specific ).leaf() == "//share" ); ! BOOST_TEST( path( "//share/foo", fs::system_specific ).leaf() == "foo" ); ! BOOST_TEST( path( "/", fs::system_specific ).branch().generic_path() == "" ); ! BOOST_TEST( path( "c:", fs::system_specific ).branch().generic_path() == "" ); ! BOOST_TEST( path( "c:/", fs::system_specific ).branch().generic_path() == "" ); ! BOOST_TEST( path( "c:foo", fs::system_specific ).branch().generic_path() == "c:" ); ! BOOST_TEST( path( "c:/foo", fs::system_specific ).branch().generic_path() == "c:/" ); ! BOOST_TEST( path( "//share", fs::system_specific ).branch().generic_path() == "" ); ! BOOST_TEST( path( "//share/foo", fs::system_specific ).branch().generic_path() == "//share" ); ! # endif // BOOST_WINDOWS // std::cout << errors << " errors detected\n"; --- 240,549 ---- BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); ! path p; ! p = ""; ! BOOST_TEST( p.relative_path().string() == "" ); ! BOOST_TEST( p.branch_path().string() == "" ); ! BOOST_TEST( p.leaf() == "" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "" ); ! BOOST_TEST( p.root_path().string() == "" ); ! BOOST_TEST( !p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( !p.has_root_directory() ); ! BOOST_TEST( !p.has_relative_path() ); ! BOOST_TEST( !p.has_leaf() ); ! BOOST_TEST( !p.has_branch_path() ); ! BOOST_TEST( !p.is_complete() ); ! p = "/"; ! BOOST_TEST( p.relative_path().string() == "" ); ! BOOST_TEST( p.branch_path().string() == "" ); ! BOOST_TEST( p.leaf() == "/" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "/" ); ! BOOST_TEST( p.root_path().string() == "/" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( p.has_root_directory() ); ! BOOST_TEST( !p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( !p.has_branch_path() ); ! if ( platform == "POSIX" ) ! BOOST_TEST( p.is_complete() ); ! else ! BOOST_TEST( !p.is_complete() ); ! p = "foo"; ! BOOST_TEST( p.relative_path().string() == "foo" ); ! BOOST_TEST( p.branch_path().string() == "" ); ! BOOST_TEST( p.leaf() == "foo" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "" ); ! BOOST_TEST( p.root_path().string() == "" ); ! BOOST_TEST( !p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( !p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( !p.has_branch_path() ); ! BOOST_TEST( !p.is_complete() ); ! p = "/foo"; ! BOOST_TEST( p.relative_path().string() == "foo" ); ! BOOST_TEST( p.branch_path().string() == "/" ); ! BOOST_TEST( p.leaf() == "foo" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "/" ); ! BOOST_TEST( p.root_path().string() == "/" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! if ( platform == "POSIX" ) ! BOOST_TEST( p.is_complete() ); ! else ! BOOST_TEST( !p.is_complete() ); ! p = "foo/bar"; ! BOOST_TEST( p.relative_path().string() == "foo/bar" ); ! BOOST_TEST( p.branch_path().string() == "foo" ); ! BOOST_TEST( p.leaf() == "bar" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "" ); ! BOOST_TEST( p.root_path().string() == "" ); ! BOOST_TEST( !p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( !p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! BOOST_TEST( !p.is_complete() ); ! p = "/foo/bar"; ! BOOST_TEST( p.relative_path().string() == "foo/bar" ); ! BOOST_TEST( p.branch_path().string() == "/foo" ); ! BOOST_TEST( p.leaf() == "bar" ); ! BOOST_TEST( p.root_name() == "" ); ! BOOST_TEST( p.root_directory() == "/" ); ! BOOST_TEST( p.root_path().string() == "/" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( !p.has_root_name() ); ! BOOST_TEST( p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! if ( platform == "POSIX" ) ! BOOST_TEST( p.is_complete() ); ! else ! BOOST_TEST( !p.is_complete() ); ! if ( platform == "Windows" ) ! { ! PATH_CHECK( path( "\\", fs::native ), "/" ); ! PATH_CHECK( path( "\\f", fs::native ), "/f" ); ! PATH_CHECK( path( "\\foo", fs::native ), "/foo" ); ! PATH_CHECK( path( "foo\\bar", fs::native ), "foo/bar" ); ! PATH_CHECK( path( "foo bar", fs::native ), "foo bar" ); ! PATH_CHECK( path( "c:", fs::native ), "c:" ); ! PATH_CHECK( path( "c:/", fs::native ), "c:/" ); ! PATH_CHECK( path( "c:foo", fs::native ), "c:foo" ); ! PATH_CHECK( path( "c:/foo", fs::native ), "c:/foo" ); ! PATH_CHECK( path( "//share", fs::native ), "//share" ); ! PATH_CHECK( path( "//share/", fs::native ), "//share/" ); ! PATH_CHECK( path( "//share/foo", fs::native ), "//share/foo" ); ! PATH_CHECK( path( "\\\\share", fs::native ), "//share" ); ! PATH_CHECK( path( "\\\\share\\", fs::native ), "//share/" ); ! PATH_CHECK( path( "\\\\share\\foo", fs::native ), "//share/foo" ); ! PATH_CHECK( path( "c:/foo", fs::native ), "c:/foo" ); ! PATH_CHECK( path( "prn:", fs::native ), "prn:" ); ! p = path( "c:", fs::native ); ! BOOST_TEST( p.relative_path().string() == "" ); ! BOOST_TEST( p.branch_path().string() == "" ); ! BOOST_TEST( p.leaf() == "c:" ); ! BOOST_TEST( p.root_name() == "c:" ); ! BOOST_TEST( p.root_directory() == "" ); ! BOOST_TEST( p.root_path().string() == "c:" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( p.has_root_name() ); ! BOOST_TEST( !p.has_root_directory() ); ! BOOST_TEST( !p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( !p.has_branch_path() ); ! BOOST_TEST( !p.is_complete() ); ! p = path( "c:foo", fs::native ); ! BOOST_TEST( p.relative_path().string() == "foo" ); ! BOOST_TEST( p.branch_path().string() == "c:" ); ! BOOST_TEST( p.leaf() == "foo" ); ! BOOST_TEST( p.root_name() == "c:" ); ! BOOST_TEST( p.root_directory() == "" ); ! BOOST_TEST( p.root_path().string() == "c:" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( p.has_root_name() ); ! BOOST_TEST( !p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! BOOST_TEST( !p.is_complete() ); ! ! p = path( "c:/", fs::native ); ! BOOST_TEST( p.relative_path().string() == "" ); ! BOOST_TEST( p.branch_path().string() == "c:" ); ! BOOST_TEST( p.leaf() == "/" ); ! BOOST_TEST( p.root_name() == "c:" ); ! BOOST_TEST( p.root_directory() == "/" ); ! BOOST_TEST( p.root_path().string() == "c:/" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( p.has_root_name() ); ! BOOST_TEST( p.has_root_directory() ); ! BOOST_TEST( !p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! BOOST_TEST( p.is_complete() ); ! p = path( "c:/foo", fs::native ); ! BOOST_TEST( p.relative_path().string() == "foo" ); ! BOOST_TEST( p.branch_path().string() == "c:/" ); ! BOOST_TEST( p.leaf() == "foo" ); ! BOOST_TEST( p.root_name() == "c:" ); ! BOOST_TEST( p.root_directory() == "/" ); ! BOOST_TEST( p.root_path().string() == "c:/" ); ! BOOST_TEST( p.has_root_path() ); ! BOOST_TEST( p.has_root_name() ); ! BOOST_TEST( p.has_root_directory() ); ! BOOST_TEST( p.has_relative_path() ); ! BOOST_TEST( p.has_leaf() ); ! BOOST_TEST( p.has_branch_path() ); ! BOOST_TEST( p.is_complete() ); ! /* Commented out until the semantics of //share are clearer. + p = path( "//share", fs::native ); + BOOST_TEST( p.string() == "//share" ); + BOOST_TEST( p.relative_path().string() == "" ); + BOOST_TEST( p.branch_path().string() == "" ); + BOOST_TEST( p.leaf() == "//share" ); + BOOST_TEST( p.root_name() == "//share" ); + BOOST_TEST( p.root_directory() == "/" ); + BOOST_TEST( p.root_path().string() == "//share/" ); + BOOST_TEST( p.has_root_path() ); + BOOST_TEST( p.has_root_name() ); + BOOST_TEST( !p.has_root_directory() ); + BOOST_TEST( !p.has_relative_path() ); + BOOST_TEST( p.has_leaf() ); + BOOST_TEST( !p.has_branch_path() ); + BOOST_TEST( !p.is_complete() ); + */ + p = path( "//share/", fs::native ); + BOOST_TEST( p.relative_path().string() == "" ); + BOOST_TEST( p.branch_path().string() == "//share" ); + BOOST_TEST( p.leaf() == "/" ); + BOOST_TEST( p.root_name() == "//share" ); + BOOST_TEST( p.root_directory() == "/" ); + BOOST_TEST( p.root_path().string() == "//share/" ); + BOOST_TEST( p.has_root_path() ); + BOOST_TEST( p.has_root_name() ); + BOOST_TEST( p.has_root_directory() ); + BOOST_TEST( !p.has_relative_path() ); + BOOST_TEST( p.has_leaf() ); + BOOST_TEST( p.has_branch_path() ); + BOOST_TEST( p.is_complete() ); + + p = path( "//share/foo", fs::native ); + BOOST_TEST( p.relative_path().string() == "foo" ); + BOOST_TEST( p.branch_path().string() == "//share/" ); + BOOST_TEST( p.leaf() == "foo" ); + BOOST_TEST( p.root_name() == "//share" ); + BOOST_TEST( p.root_directory() == "/" ); + BOOST_TEST( p.root_path().string() == "//share/" ); + BOOST_TEST( p.has_root_path() ); + BOOST_TEST( p.has_root_name() ); + BOOST_TEST( p.has_root_directory() ); + BOOST_TEST( p.has_relative_path() ); + BOOST_TEST( p.has_leaf() ); + BOOST_TEST( p.has_branch_path() ); + BOOST_TEST( p.is_complete() ); + + p = path( "prn:", fs::native ); + BOOST_TEST( p.relative_path().string() == "" ); + BOOST_TEST( p.branch_path().string() == "" ); + BOOST_TEST( p.leaf() == "prn:" ); + BOOST_TEST( p.root_name() == "prn:" ); + BOOST_TEST( p.root_directory() == "" ); + BOOST_TEST( p.root_path().string() == "prn:" ); + BOOST_TEST( p.has_root_path() ); + BOOST_TEST( p.has_root_name() ); + BOOST_TEST( !p.has_root_directory() ); + BOOST_TEST( !p.has_relative_path() ); + BOOST_TEST( p.has_leaf() ); + BOOST_TEST( !p.has_branch_path() ); + BOOST_TEST( p.is_complete() ); + + itr_ck = path( "c:", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); + BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); + BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "c:" ) ); + + itr_ck = path( "c:/", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); + BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) ); + BOOST_TEST( next( next( itr_ck.begin() )) == itr_ck.end() ); + BOOST_TEST( prior( prior( itr_ck.end() )) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "/" ) ); + BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "c:" ) ); + + itr_ck = path( "c:foo", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); + BOOST_TEST( *next( itr_ck.begin() ) == std::string( "foo" ) ); + BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() ); + BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); + BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "c:" ) ); + + itr_ck = path( "c:/foo", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "c:" ) ); + BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) ); + BOOST_TEST( *next( next( itr_ck.begin() )) == std::string( "foo" ) ); + BOOST_TEST( next( next( next( itr_ck.begin() ))) == itr_ck.end() ); + BOOST_TEST( prior( prior( prior( itr_ck.end() ))) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); + BOOST_TEST( *prior( prior( itr_ck.end() )) == std::string( "/" ) ); + BOOST_TEST( *prior( prior( prior( itr_ck.end() ))) == std::string( "c:" ) ); + + itr_ck = path( "//share", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "//share" ) ); + BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); + BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "//share" ) ); + + itr_ck = path( "//share/", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "//share" ) ); + BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) ); + BOOST_TEST( next(next( itr_ck.begin() )) == itr_ck.end() ); + BOOST_TEST( prior(prior( itr_ck.end() )) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "/" ) ); + BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "//share" ) ); + + itr_ck = path( "//share/foo", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "//share" ) ); + BOOST_TEST( *next( itr_ck.begin() ) == std::string( "/" ) ); + BOOST_TEST( *next(next( itr_ck.begin() )) == std::string( "foo" ) ); + BOOST_TEST( next(next(next( itr_ck.begin() ))) == itr_ck.end() ); + BOOST_TEST( prior(prior(prior( itr_ck.end() ))) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "foo" ) ); + BOOST_TEST( *prior(prior( itr_ck.end() )) == std::string( "/" ) ); + BOOST_TEST( *prior(prior(prior( itr_ck.end() ))) == std::string( "//share" ) ); + + itr_ck = path( "prn:", fs::native ); + BOOST_TEST( *itr_ck.begin() == std::string( "prn:" ) ); + BOOST_TEST( next( itr_ck.begin() ) == itr_ck.end() ); + BOOST_TEST( prior( itr_ck.end() ) == itr_ck.begin() ); + BOOST_TEST( *prior( itr_ck.end() ) == std::string( "prn:" ) ); + } // std::cout << errors << " errors detected\n"; |
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc In directory sc8-pr-cvs1:/tmp/cvs-serv17363/deplib/boostcvs/libs/filesystem/doc Modified Files: design.htm do-list.htm exception.htm faq.htm index.htm operations.htm path.htm Log Message: * upgraded to the official boost 1.30 Index: design.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/design.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** design.htm 23 Oct 2002 20:22:45 -0000 1.1.1.1 --- design.htm 1 Apr 2003 08:25:45 -0000 1.2 *************** *** 19,23 **** <a href="#Realities">Realities</a><br> <a href="#Rationale">Rationale</a><br> ! <a href="#Abandoned Designs">Abandoned Designs</a><br> <a href="#References">References</a></p> --- 19,23 ---- <a href="#Realities">Realities</a><br> <a href="#Rationale">Rationale</a><br> ! <a href="#Abandoned_Designs">Abandoned_Designs</a><br> <a href="#References">References</a></p> *************** *** 112,119 **** exist.<br> <br> ! Rationale: Defining important behavior unspecified or "implementation defined" does a great disservice to programmers using a library because it makes it appear that code relying on the behavior is portable, when in fact there is nothing ! at all portable about it. The only case where such under-specification is acceptable is when both users and implementors know from other sources exactly what behavior is required, yet for some reason it isn't possible to specify it exactly.</li> --- 112,119 ---- exist.<br> <br> ! Rationale: Leaving important behavior unspecified or "implementation defined" does a great disservice to programmers using a library because it makes it appear that code relying on the behavior is portable, when in fact there is nothing ! portable about it. The only case where such under-specification is acceptable is when both users and implementors know from other sources exactly what behavior is required, yet for some reason it isn't possible to specify it exactly.</li> *************** *** 121,125 **** <h2><a name="Realities">Realities</a></h2> <ul> ! <li>Some file systems are single rooted, others are multi-rooted.<br> </li> <li>Some file systems provide both a long and short form of filenames.<br> --- 121,126 ---- <h2><a name="Realities">Realities</a></h2> <ul> ! <li>Some operating systems have a single directory tree root, others have ! multiple roots.<br> </li> <li>Some file systems provide both a long and short form of filenames.<br> *************** *** 134,138 **** (so-called 8.3) file names.<br> </li> ! <li>Some file systems allow other file systems with different characteristics to be "mounted" within a directory tree. Thus a ISO-9660 or Windows --- 135,139 ---- (so-called 8.3) file names.<br> </li> ! <li>Some operating systems allow file systems with different characteristics to be "mounted" within a directory tree. Thus a ISO-9660 or Windows *************** *** 148,152 **** number". Some don't.<br> </li> ! <li>Not all file systems use single character separators in path names. Some use paired notations. A typical fully-specified OpenVMS filename might look something like this:<br> --- 149,153 ---- number". Some don't.<br> </li> ! <li>Not all operating systems use single character separators in path names. Some use paired notations. A typical fully-specified OpenVMS filename might look something like this:<br> *************** *** 198,202 **** <p>Several key insights went into the <i>path</i> class design:</p> <ul> ! <li>Decoupling the input formats, internal conceptual (<i>vector<string></i> or other sequence) model, and output formats.</li> --- 199,203 ---- <p>Several key insights went into the <i>path</i> class design:</p> <ul> ! <li>Decoupling of the input formats, internal conceptual (<i>vector<string></i> or other sequence) model, and output formats.</li> *************** *** 205,208 **** --- 206,212 ---- <li>Providing several output formats solved another set of previously intractable problems.</li> + <li>Several non-obvious functions (particularly decomposition and composition) + are required to support portable code. (Peter Dimov, Thomas Witt, Glen + Knowles, others.)</li> </ul> *************** *** 213,217 **** answers to that question, the Filesystem Library alerts programmers of the need to ask it in the first place.</p> ! <h2><a name="Abandoned Designs">Abandoned Designs</a></h2> <h3>operations.hpp</h3> <p>Dietmar Kühl's original dir_it design and implementation supported --- 217,221 ---- answers to that question, the Filesystem Library alerts programmers of the need to ask it in the first place.</p> ! <h2><a name="Abandoned_Designs">Abandoned Designs</a></h2> <h3>operations.hpp</h3> <p>Dietmar Kühl's original dir_it design and implementation supported *************** *** 219,223 **** discussions among Library Working Group members failed to identify portable semantics for wide-character names on systems not providing native support. See ! <a href="faq.htm#wide-character names">FAQ</a>.</p> <p>Previous iterations of the interface design used explicitly named functions providing a large number of convenience operations, with no compile-time or run-time --- 223,227 ---- discussions among Library Working Group members failed to identify portable semantics for wide-character names on systems not providing native support. See ! <a href="faq.htm#wide-character_names">FAQ</a>.</p> <p>Previous iterations of the interface design used explicitly named functions providing a large number of convenience operations, with no compile-time or run-time *************** *** 234,241 **** permissive, prune, recurse, and other options, plus predicate, and possibly other, filtering features) were abandoned because the details became both ! complex and contentious. What is left is a toolkit of low-level operations from ! which the user can create more complex convenience operations, plus a very small ! number of convenience functions which were found to be useful enough to justify ! inclusion.</p> <h3>path.hpp</h3> --- 238,246 ---- permissive, prune, recurse, and other options, plus predicate, and possibly other, filtering features) were abandoned because the details became both ! complex and contentious.</p> ! ! <p>What is left is a toolkit of low-level operations from which the user can ! create more complex convenience operations, plus a very small number of ! convenience functions which were found to be useful enough to justify inclusion.</p> <h3>path.hpp</h3> *************** *** 274,281 **** <p>[<a name="ISO-9660">ISO-9660</a>] International Standards Organization, 1988.</p> ! <p>[<a name="POSIX-01">POSIX-01</a>] Open Group, <i>IEEE Std 1003.1-2001 [AKA ! POSIX]</i>, 2001, ! <a href="http://www.opengroup.org/onlinepubs/007904975/toc.htm"> ! http://www.opengroup.org/onlinepubs/007904975/toc.htm</a></p> <p>[<a name="Wulf-Shaw-73">Wulf-Shaw-73</a>] William Wulf, Mary Shaw, <i>Global --- 279,292 ---- <p>[<a name="ISO-9660">ISO-9660</a>] International Standards Organization, 1988.</p> ! <p>[<a name="MSDN">MSDN</a>] Microsoft Platform SDK for Windows, Storage Start ! Page, ! <a href="http://msdn.microsoft.com/library/en-us/fileio/base/storage_start_page.asp"> ! http://msdn.microsoft.com/library/en-us/fileio/base/storage_start_page.asp</a></p> ! ! <p>[<a name="POSIX-01">POSIX-01</a>] IEEE Std 1003.1-2001/ISO/IEC 9945:2002 , ! <a href="http://www.unix-systems.org/version3/"> ! http://www.unix-systems.org/version3/</a>. The ISO JTC1/SC22/WG15 - POSIX ! homepage is <a href="http://std.dkuug.dk/JTC1/SC22/WG15/"> ! http://std.dkuug.dk/JTC1/SC22/WG15/</a>.</p> <p>[<a name="Wulf-Shaw-73">Wulf-Shaw-73</a>] William Wulf, Mary Shaw, <i>Global *************** *** 285,289 **** <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->13 September, 2002<!--webbot bot="Timestamp" endspan i-checksum="39336" --></p> </body> --- 296,300 ---- <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->28 January, 2003<!--webbot bot="Timestamp" endspan i-checksum="38582" --></p> </body> Index: do-list.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/do-list.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** do-list.htm 23 Oct 2002 20:22:45 -0000 1.1.1.1 --- do-list.htm 1 Apr 2003 08:25:45 -0000 1.2 *************** *** 4,31 **** Do-list</h1> <ul> ! <li>Finish the probe program, and ask Boost people to run it on various O/S's.<br> </li> ! <li>Finish portability guide and checking functions. Get opinions on default, Boost, and other error checks. POSIX? ! Windows? Mac? ISO 6990?<br> </li> ! <li>Cyclic paths:</li> </ul> - <blockquote> - <ul> - <li>General requirements.</li> - <li>Add cycle-breaking code if needed.</li> - <li>Add test case to make sure functions like <i>remove_all</i> don't loop.</li> - </ul> - </blockquote> <ul> ! <li>As a lexical concept, parent-directory is portable unless it escapes to ! the operating system. But do all operating recognize such a concept in a path? ! I doubt it. Maybe there should be a checking function that verifies that ! generic_path() contains no <code>".."</code>.<br> </li> - <li>Once the review is complete, ask for help porting to the Mac, etc.</li> </ul> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->13 September, 2002<!--webbot bot="Timestamp" endspan i-checksum="39336" --></p> \ No newline at end of file --- 4,46 ---- Do-list</h1> <ul> ! <li>Windows: Some files seem to be poisoned to the point where you can't even ! do is_directory() on them without an access error. For example, pagefile.sys. Should directory_iterator ignore these files?<br> </li> ! <li>Windows: //share style paths need more analysis and test cases for system_complete() ! and complete(). Also, path_test cases at line 410 need review, correction.<br> </li> ! <li>Replace filesystem_error impl with shared_ptr. (Dave Abrahams).<br> ! </li> ! <li>Consider changing who() ! interface (and ctors to const char *).<br> ! </li> ! <li>Add a path::swap member function guaranteed not to throw. (Geurt Vos).<br> ! </li> ! <li>Windows: What happens when a directory_itorator encounters a ! wide-character filename? Write a test case.</li> </ul> <ul> ! <li>Add "." current directory to generic path? Add test cases one ! way or the other. Change simple_ls accordingly.<br> ! </li> ! <li>Ask for help porting to other operating systems, such as the Mac, etc.</li> ! </ul> ! <ul> ! <li>Finish the probe program, and ask Boost people to run it on various O/S's.<br> ! </li> ! <li>Finish portability guide and checking functions. Get opinions on default, Boost, and other error checks. POSIX? ! Windows? Mac? ISO 6990? Document the checking functions.<br> ! </li> ! <li>Operations_test line 171 - why only check iterator tag? Why not ! Assignable, etc?<br> ! </li> ! <li>The wrapped fstream functions which return the type of the stream (*this) ! would have to be overridden to get the wrapped type (boost::filesystem::ifstream ! rather than std::ifstream, for example). But does it matter? Does anyone care? ! Will any programs fail?<br> </li> </ul> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->17 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28843" --></p> \ No newline at end of file Index: exception.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/exception.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** exception.htm 23 Oct 2002 20:22:45 -0000 1.1.1.1 --- exception.htm 1 Apr 2003 08:25:45 -0000 1.2 *************** *** 14,17 **** --- 14,22 ---- <img border="0" src="../../../c++boost.gif" align="center" width="277" height="86"><a href="../../../boost/filesystem/exception.hpp">boost/filesystem/exception.hpp</a></h1> + <p><a href="#Introduction">Introduction</a><br> + <a href="#Synopsis">Synopsis</a><br> + <a href="#Members">Member functions</a><br> + <a href="#Acknowledgements">Acknowledgements</a></p> + <h2><a name="Introduction">Introduction</a></h2> *************** *** 20,29 **** report operational errors.</p> ! <p>There isn't any HTML documentation available yet. The header itself, <a href="../../../boost/filesystem/exception.hpp">boost/filesystem/exception.hpp</a>, ! contains comments as to the specifications for important member functions.</p> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->11 July, 2002<!--webbot bot="Timestamp" endspan i-checksum="21079" --></p> </body> --- 25,164 ---- report operational errors.</p> ! <p>The design evolved based on user requests to ease portability and ! internationalization.</p> ! ! <h2><a name="Synopsis">Synopsis</a></h2> ! <pre>namespace boost ! { ! namespace filesystem ! { ! enum <a name="error_code">error_code</a> ! { ! 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: ! ! <a href="#Constructors">filesystem_error</a>( const std::string & who, ! const std::string & message ); ! ! <a href="#Constructors">filesystem_error</a>( const std::string & who, ! const path & path1, const std::string & message ); ! ! <a href="#Constructors">filesystem_error</a>( const std::string & who, ! const path & path1, <i>sys_err</i> sys_err_code ); ! ! <a href="#Constructors">filesystem_error</a>( const std::string & who, ! const path & path1, const path & path2, ! <i>sys_err</i> sys_err_code ); ! ! ~filesystem_error() throw(); ! ! <i>sys_err</i> <a href="#native_error">native_error</a>() const; ! error_code <a href="#error">error</a>() const; ! const std::string & <a href="#who">who</a>() const; ! const path & <a href="#path1">path1</a>() const; ! const path & <a href="#path2">path2</a>() const; ! }; ! } // namespace filesystem ! } // namespace boost ! </pre> ! ! <p>For POSIX and Windows, <i><code>sys_err</code></i> is <code>int</code>. For ! other operating systems, it is implementation defined.</p> ! ! <h2><a name="Members">Member functions</a></h2> ! ! <h3><a name="Constructors">Constructors</a></h3> ! <blockquote> ! <pre>filesystem_error( const std::string & who, ! const std::string & message ); ! ! filesystem_error( const std::string & who, ! const path & path1, const std::string & message ); ! ! 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 );</pre> ! <p><b>Precondition:</b> The <code>who</code> argument is in the form, as ! appropriate:</p> ! <ul> ! <li>boost::filesystem::class-name::function-name for errors from public ! member functions</li> ! <li>boost::filesystem::class-name for errors not identified with a ! particular member function.</li> ! <li>boost::filesystem::function-name for errors from non-member functions.</li> ! </ul> ! <p>These forms are explicitly specified to ensure portability of user programs ! between library implementations. </p> ! <p><b>Effects:</b> Constructs a <i>filesystem_error</i> object.</p> ! </blockquote> ! <h3><a name="native_error">native_error</a></h3> ! <blockquote> ! <p><i><code>sys_err</code></i><code> native_error() const;</code></p> ! <p><b>Returns:</b> The <code>sys_err_code</code> argument to the constructor, ! if any. Otherwise, 0.</p> ! </blockquote> ! <h3><a name="error">error</a></h3> ! <blockquote> ! <pre>error_code error() const;</pre> ! <p><b>Returns:</b> <code>native_error()</code> translated to <code> ! <a href="#error_code">error_code</a></code>. The translation is ! implementation-defined. For the POSIX and Windows implementations, see ! <a href="../src/exception.cpp">libs/filesystem/src/exception.cpp</a>.</p> ! </blockquote> ! ! <h3><a name="who">who</a></h3> ! <blockquote> ! <pre>const std::string & who() const;</pre> ! ! <p><b>Returns:</b> The <code>who</code> argument to the constructor.</p> ! </blockquote> ! ! <h3><a name="path1">path1</a></h3> ! <blockquote> ! <pre>const path & path1() const;</pre> ! ! <p><b>Returns:</b> The <code>path1</code> argument to the constructor, if any, ! otherwise <code>path()</code>.</p> ! </blockquote> ! ! <h3><a name="path2">path2</a></h3> ! <blockquote> ! <pre>const path & path2() const;</pre> ! ! <p><b>Returns:</b> The <code>path2</code> argument to the constructor, if any, ! otherwise <code>path()</code>.</p> ! </blockquote> ! ! <h2><a name="Acknowledgements">Acknowledgements</a></h2> ! ! <p>Peter Dimov patently identified requirements for portability and ! internationalization of error messages. </p> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->02 January, 2003<!--webbot bot="Timestamp" endspan i-checksum="38568" --></p> </body> Index: faq.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/faq.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** faq.htm 23 Oct 2002 20:22:46 -0000 1.1.1.1 --- faq.htm 1 Apr 2003 08:25:46 -0000 1.2 *************** *** 5,16 **** <img border="0" src="../../../c++boost.gif" align="center" width="277" height="86">Filesystem FAQ</h1> ! <p><b>Why not use a URI (Universal Resource Identifier) based path?</b></p> ! <p>URI's would promise more than the Filesystem Library can actually deliver, ! since URI's extend far beyond what most operating systems consider a file or a ! directory. Thus for the primary "portable script-style file system ! operations" requirement of the Filesystem Library, full URI's appear to be over-specification.</p> ! <p><b>Why base the generic-path string format on POSIX?<br> ! <br> ! </b>POSIX is the basis for the most familiar path-string formats, including the URL portion of URI's and the native Windows format. It is ubiquitous and familiar. On many systems, it is very easy to implement because it is --- 5,10 ---- <img border="0" src="../../../c++boost.gif" align="center" width="277" height="86">Filesystem FAQ</h1> ! <p><b>Why base the generic-path string format on POSIX?</b></p> ! <p>POSIX is the basis for the most familiar path-string formats, including the URL portion of URI's and the native Windows format. It is ubiquitous and familiar. On many systems, it is very easy to implement because it is *************** *** 18,21 **** --- 12,20 ---- operating system supplied POSIX library (z/OS, OS/390, and many more.)</p> + <p><b>Why not use a full URI (Universal Resource Identifier) based path?</b></p> + <p>URI's would promise more than the Filesystem Library can actually deliver, + since URI's extend far beyond what most operating systems consider a file or a + directory. Thus for the primary "portable script-style file system + operations" requirement of the Filesystem Library, full URI's appear to be over-specification.</p> <p><b>Why isn't <i>path</i> a base class with derived <i>directory_path</i> and <i>file_path</i> classes?</b></p> *************** *** 24,35 **** directory path, and this seemed to increase errors and decrease code readability. There was no apparent upside benefit. </p> ! <p><b>Why not support a concept of specific kinds file systems, such as ! posix_file_system or windows_file_system.</b></p> <p>Portability is one of the one or two most important requirements for the ! library. Gaining some advantage by using features specific to particular ! operating systems is not a requirement.</p> <p>Furthermore, concepts like "posix_file_system" are very slippery. What happens when a NTFS or ISO 9660 file system is mounted ! in directory on a machine running the POSIX operating system, for example?</p> <p><b>Why not supply a 'handle' type, and let the file and directory operations traffic in it?</b></p> --- 23,44 ---- directory path, and this seemed to increase errors and decrease code readability. There was no apparent upside benefit. </p> ! <p><b>Why do some function names have a "native_" prefix?</b></p> ! <p>To alert users that the results are inherently non-portable. The names are ! deliberately ugly to discourage use except where really necessary.</p> ! <p><b>Why doesn't path supply operator== and other comparison operators?</b></p> ! <p>There is no way to know if two <i>path</i> objects actually represent the ! same path. For example, <i>path("/foo")</i> and <i>path("../foo")</i> may ! represent the same path, even though they are textually different. If exact ! textual comparison is desired, <i> ! path::string()'s</i> can be used.</p> ! <p><b>Why not support a concept of specific kinds of file systems, such as posix_file_system or windows_file_system.</b></p> <p>Portability is one of the one or two most important requirements for the ! library. Gaining some advantage by using features specific to particular ! operating systems is not a requirement. There doesn't appear to be much need for ! the ability to manipulate, say, a classic Mac OS path while running on an ! OpenVMS machine.</p> <p>Furthermore, concepts like "posix_file_system" are very slippery. What happens when a NTFS or ISO 9660 file system is mounted ! in directory on a machine running a POSIX-like operating system, for example?</p> <p><b>Why not supply a 'handle' type, and let the file and directory operations traffic in it?</b></p> *************** *** 122,130 **** <p>Global variables are considered harmful [<a href="design.htm#Wulf-Shaw-73">wulf-shaw-73</a>]. While we can't prevent people from shooting themselves in the foot, we aren't ! about to hand them the gun.</p> <p><b>Why aren't there query functions for compound conditions like existing_directory?</b></p> <p>After several attempts, named queries for multi-attribute proved a slippery-slope; where do you stop?</p> ! <p><b>Why aren't <a name="wide-character names">wide-character names</a> supported? Why not std::wstring or even a templated type?</b></p> <p>Wide-character names would provide an illusion of portability where --- 131,139 ---- <p>Global variables are considered harmful [<a href="design.htm#Wulf-Shaw-73">wulf-shaw-73</a>]. While we can't prevent people from shooting themselves in the foot, we aren't ! about to hand them a loaded gun pointed right at their big toe.</p> <p><b>Why aren't there query functions for compound conditions like existing_directory?</b></p> <p>After several attempts, named queries for multi-attribute proved a slippery-slope; where do you stop?</p> ! <p><b>Why aren't <a name="wide-character_names">wide-character names</a> supported? Why not std::wstring or even a templated type?</b></p> <p>Wide-character names would provide an illusion of portability where *************** *** 142,145 **** --- 151,156 ---- (3) even the committee members most interested in wide-character names are unsure that they are a good idea in the context of a portable library.</p> + <p>[October, 2002 - PJ Plauger has suggested a locale based conversion + scheme. Others have indicated support for such an experiment.]</p> <p><b>Why aren't file and directory name portability errors detected automatically, rather than by separate function calls?</b></p> *************** *** 152,178 **** <p>A number (at least six) of designs for automatic name validity error detection were evaluated, including at least four complete implementations. ! While the details for rejection differed, they all tended to distort the otherwise simple design of the rest of the library.</p> ! <p><b>Why doesn't the generic path grammar include syntax for portably ! specifying the root directory?</b></p> ! <p>The concept of "root directory" appears to be inherently non-portable. ! For example, "/" means one thing on POSIX (an absolute path the single ! filesystem root), and another on Windows (a relative path to the root of the ! current drive). It goes rapidly downhill from there; on the classic Mac ! OS, root names can be ambiguous!</p> ! <p><b>Why isn't there a path::is_absolute() or similar function?</b></p> ! <p>Because useful semantics are not obvious. On some operating systems a path is clearly either absolute or ! relative, but on others the distinction isn't clear. For example, on Windows consider these ! paths:</p> ! <ul> ! <li>"/foo" is not strictly an absolute path since it is relative to the ! current drive, yet appending it to another path as if it were relative clearly ! isn't correct.</li> ! <li>"c:foo" is relative to the current working directory on drive "c:", ! yet it can't be treated like other relative paths in that it can't be appended ! to an absolute path.</li> ! </ul> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->12 September, 2002<!--webbot bot="Timestamp" endspan i-checksum="39334" --></p> \ No newline at end of file --- 163,176 ---- <p>A number (at least six) of designs for automatic name validity error detection were evaluated, including at least four complete implementations. ! While the details for rejection differed, all automatic name validity checking ! designs tended to distort the otherwise simple design of the rest of the library.</p> ! <p><b>Why are paths sometimes manipulated by member functions and sometimes by ! non-member functions?</b></p> ! <p>The design rule is that purely lexical operations are supplied as member ! functions, while operations performed by the operating system are provided as ! free functions.</p> <hr> <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->28 January, 2003<!--webbot bot="Timestamp" endspan i-checksum="38582" --></p> \ No newline at end of file Index: index.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/index.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** index.htm 23 Oct 2002 20:22:47 -0000 1.1.1.1 --- index.htm 1 Apr 2003 08:25:46 -0000 1.2 *************** *** 22,27 **** <a href="#Definitions">Definitions</a><br> ! ! <a href="#Requirements">Requirements</a><br> <a href="#Race-condition">Race-condition danger</a><br> <a href="#Acknowledgements">Acknowledgements</a></td> --- 22,26 ---- <a href="#Definitions">Definitions</a><br> ! <a href="#Common_Specifications">Common Specifications</a><br> <a href="#Race-condition">Race-condition danger</a><br> <a href="#Acknowledgements">Acknowledgements</a></td> *************** *** 34,37 **** --- 33,38 ---- <a href="fstream.htm"><b><i>fstream.hpp</i></b> documentation</a><br> <a href="exception.htm"><b><i>exception.hpp</i></b> documentation</a><br> + <a href="convenience.htm"><b><i>convenience.hpp</i></b> + documentation</a><br> <a href="do-list.htm">Do-list</a></td> </tr> *************** *** 46,75 **** design</a> encourages, but does not require, safe and portable filesystem usage.</p> ! <p>Filesystem Library components are supplied by several headers, all in directory boost/filesystem:</p> <ul> ! <li>Header <i>path.hpp</i> provides class <i>path, </i>a portable mechanism for representing <a href="#path">paths</a> in C++ programs. Validity checking functions are also provided. See <a href="path.htm">path.hpp documentation</a>.<br> </li> ! <li>Header <i>operations.hpp</i> provides functions operating on files and directories, and includes class <i>directory_iterator</i>. See <a href="operations.htm"> operations.hpp documentation</a>.<br> </li> ! <li>Header <i>fstream.hpp</i> provides the same components as the C++ Standard Library's <i>fstream</i> header, except that files are identified by <i>path</i> objects rather that <i>char *</i>'s. See <a href="fstream.htm">fstream.hpp documentation</a>.<br> </li> ! <li>Header <i>exception.hpp</i> provides class <i>filesystem_error</i>. See <a href="exception.htm">exception.hpp documentation</a>.<br> </li> ! <li>Experimental header <i> ! <a href="../../../boost/filesystem/recursive_directory_iterator.hpp"> ! recursive_directory_iterator.hpp</a></i> provides an undocumented directory ! iterator which recurses into any sub-directories encountered. It will be ! incorporated into the Filesystem Library if user feedback is favorable.</li> </ul> <h2>Two-minute <a name="tutorial">tutorial</a></h2> <p>First some preliminaries:</p> --- 47,86 ---- design</a> encourages, but does not require, safe and portable filesystem usage.</p> ! <p>The Filesystem Library supplies several headers, all in directory boost/filesystem:</p> <ul> ! <li>Header <i><a href="../../../boost/filesystem/path.hpp">path.hpp</a></i> provides class <i>path, </i>a portable mechanism for representing <a href="#path">paths</a> in C++ programs. Validity checking functions are also provided. See <a href="path.htm">path.hpp documentation</a>.<br> </li> ! <li>Header <i><a href="../../../boost/filesystem/operations.hpp">operations.hpp</a></i> provides functions operating on files and directories, and includes class <i>directory_iterator</i>. See <a href="operations.htm"> operations.hpp documentation</a>.<br> </li> ! <li>Header <i><a href="../../../boost/filesystem/fstream.hpp">fstream.hpp</a></i> provides the same components as the C++ Standard Library's <i>fstream</i> header, except that files are identified by <i>path</i> objects rather that <i>char *</i>'s. See <a href="fstream.htm">fstream.hpp documentation</a>.<br> </li> ! <li>Header <i><a href="../../../boost/filesystem/exception.hpp">exception.hpp</a></i> provides class <i>filesystem_error</i>. See <a href="exception.htm">exception.hpp documentation</a>.<br> </li> ! <li>Header <a href="../../../boost/filesystem/convenience.hpp">convenience.hpp</a> ! provides convenience functions that combine lower-level functions in useful ! ways. See <a href="convenience.htm">convenience.hpp documentation</a>.</li> </ul> + <p>The object-library source files (<a href="../src/convenience.cpp">convenience.cpp</a>, + <a href="../src/exception.cpp">exception.cpp</a>, + <a href="../src/operations_posix_windows.cpp">operations_posix_windows.cpp</a>, + and <a href="../src/path_posix_windows.cpp">path_posix_windows.cpp</a>) are + supplied in directory libs/filesystem/src. These source files implement the + library for POSIX or Windows compatible operating systems; no implementation is + supplied for other operating systems. Note that many operating systems not + normally thought of as POSIX or Windows systems, such as mainframe legacy + operating systems or embedded operating systems, support POSIX compatible file + systems which will work with the Filesystem Library.</p> + <p>The object-library can be built with a <a href="../build/Jamfile">Jamfile</a> + supplied in directory libs/filesystem/build.</p> <h2>Two-minute <a name="tutorial">tutorial</a></h2> <p>First some preliminaries:</p> *************** *** 77,81 **** <pre>#include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp #include "boost/filesystem/fstream.hpp" // ditto ! #include <iostream> // for cout namespace fs = boost::filesystem;</pre> </blockquote> --- 88,92 ---- <pre>#include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp #include "boost/filesystem/fstream.hpp" // ditto ! #include <iostream> // for std::cout namespace fs = boost::filesystem;</pre> </blockquote> *************** *** 104,121 **** </blockquote> <p>Additional class path constructors provide for an operating system dependent ! format, useful for with user provided input:</p> <blockquote> <pre>int main( int argc, char * argv[] ) { ! fs::path arg_path( argv[1], fs::system_specific );</pre> </blockquote> ! <p>To make class <i>path</i> objects easy to use in expressions, <i>operator<<</i> appends paths:</p> <blockquote> ! <pre>fs::ifstream file1( arg_path << "foo/bar" ); ! fs::ifstream file2( arg_path << "foo" << "bar" );</pre> </blockquote> ! <p>Note that expressions <i>arg_path << "foo/bar"</i> and <i>arg_path << "foo" ! << "bar"</i> yield equivalent results.</p> ! <p><a href="operations.htm#Class directory_iterator">Class <i>directory_iterator</i></a> is an important component of the library. It provides input iterators over the contents of a directory, with the value type being class <i>path</i>.</p> --- 115,132 ---- </blockquote> <p>Additional class path constructors provide for an operating system dependent ! format, useful for user provided input:</p> <blockquote> <pre>int main( int argc, char * argv[] ) { ! fs::path arg_path( argv[1], fs::native ); // native means use O/S path format</pre> </blockquote> ! <p>To make class <i>path</i> objects easy to use in expressions, <i>operator/</i> appends paths:</p> <blockquote> ! <pre>fs::ifstream file1( arg_path / "foo/bar" ); ! fs::ifstream file2( arg_path / "foo" / "bar" );</pre> </blockquote> ! <p>Note that expressions <i>arg_path / "foo/bar"</i> and <i>arg_path / "foo" ! / "bar"</i> yield identical results.</p> ! <p><a href="operations.htm#directory_iterator">Class <i>directory_iterator</i></a> is an important component of the library. It provides input iterators over the contents of a directory, with the value type being class <i>path</i>.</p> *************** *** 162,169 **** script-like, programs using the Filesystem Library!</p> <h2><a name="Examples">Examples</a></h2> ! <p>Until a custom-made example is available, see ! <a href="../example/compiler_status.cpp">compiler_status.cpp</a>, an actual ! program which uses the library.</p> ! <p>Test programs are also sometimes useful in understanding a library, as they illustrate what the developer expected to work and not work. See:</p> <ul> --- 173,200 ---- script-like, programs using the Filesystem Library!</p> <h2><a name="Examples">Examples</a></h2> ! <h3>simple_ls.cpp</h3> ! <p>The example program <a href="../example/simple_ls.cpp">simple_ls.cpp</a> is ! given a path as a command line argument. Since the command line argument may be ! a relative path, the complete path is determined so that messages displayed ! can be more precise.</p> ! <p>The program checks to see if the path exists; if not a message is printed.</p> ! <p>If the path identifies a directory, the directory is iterated through, ! printing the name of the entries found, and an indication if they are ! directories. A count of directories and files is updated, and then printed after ! the iteration is complete.</p> ! <p>If the path is for a file, a message indicating that is printed.</p> ! <p>Try compiling and executing <a href="../example/simple_ls.cpp">simple_ls.cpp</a> ! to see how it works on your system. Try various path arguments to see what ! happens.</p> ! <h3>Other examples</h3> ! <p>The programs used to generate the Boost regression test status tables use the ! Filesystem Library extensively. See:</p> ! <ul> ! <li><a href="../../../tools/regression/process_jam_log.cpp"> ! process_jam_log.cpp</a></li> ! <li><a href="../../../tools/regression/compiler_status.cpp"> ! compiler_status.cpp</a></li> ! </ul> ! <p>Test programs are sometimes useful in understanding a library, as they illustrate what the developer expected to work and not work. See:</p> <ul> *************** *** 176,186 **** containing the names of files, other directories, or both. Directories are identified by <a href="#directory path">directory path</a>.</p> ! <p><b><a name="directory tree">directory tree</a></b> - A directory and file hierarchy viewed as an acyclic graph.</p> ! <p><b><a name="path">path</a> </b>- A possibly empty sequence of names. Each element in the sequence, except the last, names a <a href="#directory">directory</a> which contains the next element. The last element may name either a directory or file. The first ! element is closest to the root of the directory tree, the last element is farthest from the root.</p> <p>It is traditional to represent a path as a string, where each element in the --- 207,217 ---- containing the names of files, other directories, or both. Directories are identified by <a href="#directory path">directory path</a>.</p> ! <p><b><a name="directory_tree">directory tree</a></b> - A directory and file hierarchy viewed as an acyclic graph.</p> ! <p><b><a name="path">path</a> </b>- A possibly empty sequence of <a href="#name">names</a>. Each element in the sequence, except the last, names a <a href="#directory">directory</a> which contains the next element. The last element may name either a directory or file. The first ! element is closest to the <a href="#root">root</a> of the directory tree, the last element is farthest from the root.</p> <p>It is traditional to represent a path as a string, where each element in the *************** *** 190,194 **** <p><b><a name="file path">file path</a></b> - A <a href="#path">path</a> whose last element is a file.</p> ! <p><b><a name="directory path">directory path</a></b> - A <a href="#path">path</a> whose last element is a directory.</p> <p><b><a name="name">name</a></b> - A file or directory name, without any --- 221,225 ---- <p><b><a name="file path">file path</a></b> - A <a href="#path">path</a> whose last element is a file.</p> ! <p><b><a name="directory_path">directory path</a></b> - A <a href="#path">path</a> whose last element is a directory.</p> <p><b><a name="name">name</a></b> - A file or directory name, without any *************** *** 197,216 **** operating systems, files and directories may have more than one valid name, such as a short-form name and a long-form name.</p> ! <h2><a name="Requirements">Requirements</a></h2> ! <p>Unless otherwise specified, all Filesystem Library functions are required to ! throw a <i><a href="exception.htm">filesystem_error</a></i> exception if the ! implementation cannot successfully complete operations required to meet the ! function's specifications. Such exceptions are in addition to any exceptions ! specified in the function's "Throws" paragraph.</p> ! <p>Filesystem Library functions are permitted to call C++ Standard Library ! functions, so <i>std::bad_alloc</i> exceptions may also be thrown, unless ! otherwise specified.</p> ! <p>There is no rollback guarantee; a Filesystem Library function which throws an ! exception may leave the external file system in an altered state.</p> <h2><a name="Race-condition">Race-condition</a> d<a name="Dangers">anger</a></h2> <p>The state of files and directories is often globally shared, and thus may be changed unexpectedly by other threads, ! processes, or even other computers which have access to the filesystem. As an ! example of the difficulties this can cause, consider that the following asserts may fail:</p> <blockquote> --- 228,288 ---- operating systems, files and directories may have more than one valid name, such as a short-form name and a long-form name.</p> ! <p><b><a name="root">root</a></b> - The initial node in the acyclic graph which ! represents the <a href="#directory_path">directory tree</a> for a filesystem.</p> ! <p><b><a name="multi-root_filesystem">multi-root operating system</a></b> - An ! operating system which has multiple <a href="#root">roots</a>. Some operating systems ! have different <a href="#directory_tree">directory trees</a> for each different ! disk, drive, device, volume, share, or other entity managed the system, with each having its ! own root-name.</p> ! <p><b><a name="link">link</a></b> - A name in a <a href="#directory"> ! directory</a> can be viewed as a pointer to the underlying directory or file ! content. Modern operating systems permit multiple directory elements to point to ! the same underlying directory or file content. Such a pointer is often called a ! link. Not all operating systems support the ! concept of links. Links may be referenced counted or non-reference counted. ! Non-reference counted links are sometimes called symbolic links or shortcuts.</p> ! <h2><a name="Common_Specifications">Common Specifications</a></h2> ! <p>Unless otherwise specified, all Filesystem Library member and non-member ! functions have the following common specifications:</p> ! <p><b>May throw exceptions</b> - Filesystem Library functions may throw <i><a href="exception.htm">filesystem_error</a></i> ! exceptions if they cannot successfully complete their operational ! specifications. Function implementations may use C++ Standard Library functions, ! which may throw <i>std::bad_alloc</i>. These exceptions may be thrown even ! though the error condition leading to the exception is not explicitly specified ! in the function's "Throws" paragraph.</p> ! <p><b>Exceptions thrown via <a href="../../utility/throw_exception.html"> ! boost::throw_exception()</a></b> - All exceptions thrown by the Filesystem ! Library are implemented by calling <a href="../../utility/throw_exception.html"> ! boost::throw_exception()</a>. Thus exact behavior may differ depending on ! BOOST_NO_EXCEPTIONS at the time the filesystem source files are compiled.</p> ! <p><b>Links follow operating system rules</b>- <a href="#link">Links</a> are ! transparent in that Filesystem Library functions simply follow operating system ! rules. That implies that some functions may throw <i><a href="exception.htm">filesystem_error</a></i> ! exceptions if a link is cyclic or has other problems.</p> ! <p>Typical operating systems rules call for deep operations on all links except ! that destructive operations on non-reference counted links are either shallow, ! or fail altogether in the case of trying to remove a non-reference counted link ! to a directory.</p> ! <p>Rationale: Follows existing practice (POSIX, Windows, etc.).</p> ! <p><b>No atomic-operation or rollback guarantee</b> - Filesystem Library ! functions which throw exceptions may leave the external file system in an ! altered state. It is suggested that implementations provide stronger guarantees ! when possible.</p> ! <p>Rationale: Implementors shouldn't be required to provide guarantees which are ! impossible to meet on some operating systems. Implementors should be given ! normative encouragement to provide those guarantees when possible.</p> ! <p><b>Graceful degradation</b> - Filesystem Library functions which cannot ! be fully supported on a particular operating system will be partially supported ! if possible. Implementations must document such partial support. Functions which ! are requested to provide some operation which they cannot support should report ! an error at compile time or throw an exception at runtime.</p> ! <p>Rationale: Implementations on less-powerful operating systems should provide ! useful functionality if possible, but should not be required to simulate ! features not present in the underlying operating system.</p> <h2><a name="Race-condition">Race-condition</a> d<a name="Dangers">anger</a></h2> <p>The state of files and directories is often globally shared, and thus may be changed unexpectedly by other threads, ! processes, or even other computers having network access to the filesystem. As an ! example of the difficulties this can cause, note that the following asserts may fail:</p> <blockquote> *************** *** 247,279 **** <li><a href="../test/fstream_test.cpp">fstream_test.cpp</a></li> </ul> ! <p>As of September, 2002, these tests succeed for the following compilers on Windows:</p> <ul> ! <li>Borland 5.5.1</li> <li>GCC 3.1 (using POSIX implementation, but excluding wide-character fstream tests)</li> <li>Intel 6.0</li> ! <li>Metrowerks 8.2</li> <li>Microsoft 7.0</li> <li>Microsoft 6.0 except fstream_test failed.</li> </ul> ! <p>As of September, 2002, some limited use has been successful on Linux using ! GCC and IBM/AIX using Visual Age C++.</p> <h2><a name="Acknowledgements">Acknowledgements</a></h2> ! <p>The Filesystem Library was designed and implemented by Beman Dawes, except ! for the <i>directory_iterator</i> and <i>filesystem_error</i> classes which were ! based on prior work from Dietmar Kühl, as modified by Jan Langer.</p> <p>Key <a href="design.htm#Requirements">design requirements</a> and ! <a href="design.htm#Realities">design realities</a> were developed during extensive discussions on the Boost mailing list, ! followed by comments on the actual implementation. Participants included ! (in more-or-less chronological order) Beman Dawes, Jan Langer, Darin Adler, Michiel ! Salters, Jani Kajala, Jason Stewart, Carl Daniel, David Abrahams, Bill Kempf, ! Jonathan Caves, George Heintzelman, Ken Hagen, Eric Jensen, Joel de Guzman, Jim ! Hyslop, John Maddock, Matt Austern, Peter Dimov, Davlet Panech, Dylan Nicholson, Tom Harris, ! Giovanni Bajo, Baptiste Lepilleur, Thomas Witt, Keith Burton, Mattias Flodin, ! Daniel Frey, Vladimir Prus, Toon Knapen.</p> ! ! <p>Specific improvements for a preliminary design document came from Dan Nuffer and Jeff ! Garland.</p> ! <p>A lengthy discussion on the C++ committee's library reflector illuminated the "illusion of portability" problem, particularly in postings by JP Plauger and Pete Becker.</p> --- 319,430 ---- <li><a href="../test/fstream_test.cpp">fstream_test.cpp</a></li> </ul> ! <p>As of December, 2002, these tests succeed for the following compilers on Windows:</p> <ul> ! <li>Borland 5.6</li> <li>GCC 3.1 (using POSIX implementation, but excluding wide-character fstream tests)</li> <li>Intel 6.0</li> ! <li>Metrowerks 8.3</li> <li>Microsoft 7.0</li> <li>Microsoft 6.0 except fstream_test failed.</li> </ul> ! <p>As of December, 2002, limited use has been successful on Linux using GCC and IBM/AIX using Visual Age C++.</p> <h2><a name="Acknowledgements">Acknowledgements</a></h2> ! <p>The Filesystem Library was designed and implemented by Beman Dawes. The <i>directory_iterator</i> and <i>filesystem_error</i> classes were ! based on prior work from Dietmar Kühl, as modified by Jan Langer. Thomas Witt ! was a particular help in later stages of development.</p> <p>Key <a href="design.htm#Requirements">design requirements</a> and ! <a href="design.htm#Realities">design realities</a> were developed during ! extensive discussions on the Boost mailing list, followed by comments on the ! initial implementation. Numerous helpful comments were then received during the ! Formal Review.<p>Participants included ! Aaron Brashears, ! Alan Bellingham, ! Aleksey Gurtovoy, ! Alex Rosenberg, ! Alisdair Meredith, ! Andy Glew, ! Anthony Williams, ! Baptiste Lepilleur, ! Beman Dawes, ! Bill Kempf, ! Bill Seymour, ! Carl Daniel, ! Chris Little, ! Chuck Allison, ! Craig Henderson, ! Dan Nuffer, ! Dan'l Miller, ! Daniel Frey, ! Darin Adler, ! David Abrahams, ! David Held, ! Davlet Panech, ! Dietmar Kuehl, ! Douglas Gregor, ! Dylan Nicholson, ! Ed Brey, ! Eric Jensen, ! Eric Woodruff, ! Fedder Skovgaard, ! Gary Powell, ! Gennaro Prota, ! Geoff Leyland, ! George Heintzelman, ! Giovanni Bajo, ! Glen Knowles, ! Hillel Sims, ! Howard Hinnant, ! Jaap Suter, ! James Dennett, ! Jan Langer, ! Jani Kajala, ! Jason Stewart, ! Jeff Garland, ! Jens Maurer, ! Jesse Jones, ! Jim Hyslop, ! Joel de Guzman, ! Joel Young, ! John Levon, ! John Maddock, ! John Williston, ! Jonathan Caves, ! Jonathan Biggar, ! Jurko, ! Justus Schwartz, ! Keith Burton, ! Ken Hagen, ! Kostya Altukhov, ! Mark Rodgers, ! Martin Schuerch, ! Matt Austern, ! Matthias Troyer, ! Mattias Flodin, ! Michiel Salters, ! Mickael Pointier, ! Misha Bergal, ! Neal Becker, ! Noel Yap, ! Parksie, ! Patrick Hartling, Pavel Vozenilek, ! Pete Becker, ! Peter Dimov, ! Rainer Deyke, ! Rene Rivera, ! Rob Lievaart, ! Rob Stewart, ! Ron Garcia, ! Ross Smith, ! Sashan, ! Steve Robbins, ! Thomas Witt, ! Tom Harris, ! Toon Knapen, ! Victor Wagner, ! Vincent Finn, ! Vladimir Prus, and ! Yitzhak Sapir ! <p>A lengthy discussion on the C++ committee's library reflector illuminated the "illusion of portability" problem, particularly in postings by JP Plauger and Pete Becker.</p> *************** *** 282,286 **** <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->13 September, 2002<!--webbot bot="Timestamp" endspan i-checksum="39336" --></p> </body> --- 433,437 ---- <p>© Copyright Beman Dawes, 2002</p> <p>Revised ! <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->16 March, 2003<!--webbot bot="Timestamp" endspan i-checksum="28841" --></p> </body> Index: operations.htm =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/doc/operations.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** operations.htm 23 Oct 2002 20:22:49 -0000 1.1.1.1 --- operations.htm 1 Apr 2003 08:25:48 -0000 1.2 *************** *** 16,24 **** <p><a href="#Introduction">Introduction</a><br> <a href="#Synopsis">Header synopsis</a><br> ! <a href="#Class directory_iterator">Class directory_iterator</a><br> <a href="#constructors">Constructors</a><br> <a href="#destructor">Destructor</a><br> ! <a href="#other functions">Other functions</a><br> ! <a href="#Non-member functions">Non-member functions</a><br> <a href="#exists">exists</a><br> <a href="#is_directory">is_directory</a><br> --- 16,24 ---- <p><a href="#Introduction">Introduction</a><br> <a href="#Synopsis">Header synopsis</a><br> ! <a href="#directory_iterator">Class directory_iterator</a><br> <a href="#constructors">Constructors</a><br> <a href="#destructor">Destructor</a><br> ! <a href="#Other_functions">Other_functions</a><br> ! <a href="#Non-member_functions">Operations functions</a><br> <a href="#exists">exists</a><br> <a href="#is_directory">is_directory</a><br> *************** *** 29,33 **** <a href="#rename">rename</a><br> <a href="#copy_file">copy_file</a><br> ! <a href="#initial_directory">initial_directory</a></p> <h2><a name="Introduction">Introduction</a></h2> --- 29,35 ---- <a href="#rename">rename</a><br> <a href="#copy_file">copy_file</a><br> ! <a href="#initial_directory">initial_directory</a><br> ! <a href="#complete">complete</a><br> ! <a href="#system_complete">system_complete</a></p> <h2><a name="Introduction">Introduction</a></h2> *************** *** 43,49 **** documentation</a>.</p> ! <p>As with all Filesystem Library components, errors may result in <i> ! <a href="exception.htm">filesystem_error</a></i> or <i>std::bad_alloc</i> ! exceptions being thrown. See <a href="index.htm#Requirements">Requirements</a>.</p> <h2>Header <a href="../../../boost/filesystem/operations.hpp">boost/filesystem/operations.hpp</a> --- 45,51 ---- documentation</a>.</p> ! <p>The Filesystem Library's <a href="index.htm#Common_Specifications">Common ! Specifications</a> apply to all member and non-member functions supplied by this ! header. </p> <h2>Header <a href="../../../boost/filesystem/operations.hpp">boost/filesystem/operations.hpp</a> *************** *** 75,86 **** void <a href="#create_directory">create_directory</a>( const path & directory_ph ); ! void <a href="#remove">remove</a>( const path & ph ); unsigned long <a href="#remove_all">remove_all</a>( const path & ph ); void <a href="#rename">rename</a>( const path & from_path, const path & to_path ); ! void <a href="#copy_file">copy_file</a>( const path & from_file_ph, ! const path & to_file_ph ); ! const path & <a href="#initial_directory">initial_directory</a>(); } // namespace filesystem --- 77,92 ---- void <a href="#create_directory">create_directory</a>( const path & directory_ph ); ! bool <a href="#remove">remove</a>( const path & ph ); unsigned long <a href="#remove_all">remove_all</a>( const path & ph ); void <a href="#rename">rename</a>( const path & from_path, const path & to_path ); ! void <a href="#copy_file">copy_file</a>( const path & source_file, ! const path & target_file ); ! const path & <a href="#initial_path">initial_path</a>(); ! path <a href="#current_path">current_path</a>(); ! path <a href="#complete">complete</a>( const path & ph, ! const path & base = initial_path() ); ! path <a href="#system_complete">system_complete</a>( const path & ph ); } // namespace filesystem *************** *** 88,99 **** </pre> ! <h2><a name="Class directory_iterator">Class directory_iterator</a></h2> <p>Class <i>directory_iterator</i> provides a C++ standard conforming input ! iterator which accesses the contents of a <a href="reference.htm#directory"> directory</a>. </p> <p>The value type is <i><a href="path.htm">boost::filesystem::path</a></i>, so ! dereferencing a <i>directory_iterator</i> yields a <a href="reference.htm#path"> path</a> to a file or directory contained within the directory represented by the directory-path argument supplied at construction. The path returned by --- 94,105 ---- </pre> ! <h2><a name="directory_iterator">Class directory_iterator</a></h2> <p>Class <i>directory_iterator</i> provides a C++ standard conforming input ! iterator which accesses the contents of a <a href="index.htm#directory"> directory</a>. </p> <p>The value type is <i><a href="path.htm">boost::filesystem::path</a></i>, so ! dereferencing a <i>directory_iterator</i> yields a <a href="index.htm#path"> path</a> to a file or directory contained within the directory represented by the directory-path argument supplied at construction. The path returned by *************** *** 133,139 **** representing the first path in <i>directory_ph</i>, or if <code> empty(directory_ph)</code>, the <i>past-the-end</i> value.</p> </blockquote> ! <h3><a name="other functions">Other functions</a></h3> <p>Class <i>directory_iterator</i> also supplies all the other functions --- 139,150 ---- representing the first path in <i>directory_ph</i>, or if <code> empty(directory_ph)</code>, the <i>past-the-end</i> value.</p> + + <p><b>Throws:</b> if <code>!exists( directory_ph )</code></p> + + <p><b>Note:</b> To iterate over the current directory, write <code> + directory_iterator(current_path())</code> rather than <code>directory_iterator("")</code>.</p> </blockquote> ! <h3><a name="Other_functions">Other functions</a></h3> <p>Class <i>directory_iterator</i> also supplies all the other functions *************** *** 141,145 **** <i>operator++</i>, and <i>operator*</i>.</p> ! <h2><a name="Non-member functions">Non-member functions</a></h2> <p> --- 152,156 ---- <i>operator++</i>, and <i>operator*</i>.</p> ! <h2><a name="Non-member_functions">Non-member functions</a></h2> <p> *************** *** 163,178 **** <p> ! <b>Rationale:</b> Errors which might appear to be preconditions are not ! specified as such, but instead are specified to throw exceptions. This is because the possibility of <a href="index.htm#Race-condition">race-conditions</a> makes it unreliable to test for preconditions before calling the function. As a ! design practice, preconditions should always be testable by a program, so that ! violations can be avoided. It is not always possible or desirable to abstract ! away the fact that the library is implemented by calls to the operating system, ! and this is one of those cases.</p> <p> <b>Naming Rationale:</b> See class <i>path</i> ! <a href="path.htm#Naming Rationale">Naming Rationale</a>.</p> <h3><a name="exists">exists</a></h3> --- 174,202 ---- <p> ! <b><a name="not-precondition-rationale">Rationale</a>:</b> Some errors which might ! at first glance appear to be preconditions are not ! specified as such, but instead will throw exceptions. This is because the possibility of <a href="index.htm#Race-condition">race-conditions</a> makes it unreliable to test for preconditions before calling the function. As a ! design practice, preconditions are not specified when it is not reasonable for a ! program to test for them before calling the function. </p> ! ! <p><b>Empty path r<a name="empty_rationale">ationale</a>:</b> Some errors, ! particularly function arguments of empty paths, are specified both in <i> ! Precondition</i> and in <i>Throws</i> paragraphs. A non-empty path is specified ! as a precondition because an empty path is almost certainly an error, the error ! meets the usual criteria for <i>Preconditions</i> as specified in the C++ ! Standard clause 17, and user pre-detection of the error does not suffe... [truncated message content] |
From: <bl...@us...> - 2003-04-01 08:26:32
|
Update of /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src In directory sc8-pr-cvs1:/tmp/cvs-serv17363/deplib/boostcvs/libs/filesystem/src Modified Files: exception.cpp operations_posix_windows.cpp path_posix_windows.cpp Log Message: * upgraded to the official boost 1.30 Index: exception.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src/exception.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** exception.cpp 23 Oct 2002 20:22:55 -0000 1.1.1.1 --- exception.cpp 1 Apr 2003 08:25:50 -0000 1.2 *************** *** 1,5 **** // Exception implementation file -------------------------------------------// ! // < ----------------------------------------------------------------------- > // < Copyright © 2001 Dietmar Kühl, All Rights Reserved > // < > --- 1,6 ---- // Exception implementation file -------------------------------------------// ! // < ----------------------------------------------------------------------- > ! // < 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,26 **** #include <boost/filesystem/exception.hpp> ! #include <cerrno> #include <string> --- 21,27 ---- #include <boost/filesystem/exception.hpp> ! namespace fs = boost::filesystem; ! ! #include <cstring> // SGI MIPSpro compilers need this #include <string> *************** *** 29,37 **** # endif ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use, not the current ! // operating system. GCC defaults to BOOST_POSIX; it doesn't predefine _WIN32. ! # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) ! # if defined(_WIN32) # define BOOST_WINDOWS # else --- 30,36 ---- # endif ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use. # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) ! # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) # define BOOST_WINDOWS # else *************** *** 42,71 **** # if defined( BOOST_WINDOWS ) # include "windows.h" # endif //----------------------------------------------------------------------------// ! namespace boost { ! namespace filesystem { ! filesystem_error::filesystem_error( std::string const& msg ): ! std::runtime_error("filesystem error"), ! m_msg(msg), ! m_err(0) ! { ! } ! ! filesystem_error::filesystem_error( std::string const& msg, error_type ): ! std::runtime_error("filesystem error"), ! m_msg(msg), # ifdef BOOST_WINDOWS ! m_err( ::GetLastError() ) # else ! m_err(errno) // GCC 3.1 won't accept ::errno # endif { } filesystem_error::~filesystem_error() throw() --- 41,229 ---- # if defined( BOOST_WINDOWS ) # include "windows.h" + # else + # include <errno.h> // for POSIX error codes # endif //----------------------------------------------------------------------------// ! namespace { ! std::string system_message( int sys_err_code ) { + std::string str; + # ifdef BOOST_WINDOWS + LPVOID lpMsgBuf; + ::FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + sys_err_code, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPSTR) &lpMsgBuf, + 0, + NULL + ); + str += static_cast<LPCSTR>(lpMsgBuf); + ::LocalFree( lpMsgBuf ); // free the buffer + while ( str.size() + && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') ) + str.erase( str.size()-1 ); + # else + str += std::strerror( errno ); + # endif + return str; + } ! struct ec_xlate { int sys_ec; fs::error_code ec; }; ! const ec_xlate ec_table[] = ! { # ifdef BOOST_WINDOWS ! { ERROR_ACCESS_DENIED, fs::security_error }, ! { ERROR_INVALID_ACCESS, fs::security_error }, ! { ERROR_SHARING_VIOLATION, fs::security_error }, ! { ERROR_LOCK_VIOLATION, fs::security_error }, ! { ERROR_LOCKED, fs::security_error }, ! { ERROR_NOACCESS, fs::security_error }, ! { ERROR_WRITE_PROTECT, fs::read_only_error }, ! { ERROR_NOT_READY, fs::io_error }, ! { ERROR_SEEK, fs::io_error }, ! { ERROR_READ_FAULT, fs::io_error }, ! { ERROR_WRITE_FAULT, fs::io_error }, ! { ERROR_CANTOPEN, fs::io_error }, ! { ERROR_CANTREAD, fs::io_error }, ! { ERROR_CANTWRITE, fs::io_error }, ! { ERROR_DIRECTORY, fs::path_error }, ! { ERROR_INVALID_NAME, fs::path_error }, ! { ERROR_FILE_NOT_FOUND, fs::not_found_error }, ! { ERROR_PATH_NOT_FOUND, fs::not_found_error }, ! { ERROR_DEV_NOT_EXIST, fs::not_found_error }, ! { ERROR_DEVICE_IN_USE, fs::busy_error }, ! { ERROR_OPEN_FILES, fs::busy_error }, ! { ERROR_BUSY_DRIVE, fs::busy_error }, ! { ERROR_BUSY, fs::busy_error }, ! { ERROR_FILE_EXISTS, fs::already_exists_error }, ! { ERROR_ALREADY_EXISTS, fs::already_exists_error }, ! { ERROR_DIR_NOT_EMPTY, fs::not_empty_error }, ! { ERROR_HANDLE_DISK_FULL, fs::out_of_space_error }, ! { ERROR_DISK_FULL, fs::out_of_space_error }, ! { ERROR_OUTOFMEMORY, fs::out_of_memory_error }, ! { ERROR_NOT_ENOUGH_MEMORY, fs::out_of_memory_error }, ! { ERROR_TOO_MANY_OPEN_FILES, fs::out_of_resource_error } # else ! { EACCES, fs::security_error }, ! { EROFS, fs::read_only_error }, ! { EIO, fs::io_error }, ! { ENAMETOOLONG, fs::path_error }, ! { ENOENT, fs::not_found_error }, ! { ENOTDIR, fs::not_directory_error }, ! { EAGAIN, fs::busy_error }, ! { EBUSY, fs::busy_error }, ! { ETXTBSY, fs::busy_error }, ! { EEXIST, fs::already_exists_error }, ! { ENOTEMPTY, fs::not_empty_error }, ! { EISDIR, fs::is_directory_error }, ! { ENOSPC, fs::out_of_space_error }, ! { ENOMEM, fs::out_of_memory_error }, ! { EMFILE, fs::out_of_resource_error } # endif + }; + + fs::error_code lookup_error( int sys_err_code ) + { + for ( const ec_xlate * cur = &ec_table[0]; + cur != ec_table + + sizeof(ec_table)/sizeof(ec_xlate); ++cur ) { + if ( sys_err_code == cur->sys_ec ) return cur->ec; } + return fs::system_error; // general system error code + } + + // These helper functions work for POSIX and Windows. For systems where + // path->native_file_string() != path->native_directory_string(), more + // care would be required to get the right form for the function involved. + + std::string other_error_prep( + const std::string & who, + const std::string & message ) + { + return who + ": " + message; + } + + std::string other_error_prep( + const std::string & who, + const fs::path & path1, + const std::string & message ) + { + return who + ": \"" + path1.native_file_string() + "\": " + message; + } + + std::string system_error_prep( + const std::string & who, + const fs::path & path1, + int sys_err_code ) + { + return who + ": \"" + path1.native_file_string() + "\": " + + system_message( sys_err_code ); + } + + std::string system_error_prep( + const std::string & who, + const fs::path & path1, + const fs::path & path2, + int sys_err_code ) + { + return who + ": \"" + path1.native_file_string() + + "\", \"" + path2.native_file_string() + "\": " + + system_message( sys_err_code ); + } + + } // unnamed namespace + + namespace boost + { + namespace filesystem + { + + // filesystem_error implementation -----------------------------------------// + + filesystem_error::filesystem_error( + const std::string & who, + const std::string & message ) + : std::runtime_error( + other_error_prep( who, message ).c_str() ), + m_sys_err(0), m_err(other_error), m_who(who) + {} + + filesystem_error::filesystem_error( + const std::string & who, + const path & path1, + const std::string & message ) + : std::runtime_error( + other_error_prep( who, path1, message ).c_str() ), + m_sys_err(0), m_err(other_error), m_who(who), m_path1(path1) + {} + + filesystem_error::filesystem_error( + const std::string & who, + const path & path1, + int sys_err_code ) + : std::runtime_error( + system_error_prep( who, path1, sys_err_code ).c_str() ), + m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)), + m_who(who), m_path1(path1) + {} + + filesystem_error::filesystem_error( + const std::string & who, + const path & path1, + const path & path2, + int sys_err_code ) + : std::runtime_error( + system_error_prep( who, path1, path2, sys_err_code ).c_str() ), + m_sys_err(sys_err_code), m_err(lookup_error(sys_err_code)), + m_who(who), m_path1(path1), m_path2(path2) + {} filesystem_error::~filesystem_error() throw() *************** *** 73,103 **** } ! char const* filesystem_error::what() const throw() { ! if (m_err) { ! m_msg += ": "; ! # ifdef BOOST_WINDOWS ! LPVOID lpMsgBuf; ! ::FormatMessageA( ! FORMAT_MESSAGE_ALLOCATE_BUFFER | ! FORMAT_MESSAGE_FROM_SYSTEM | ! FORMAT_MESSAGE_IGNORE_INSERTS, ! NULL, ! m_err, ! MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language ! (LPSTR) &lpMsgBuf, ! 0, ! NULL ! ); ! m_msg += static_cast<LPCSTR>(lpMsgBuf); ! LocalFree( lpMsgBuf ); // free the buffer ! # else ! m_msg += std::strerror(m_err); ! # endif ! m_err = 0; } ! return m_msg.c_str(); ! } } // namespace filesystem } // namespace boost --- 231,245 ---- } ! namespace detail { ! int system_error_code() // artifact of POSIX and WINDOWS error reporting { ! # ifdef BOOST_WINDOWS ! return ::GetLastError(); ! # else ! return errno; // GCC 3.1 won't accept ::errno ! # endif } ! } // namespace detail } // namespace filesystem } // namespace boost Index: operations_posix_windows.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src/operations_posix_windows.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** operations_posix_windows.cpp 23 Oct 2002 20:22:58 -0000 1.1.1.1 --- operations_posix_windows.cpp 1 Apr 2003 08:25:50 -0000 1.2 *************** *** 14,18 **** // < ----------------------------------------------------------------------- > ! // See http://www.boost.org for most recent version including documentation. //----------------------------------------------------------------------------// --- 14,18 ---- // < ----------------------------------------------------------------------- > ! // See http://www.boost.org/libs/filesystem for documentation. //----------------------------------------------------------------------------// *************** *** 28,42 **** #include <boost/filesystem/operations.hpp> #include <boost/filesystem/exception.hpp> //#include <iostream> namespace fs = boost::filesystem; ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use, not the current ! // operating system. GCC defaults to BOOST_POSIX; it doesn't predefine _WIN32. ! # if defined(BOOST_WINDOWS) || (!defined(BOOST_POSIX) && defined(_WIN32)) # include "windows.h" # else - # define BOOST_POSIX # include "sys/stat.h" # include "dirent.h" --- 28,55 ---- #include <boost/filesystem/operations.hpp> #include <boost/filesystem/exception.hpp> + #include <boost/scoped_array.hpp> + #include <boost/throw_exception.hpp> //#include <iostream> namespace fs = boost::filesystem; ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use. ! # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) ! # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) ! # define BOOST_WINDOWS ! # else ! # define BOOST_POSIX ! # endif ! # endif ! # if defined(BOOST_WINDOWS) # include "windows.h" + + // For Windows, the xxxA form of various function names is used to avoid + // inadvertently getting wide forms of the functions. (The undecorated + // forms are actually macros, so can misfire if the user has various + // other macros defined. There was a bug report of this happening.) + # else # include "sys/stat.h" # include "dirent.h" *************** *** 76,80 **** inline const char * find_next_file( ! BOOST_HANDLE handle, BOOST_SYSTEM_DIRECTORY_TYPE & ) // Returns: if EOF 0, otherwise name // Throws: if system reports error --- 89,93 ---- inline const char * find_next_file( ! BOOST_HANDLE handle, const fs::path & ph, BOOST_SYSTEM_DIRECTORY_TYPE & ) // Returns: if EOF 0, otherwise name // Throws: if system reports error *************** *** 90,94 **** if ( errno != 0 ) { ! throw fs::filesystem_error( "directory_iterator ++() failure" ); } else { return 0; } // end reached --- 103,110 ---- if ( errno != 0 ) { ! boost::throw_exception( ! fs::filesystem_error( ! "boost::filesystem::directory_iterator::operator++", ! ph, errno ) ); } else { return 0; } // end reached *************** *** 100,104 **** # define BOOST_HANDLE HANDLE # define BOOST_INVALID_HANDLE_VALUE INVALID_HANDLE_VALUE ! # define BOOST_SYSTEM_DIRECTORY_TYPE WIN32_FIND_DATA inline const char * find_first_file( const char * dir, --- 116,120 ---- # define BOOST_HANDLE HANDLE # define BOOST_INVALID_HANDLE_VALUE INVALID_HANDLE_VALUE ! # define BOOST_SYSTEM_DIRECTORY_TYPE WIN32_FIND_DATAA inline const char * find_first_file( const char * dir, *************** *** 106,111 **** // Returns: 0 if error, otherwise name { std::string dirpath( std::string(dir) + "/*" ); ! return ( (handle = ::FindFirstFile( dirpath.c_str(), &data )) == BOOST_INVALID_HANDLE_VALUE ) ? 0 : data.cFileName; } --- 122,128 ---- // Returns: 0 if error, otherwise name { + // std::cout << "find_first_file " << dir << std::endl; std::string dirpath( std::string(dir) + "/*" ); ! return ( (handle = ::FindFirstFileA( dirpath.c_str(), &data )) == BOOST_INVALID_HANDLE_VALUE ) ? 0 : data.cFileName; } *************** *** 113,116 **** --- 130,134 ---- inline void find_close( BOOST_HANDLE handle ) { + // std::cout << "find_close" << std::endl; assert( handle != BOOST_INVALID_HANDLE_VALUE ); ::FindClose( handle ); *************** *** 118,131 **** inline const char * find_next_file( ! BOOST_HANDLE handle, BOOST_SYSTEM_DIRECTORY_TYPE & data ) // Returns: 0 if EOF, otherwise name // Throws: if system reports error { ! if ( ::FindNextFile( handle, &data ) == 0 ) { if ( ::GetLastError() != ERROR_NO_MORE_FILES ) { ! throw fs::filesystem_error( ! "directory_iterator ++() failure", fs::system_error ); } else { return 0; } // end reached --- 136,151 ---- inline const char * find_next_file( ! BOOST_HANDLE handle, const fs::path & ph, ! BOOST_SYSTEM_DIRECTORY_TYPE & data ) // Returns: 0 if EOF, otherwise name // Throws: if system reports error { ! if ( ::FindNextFileA( handle, &data ) == 0 ) { if ( ::GetLastError() != ERROR_NO_MORE_FILES ) { ! boost::throw_exception( fs::filesystem_error( ! "boost::filesystem::directory_iterator::operator++", ! ph.branch_path(), fs::detail::system_error_code() ) ); } else { return 0; } // end reached *************** *** 148,152 **** if ( fs::is_directory( ph ) ) { ! for ( boost::filesystem::directory_iterator itr( ph ); itr != end_itr; ++itr ) { --- 168,172 ---- if ( fs::is_directory( ph ) ) { ! for ( fs::directory_iterator itr( ph ); itr != end_itr; ++itr ) { *************** *** 164,190 **** namespace filesystem { - namespace detail - { - #ifdef BOOST_POSIX - const char * implementation_name() { return "POSIX"; } - #else - const char * implementation_name() { return "Windows"; } - #endif ! // directory_iterator_imp --------------------------------------------------// ! ! class directory_iterator_imp ! { ! public: ! path entry_path; ! BOOST_HANDLE handle; ! ~directory_iterator_imp() ! { ! if ( handle != BOOST_INVALID_HANDLE_VALUE ) find_close( handle ); ! } ! }; ! } // namespace detail // directory_iterator implementation ---------------------------------------// --- 184,201 ---- namespace filesystem { ! // dir_itr_imp -------------------------------------------------------------// ! class directory_iterator::dir_itr_imp ! { ! public: ! path entry_path; ! BOOST_HANDLE handle; ! ~dir_itr_imp() ! { ! if ( handle != BOOST_INVALID_HANDLE_VALUE ) find_close( handle ); ! } ! }; // directory_iterator implementation ---------------------------------------// *************** *** 195,246 **** directory_iterator::directory_iterator( const path & dir_path ) { ! base().imp.reset( new detail::directory_iterator_imp ); BOOST_SYSTEM_DIRECTORY_TYPE scratch; ! const char * name; ! if ( dir_path.is_null() ) ! base().imp->handle = BOOST_INVALID_HANDLE_VALUE; else ! name = find_first_file( dir_path.directory_path().c_str(), ! base().imp->handle, scratch ); // sets handle ! if ( base().imp->handle != BOOST_INVALID_HANDLE_VALUE ) { ! base().imp->entry_path = dir_path; ! base().imp->entry_path.m_path_append( name, path::nocheck ); ! while ( base().imp.get() ! && ( base().imp->entry_path.leaf() == "." ! || base().imp->entry_path.leaf() == ".." ) ) ! { operator++(); } } else { ! throw filesystem_error( std::string( ! "directory_iterator constructor failure: " ) ! + dir_path.directory_path().c_str(), system_error ); } } ! namespace detail { ! path const & directory_iterator_internals::deref() const { ! assert( imp.get() ); // fails if dereference end iterator ! return imp->entry_path; } ! ! void directory_iterator_internals::inc() { ! assert( imp.get() ); // fails on increment end iterator ! assert( imp->handle != BOOST_INVALID_HANDLE_VALUE ); // imp reality check ! ! BOOST_SYSTEM_DIRECTORY_TYPE scratch; ! const char * name; ! if ( (name = find_next_file( imp->handle, scratch )) != 0 ) ! { ! imp->entry_path.m_replace_leaf( name ); ! } ! else { ! imp.reset(); // make base() the end iterator ! } } } --- 206,256 ---- directory_iterator::directory_iterator( const path & dir_path ) { ! m_imp.reset( new dir_itr_imp ); BOOST_SYSTEM_DIRECTORY_TYPE scratch; ! const char * name = 0; // initialization quiets compiler warnings ! if ( dir_path.empty() ) ! m_imp->handle = BOOST_INVALID_HANDLE_VALUE; else ! name = find_first_file( dir_path.native_directory_string().c_str(), ! m_imp->handle, scratch ); // sets handle ! if ( m_imp->handle != BOOST_INVALID_HANDLE_VALUE ) { ! m_imp->entry_path = dir_path; ! m_imp->entry_path.m_path_append( name, path::nocheck ); ! while ( m_imp.get() ! && ( m_imp->entry_path.leaf() == "." ! || m_imp->entry_path.leaf() == ".." ) ) ! { operator++(); } } else { ! boost::throw_exception( filesystem_error( ! "boost::filesystem::directory_iterator constructor", ! dir_path, fs::detail::system_error_code() ) ); } } ! path const & directory_iterator::m_deref() const { ! assert( m_imp.get() ); // fails if dereference end iterator ! return m_imp->entry_path; ! } ! ! void directory_iterator::m_inc() ! { ! assert( m_imp.get() ); // fails on increment end iterator ! assert( m_imp->handle != BOOST_INVALID_HANDLE_VALUE ); // reality check ! ! BOOST_SYSTEM_DIRECTORY_TYPE scratch; ! const char * name; ! if ( (name = find_next_file( m_imp->handle, ! m_imp->entry_path, scratch )) != 0 ) { ! m_imp->entry_path.m_replace_leaf( name ); } ! else { ! m_imp.reset(); // make base() the end iterator } } *************** *** 252,258 **** # ifdef BOOST_POSIX struct stat path_stat; ! return ::stat( ph.file_path().c_str(), &path_stat ) == 0; # else ! return ::GetFileAttributes( ph.file_path().c_str() ) != 0xFFFFFFFF; # endif } --- 262,268 ---- # ifdef BOOST_POSIX struct stat path_stat; ! return ::stat( ph.string().c_str(), &path_stat ) == 0; # else ! return ::GetFileAttributesA( ph.string().c_str() ) != 0xFFFFFFFF; # endif } *************** *** 262,274 **** # ifdef BOOST_POSIX struct stat path_stat; ! if ( ::stat( ph.directory_path().c_str(), &path_stat ) != 0 ) ! throw filesystem_error( std::string("is_directory(): ") ! + ph.directory_path().c_str(), system_error ); return S_ISDIR( path_stat.st_mode ); # else ! DWORD attributes = ::GetFileAttributes( ph.directory_path().c_str() ); if ( attributes == 0xFFFFFFFF ) ! throw filesystem_error( std::string("is_directory(): ") ! + ph.directory_path().c_str(), system_error ); return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; # endif --- 272,286 ---- # ifdef BOOST_POSIX struct stat path_stat; ! if ( ::stat( ph.native_directory_string().c_str(), &path_stat ) != 0 ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::is_directory", ! ph, fs::detail::system_error_code() ) ); return S_ISDIR( path_stat.st_mode ); # else ! DWORD attributes = ::GetFileAttributesA( ph.native_directory_string().c_str() ); if ( attributes == 0xFFFFFFFF ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::is_directory", ! ph, fs::detail::system_error_code() ) ); return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; # endif *************** *** 279,285 **** # ifdef BOOST_POSIX struct stat path_stat; ! if ( ::stat( ph.file_path().c_str(), &path_stat ) != 0 ) ! throw filesystem_error( std::string("is_empty(): ") ! + ph.file_path().c_str(), system_error ); return S_ISDIR( path_stat.st_mode ) --- 291,298 ---- # ifdef BOOST_POSIX struct stat path_stat; ! if ( ::stat( ph.string().c_str(), &path_stat ) != 0 ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::is_empty", ! ph, fs::detail::system_error_code() ) ); return S_ISDIR( path_stat.st_mode ) *************** *** 288,295 **** # else WIN32_FILE_ATTRIBUTE_DATA fad; ! if ( !::GetFileAttributesEx( ph.file_path().c_str(), ::GetFileExInfoStandard, &fad ) ) ! throw filesystem_error( std::string("is_empty(): ") ! + ph.file_path().c_str(), system_error ); return ( fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) --- 301,309 ---- # else WIN32_FILE_ATTRIBUTE_DATA fad; ! if ( !::GetFileAttributesExA( ph.string().c_str(), ::GetFileExInfoStandard, &fad ) ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::is_empty", ! ph, fs::detail::system_error_code() ) ); return ( fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) *************** *** 302,339 **** { # ifdef BOOST_POSIX ! if ( ::mkdir( dir_path.directory_path().c_str(), S_IRWXU|S_IRWXG|S_IRWXO ) != 0 ) # else ! if ( !::CreateDirectory( dir_path.directory_path().c_str(), 0 ) ) # endif ! throw filesystem_error( std::string("create_directory(): ") ! + dir_path.directory_path().c_str(), system_error ); } ! void remove( const path & ph ) { if ( exists( ph ) ) { - if ( is_directory( ph ) ) - { # ifdef BOOST_POSIX ! if ( ::rmdir( ph.file_path().c_str() ) != 0 ) # else ! if ( !::RemoveDirectory( ph.file_path().c_str() ) ) ! # endif ! throw fs::filesystem_error( std::string("remove() on: ") ! + ph.file_path().c_str(), system_error ); } else { ! # ifdef BOOST_POSIX ! if ( ::remove( ph.file_path().c_str() ) != 0 ) ! # else ! if ( !::DeleteFile( ph.file_path().c_str() ) ) # endif ! throw fs::filesystem_error( std::string("remove() on: ") ! + ph.file_path().c_str(), system_error ); } } } --- 316,355 ---- { # ifdef BOOST_POSIX ! if ( ::mkdir( dir_path.native_directory_string().c_str(), S_IRWXU|S_IRWXG|S_IRWXO ) != 0 ) # else ! if ( !::CreateDirectoryA( dir_path.native_directory_string().c_str(), 0 ) ) # endif ! boost::throw_exception( filesystem_error( ! "boost::filesystem::create_directory", ! dir_path, fs::detail::system_error_code() ) ); } ! bool remove( const path & ph ) { if ( exists( ph ) ) { # ifdef BOOST_POSIX ! if ( ::remove( ph.string().c_str() ) != 0 ) ! { # else ! if ( is_directory( ph ) ) ! { ! if ( !::RemoveDirectoryA( ph.string().c_str() ) ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::remove", ! ph, fs::detail::system_error_code() ) ); } else { ! if ( !::DeleteFileA( ph.string().c_str() ) ) # endif ! boost::throw_exception( filesystem_error( ! "boost::filesystem::remove", ! ph, fs::detail::system_error_code() ) ); } + return true; } + return false; } *************** *** 348,357 **** # ifdef BOOST_POSIX if ( exists( new_path ) // POSIX is too permissive so must check ! || ::rename( old_path.file_path().c_str(), new_path.file_path().c_str() ) != 0 ) # else ! if ( !::MoveFile( old_path.file_path().c_str(), new_path.file_path().c_str() ) ) # endif ! throw filesystem_error( std::string("move_file(): ") ! + old_path.file_path().c_str() + ", " + new_path.file_path().c_str(), system_error ); } --- 364,374 ---- # ifdef BOOST_POSIX if ( exists( new_path ) // POSIX is too permissive so must check ! || ::rename( old_path.string().c_str(), new_path.string().c_str() ) != 0 ) # else ! if ( !::MoveFileA( old_path.string().c_str(), new_path.string().c_str() ) ) # endif ! boost::throw_exception( filesystem_error( ! "boost::filesystem::rename", ! old_path, new_path, fs::detail::system_error_code() ) ); } *************** *** 364,379 **** const std::size_t buf_sz = 32768; boost::scoped_array<char> buf( new char [buf_sz] ); ! int infile, outfile; ! if ( (infile = ::open( from_file_ph.file_path().c_str(), O_RDONLY )) < 0 ! || (outfile = ::open( to_file_ph.file_path().c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO )) < 0 ) { if ( infile != 0 ) ::close( infile ); ! throw fs::filesystem_error( std::string("copy() files: ") ! + from_file_ph.file_path().c_str() ! + ", " + to_file_ph.file_path().c_str(), system_error ); } --- 381,396 ---- const std::size_t buf_sz = 32768; boost::scoped_array<char> buf( new char [buf_sz] ); ! int infile, outfile=0; // init quiets compiler warning ! if ( (infile = ::open( from_file_ph.string().c_str(), O_RDONLY )) < 0 ! || (outfile = ::open( to_file_ph.string().c_str(), O_WRONLY | O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO )) < 0 ) { if ( infile != 0 ) ::close( infile ); ! boost::throw_exception( filesystem_error( ! "boost::filesystem::copy_file", ! from_file_ph, to_file_ph, fs::detail::system_error_code() ) ); } *************** *** 387,423 **** if ( sz != 0 ) # else ! if ( !::CopyFile( from_file_ph.file_path().c_str(), ! to_file_ph.file_path().c_str(), /*fail_if_exists=*/true ) ) # endif ! throw fs::filesystem_error( std::string("copy() files: ") ! + from_file_ph.file_path().c_str() ! + ", " + to_file_ph.file_path().c_str(), system_error ); } ! const path & initial_directory() { ! static path init_dir; ! if ( init_dir.is_null() ) ! { ! # ifdef BOOST_POSIX ! long path_max = ::pathconf( ".", _PC_PATH_MAX ); ! if ( path_max == -1 ) ! throw filesystem_error( "initial_directory()" ); ! boost::scoped_array<char> ! buf( new char[static_cast<std::size_t>(path_max)] ); ! if ( ::getcwd( buf.get(), static_cast<std::size_t>(path_max) ) == 0 ) ! # else ! DWORD sz; ! if ( (sz = ::GetCurrentDirectory( 0, static_cast<char*>(0) )) == 0 ) ! throw filesystem_error( "initial_directory()" ); ! boost::scoped_array<char> buf( new char[sz] ); ! if ( ::GetCurrentDirectory( sz, buf.get() ) == 0 ) ! # endif ! { throw filesystem_error( "initial_directory()", system_error ); } ! init_dir = path( buf.get(), system_specific ); ! } ! return init_dir; } } // namespace filesystem } // namespace boost --- 404,483 ---- if ( sz != 0 ) # else ! if ( !::CopyFileA( from_file_ph.string().c_str(), ! to_file_ph.string().c_str(), /*fail_if_exists=*/true ) ) # endif ! boost::throw_exception( filesystem_error( ! "boost::filesystem::copy_file", ! from_file_ph, to_file_ph, fs::detail::system_error_code() ) ); } ! path current_path() { ! # ifdef BOOST_POSIX ! long path_max = ::pathconf( ".", _PC_PATH_MAX ); ! if ( path_max < 1 ) ! boost::throw_exception( ! filesystem_error( "boost::filesystem::current_path", ! "_PC_PATH_MAX < 1" ) ); ! boost::scoped_array<char> ! buf( new char[static_cast<std::size_t>(path_max)] ); ! if ( ::getcwd( buf.get(), static_cast<std::size_t>(path_max) ) == 0 ) ! # else ! DWORD sz; ! if ( (sz = ::GetCurrentDirectoryA( 0, static_cast<char*>(0) )) == 0 ) ! boost::throw_exception( ! filesystem_error( "boost::filesystem::current_path", ! "size is 0" ) ); ! boost::scoped_array<char> buf( new char[sz] ); ! if ( ::GetCurrentDirectoryA( sz, buf.get() ) == 0 ) ! # endif ! boost::throw_exception( ! filesystem_error( "boost::filesystem::current_path", path(), ! fs::detail::system_error_code() ) ); ! return path( buf.get(), native ); } + const path & initial_path() + { + static path init_path; + if ( init_path.empty() ) init_path = current_path(); + return init_path; + } + + path system_complete( const path & ph ) + { + # ifdef BOOST_WINDOWS + if ( ph.empty() ) return ph; + char buf[MAX_PATH]; + char * pfn; + std::size_t len = ::GetFullPathNameA( ph.string().c_str(), + sizeof(buf) , buf, &pfn ); + if ( !len ) + { boost::throw_exception( + filesystem_error( "boost::filesystem::system_complete", + ph, "size is 0" ) ); } + buf[len] = '\0'; + return path( buf, native ); + # else + return (ph.empty() || ph.is_complete()) + ? ph : current_path() / ph; + # endif + } + + path complete( const path & ph, const path & base ) + { + assert( base.is_complete() + && (ph.is_complete() || !ph.has_root_name()) ); // precondition + # ifdef BOOST_WINDOWS + if (ph.empty() || ph.is_complete()) return ph; + if ( !ph.has_root_name() ) + return ph.has_root_directory() + ? path( base.root_name(), native ) / ph + : base / ph; + return base / ph; + # else + return (ph.empty() || ph.is_complete()) ? ph : base / ph; + # endif + } } // namespace filesystem } // namespace boost Index: path_posix_windows.cpp =================================================================== RCS file: /cvsroot/cpptool/rfta/deplib/boostcvs/libs/filesystem/src/path_posix_windows.cpp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** path_posix_windows.cpp 23 Oct 2002 20:22:58 -0000 1.1.1.1 --- path_posix_windows.cpp 1 Apr 2003 08:25:51 -0000 1.2 *************** *** 7,11 **** // suitability for any purpose. ! // See http://www.boost.org for most recent version including documentation. --- 7,11 ---- // suitability for any purpose. ! // See http://www.boost.org/libs/filesystem for documentation. *************** *** 20,28 **** //****************************************************************************// ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use, not the current ! // operating system. GCC defaults to BOOST_POSIX; it doesn't predefine _WIN32. ! # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) ! # if defined(_WIN32) # define BOOST_WINDOWS # else --- 20,26 ---- //****************************************************************************// ! // BOOST_POSIX or BOOST_WINDOWS specify which API to use. # if !defined( BOOST_WINDOWS ) && !defined( BOOST_POSIX ) ! # if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) # define BOOST_WINDOWS # else *************** *** 41,44 **** --- 39,44 ---- #endif + #include <boost/throw_exception.hpp> + #include <cstring> // SGI MIPSpro compilers need this #include <vector> #include <cassert> *************** *** 50,54 **** // POSIX & Windows cases: "", "/", "/foo", "foo", "foo/bar" // Windows only cases: "c:", "c:/", "c:foo", "c:/foo", ! // "prn:", "//share", "//share/foo" std::string::size_type leaf_pos( const std::string & str, --- 50,54 ---- // POSIX & Windows cases: "", "/", "/foo", "foo", "foo/bar" // Windows only cases: "c:", "c:/", "c:foo", "c:/foo", ! // "prn:", "//share", "//share/", "//share/foo" std::string::size_type leaf_pos( const std::string & str, *************** *** 56,69 **** // return 0 if str itself is leaf (or empty) { ! if ( (end_pos == 1 && str[0] == '/') ! # ifdef BOOST_WINDOWS ! || (end_pos > 1 // drive or device ! && (str[end_pos-1] == ':' || str[end_pos-2] == ':')) ! # endif ! ) return 0; ! std::string::size_type pos( str.find_last_of( '/', end_pos-1 ) ); # ifdef BOOST_WINDOWS ! if ( pos == std::string::npos ) pos = str.find_last_of( ':', end_pos-1 ); # endif --- 56,64 ---- // return 0 if str itself is leaf (or empty) { ! if ( end_pos && str[end_pos-1] == '/' ) return end_pos-1; ! std::string::size_type pos( str.find_last_of( '/', end_pos-1 ) ); # ifdef BOOST_WINDOWS ! if ( pos == std::string::npos ) pos = str.find_last_of( ':', end_pos-2 ); # endif *************** *** 99,104 **** { target += *itr++; - if ( itr == src.end() ) return; - if ( *itr == '/' ) { target += *itr++; } return; } --- 94,97 ---- *************** *** 137,141 **** // error checking functions --------------------------------------------// - bool generic_name( const std::string & name ) { --- 130,133 ---- *************** *** 157,162 **** { if ( !posix_name( ph.leaf() ) ) ! throw filesystem_error( "invalid posix name: \"" ! + ph.leaf() + "\"" ); return ph; } --- 149,156 ---- { if ( !posix_name( ph.leaf() ) ) ! boost::throw_exception( filesystem_error( ! "boost::filesystem::check_posix_leaf", ! ph, "invalid posix name: \"" ! + ph.leaf() + "\"" ) ); return ph; } *************** *** 175,179 **** } ! // path implementation -------------------------------------------------// path::path( const std::string & src ) --- 169,173 ---- } ! // path implementation -----------------------------------------------------// path::path( const std::string & src ) *************** *** 197,201 **** } ! path & path::operator <<=( const path & rhs ) { m_path_append( rhs.m_path, nocheck ); --- 191,195 ---- } ! path & path::operator /=( const path & rhs ) { m_path_append( rhs.m_path, nocheck ); *************** *** 215,243 **** std::string::const_iterator itr( src.begin() ); ! // system-specific-root like drive: or first slash of //share ! if ( context != generic ) { ! if ( *itr == '/' # ifdef BOOST_WINDOWS || (*itr == '\\' && context == platform) # endif ! ) { ++itr; m_path += '/'; } ! else if ( itr+1 != src.end() && *(itr+1) == ':' ) ! { m_path += *itr++; m_path += *itr++; } ! ! # ifdef BOOST_WINDOWS ! // "/" or second slash of //share ! if ( *itr == '/' || (*itr == '\\' && context == platform) ) ! { ++itr; m_path += '/';} ! # endif ! ! if ( itr == src.end() ) return; } ! // relative-path ::= element { "/" element } while ( itr != src.end() ) { // append '/' if needed ! if ( !is_null() // append '/' && *(m_path.end()-1) != ':' && *(m_path.end()-1) != '/' ) m_path += '/'; --- 209,263 ---- std::string::const_iterator itr( src.begin() ); ! // [root-filesystem] ! # ifdef BOOST_WINDOWS ! if ( context != generic && src.size() >= 2 ) { ! // drive or device ! if ( src[1] == ':' || src[src.size()-1] == ':' ) ! { ! for ( ; *itr != ':'; ++itr ) m_path += *itr; ! m_path += ':'; ! ++itr; ! } ! ! // share ! else if ( (*itr == '/' || (*itr == '\\' && context == platform)) ! && (*(itr+1) == '/' || (*(itr+1) == '\\' && context == platform)) ) ! { ! m_path += "//"; ! for ( itr += 2; ! itr != src.end() && *itr != '/' && *itr != '\\'; ! ++itr ) m_path += *itr; ! } ! } ! # endif ! ! // root directory [ "/" ] ! if ( itr != src.end() && (*itr == '/' # ifdef BOOST_WINDOWS || (*itr == '\\' && context == platform) # endif ! ) ) ! { ! ++itr; ! if ( m_path.size() == 0 ! # ifdef BOOST_WINDOWS ! || m_path[m_path.size()-1] == ':' // drive or device ! || ( // share ! m_path.size() > 2 ! && m_path[0] == '/' ! && m_path[1] == '/' ! && m_path.find( '/', 2 ) == std::string::npos ! ) ! # endif ! ) m_path += '/'; } ! // element { "/" element } [ "/" ] while ( itr != src.end() ) { + // append '/' if needed ! if ( !empty() && *(m_path.end()-1) != ':' && *(m_path.end()-1) != '/' ) m_path += '/'; *************** *** 278,282 **** ++itr; } // ".." ! else // name { std::string name; --- 298,302 ---- ++itr; } // ".." ! else // element is name { std::string name; *************** *** 291,296 **** if ( context == generic && !generic_name( name ) ) { ! throw filesystem_error( "invalid path name: \"" ! + src + "\"" ); } --- 311,317 ---- if ( context == generic && !generic_name( name ) ) { ! boost::throw_exception( filesystem_error( ! "boost::filesystem::path", ! "invalid name \"" + name + "\" in path: \"" + src + "\"" ) ); } *************** *** 299,313 **** if ( itr != src.end() ) ! { ! if ( !( (*itr == '/' ! # ifdef BOOST_WINDOWS ! || (context == platform && *itr == '\\') ! # endif ! ) && (itr+1) != src.end() ) ) ! { ! throw filesystem_error( "invalid path syntax: \"" ! + src + "\"" ); ! } ! ++itr; } --- 320,333 ---- if ( itr != src.end() ) ! { ! if ( *itr == '/' ! # ifdef BOOST_WINDOWS ! || (*itr == '\\' && context == platform) ! # endif ! ) ++itr; ! else ! boost::throw_exception( filesystem_error( ! "boost::filesystem::path", ! "invalid path syntax: \"" + src + "\"" ) ); } *************** *** 315,319 **** } ! const path::iterator path::begin() const { iterator itr; --- 335,359 ---- } ! // path conversion functions ------------------------------------------------// ! ! std::string path::native_file_string() const ! { ! # ifdef BOOST_WINDOWS ! std::string s( m_path ); ! for ( std::string::iterator itr( s.begin() ); ! itr != s.end(); ++itr ) ! if ( *itr == '/' ) *itr = '\\'; ! return s; ! # else ! return m_path; ! # endif ! } ! ! std::string path::native_directory_string() const ! { return native_file_string(); } ! ! // path decomposition functions ---------------------------------------------// ! ! path::iterator path::begin() const { iterator itr; *************** *** 330,362 **** } ! const std::string path::leaf() const { return m_path.substr( leaf_pos( m_path, m_path.size() ) ); } ! const path path::branch() const { ! std::string::size_type len( leaf_pos( m_path, m_path.size() ) ); ! ! if ( len > 1 // unless delimiter is part of root, don't include it # ifdef BOOST_WINDOWS ! && m_path[len-1] != ':' ! && m_path[len-2] != ':' # endif ! ) --len; ! return path( m_path.substr( 0, len ), system_specific ); } ! //bool path::is_absolute() const ! //{ ! // return ( m_path.size() ! // && m_path[0] == '/' ) // covers both "/" and "//share" ! // || ( m_path.size() > 2 ! // && m_path[1] == ':' ! // && m_path[2] == '/' ) // "c:/" ! // || ( m_path.size() > 3 ! // && m_path[m_path.size()-1] == ':' ); // "device:" ! //} namespace detail --- 370,524 ---- } ! std::string path::leaf() const { return m_path.substr( leaf_pos( m_path, m_path.size() ) ); } ! namespace detail { ! inline bool is_absolute_root( const std::string & s, ! std::string::size_type len ) ! { ! return ! len && s[len-1] == '/' ! && ! ( ! len == 1 // "/" ! # ifdef BOOST_WINDOWS ! || ( len > 1 ! && ( s[len-2] == ':' // drive or device ! || ( s[0] == '/' // share ! && s[1] == '/' ! && s.find( '/', 2 ) == len-1 ! ) ! ) ! ) ! # endif ! ); ! } ! } ! ! path path::branch_path() const ! { ! std::string::size_type end_pos( leaf_pos( m_path, m_path.size() ) ); ! ! // skip a '/' unless it is a root directory ! if ( end_pos && m_path[end_pos-1] == '/' ! && !detail::is_absolute_root( m_path, end_pos ) ) --end_pos; ! return path( m_path.substr( 0, end_pos ), native ); ! } ! ! path path::relative_path() const ! { ! std::string::size_type pos( 0 ); ! if ( m_path.size() && m_path[0] == '/' ) ! { pos = 1; # ifdef BOOST_WINDOWS ! if ( m_path.size()>1 && m_path[1] == '/' ) // share ! { ! if ( (pos = m_path.find( '/', 2 )) != std::string::npos ) ++pos; ! else return path(); ! } ! } ! else if ( (pos = m_path.find( ':' )) == std::string::npos ) pos = 0; ! else // has ':' ! { ! if ( ++pos < m_path.size() && m_path[pos] == '/' ) ++pos; # endif ! } ! return path( m_path.substr( pos ) ); ! } ! std::string path::root_name() const ! { ! # ifdef BOOST_WINDOWS ! std::string::size_type pos( m_path.find( ':' ) ); ! if ( pos != std::string::npos ) return m_path.substr( 0, pos+1 ); ! if ( m_path.size() > 2 && m_path[0] == '/' && m_path[1] == '/' ) ! { ! pos = m_path.find( '/', 2 ); ! return m_path.substr( 0, pos ); ! } ! # endif ! return std::string(); } ! std::string path::root_directory() const ! { ! return std::string( ! ( m_path.size() && m_path[0] == '/' ) // covers both "/" and "//share" ! # ifdef BOOST_WINDOWS ! || ( m_path.size() > 2 ! && m_path[1] == ':' ! && m_path[2] == '/' ) // "c:/" ! # endif ! ? "/" : "" ); ! } ! ! path path::root_path() const ! { ! return path( ! # ifdef BOOST_WINDOWS ! root_name(), native ) /= root_directory(); ! # else ! root_directory() ); ! # endif ! } ! ! // path query functions -----------------------------------------------------// ! ! bool path::is_complete() const ! { ! # ifdef BOOST_WINDOWS ! return m_path.size() > 2 ! && ( (m_path[1] == ':' && m_path[2] == '/') // "c:/" ! || (m_path[0] == '/' && m_path[1] == '/') // "//share" ! || m_path[m_path.size()-1] == ':' ); ! # else ! return m_path.size() && m_path[0] == '/'; ! # endif ! } ! ! bool path::has_root_path() const ! { ! return ( m_path.size() ! && m_path[0] == '/' ) // covers both "/" and "//share" ! # ifdef BOOST_WINDOWS ! || ( m_path.size() > 1 && m_path[1] == ':' ) // "c:" and "c:/" ! || ( m_path.size() > 3 ! && m_path[m_path.size()-1] == ':' ) // "device:" ! # endif ! ; ! } ! ! bool path::has_root_name() const ! { ! # ifdef BOOST_WINDOWS ! return m_path.size() > 1 ! && ( m_path[1] == ':' // "c:" ! || m_path[m_path.size()-1] == ':' // "prn:" ! || (m_path[0] == '/' && m_path[1] == '/') // "//share" ! ); ! # else ! return false; ! # endif ! } ! ! bool path::has_root_directory() const ! { ! return ( m_path.size() ! && m_path[0] == '/' ) // covers both "/" and "//share" ! # ifdef BOOST_WINDOWS ! || ( m_path.size() > 2 ! && m_path[1] == ':' && m_path[2] == '/' ) // "c:/" ! # endif ! ; ! } ! ! bool path::has_relative_path() const { return !relative_path().empty(); } ! bool path::has_branch_path() const { return !branch_path().empty(); } ! ! ! // path_itr_imp implementation ----------------------------------------------// namespace detail *************** *** 371,375 **** return; } ! if ( path_ptr->m_path[pos] == '/' ) ++pos; std::string::size_type end_pos( path_ptr->m_path.find( '/', pos ) ); if ( end_pos == std::string::npos ) end_pos = path_ptr->m_path.size(); --- 533,548 ---- return; } ! if ( path_ptr->m_path[pos] == '/' ) ! { ! # ifdef BOOST_WINDOWS ! if ( name[name.size()-1] == ':' // drive or device ! || (name[0] == '/' && name[1] == '/') ) // share ! { ! name = "/"; ! return; ! } ! # endif ! ++pos; ! } std::string::size_type end_pos( path_ptr->m_path.find( '/', pos ) ); if ( end_pos == std::string::npos ) end_pos = path_ptr->m_path.size(); *************** *** 381,391 **** assert( pos ); // detect decrement of begin std::string::size_type end_pos( pos ); ! if ( end_pos != path_ptr->m_path.size() ! && end_pos > 1 ! # ifdef BOOST_WINDOWS ! && path_ptr->m_path[end_pos-1] != ':' ! && path_ptr->m_path[end_pos-2] != ':' ! # endif ! ) --end_pos; pos = leaf_pos( path_ptr->m_path, end_pos ); name = path_ptr->m_path.substr( pos, end_pos - pos ); --- 554,561 ---- assert( pos ); // detect decrement of begin std::string::size_type end_pos( pos ); ! ! // skip a '/' unless it is a root directory ! if ( path_ptr->m_path[end_pos-1] == '/' ! && !detail::is_absolute_root( path_ptr->m_path, end_pos ) ) --end_pos; pos = leaf_pos( path_ptr->m_path, end_pos ); name = path_ptr->m_path.substr( pos, end_pos - pos ); |
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 --------------------------------------------------------// |
From: <bl...@us...> - 2003-04-01 08:23:25
|
Update of /cvsroot/cpptool/rfta/src/pyrfta In directory sc8-pr-cvs1:/tmp/cvs-serv16513/pyrfta Log Message: Directory /cvsroot/cpptool/rfta/src/pyrfta added to the repository |