|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58502 - in sandbox/filesystem-v3: boost/filesystem libs/filesystem/doc libs/filesystem/src libs/filesystem/test libs/filesystem/test/msvc libs/filesystem/test/msvc/tut0 libs/filesystem/test/msvc/tut1 libs/filesystem/test/msvc/tut2 libs/filesystem/test/msvc/tut3 libs/filesystem/test/msvc/tut4 libs/filesystem/tutorial
From: bdawes_at_[hidden]
Date: 2009-12-22 17:03:37
Author: bemandawes
Date: 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
New Revision: 58502
URL: http://svn.boost.org/trac/boost/changeset/58502
Log:
Work in progress, including new tutorial programs, additional docs
Added:
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/
sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/
sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/tut1_crash.jpg (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp (contents, props changed)
sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp (contents, props changed)
Text files modified:
sandbox/filesystem-v3/boost/filesystem/config.hpp | 13 +-
sandbox/filesystem-v3/boost/filesystem/path.hpp | 4
sandbox/filesystem-v3/libs/filesystem/doc/index.htm | 4
sandbox/filesystem-v3/libs/filesystem/doc/reference.html | 6
sandbox/filesystem-v3/libs/filesystem/doc/v3.html | 32 +++++
sandbox/filesystem-v3/libs/filesystem/src/path.cpp | 154 ++++++++++++++--------------
sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp | 213 +++++++++++++++++++--------------------
sandbox/filesystem-v3/libs/filesystem/test/msvc/filesystem-v3-sandbox.sln | 54 ++++-----
sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp | 12 +
9 files changed, 260 insertions(+), 232 deletions(-)
Modified: sandbox/filesystem-v3/boost/filesystem/config.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/config.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/config.hpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -38,8 +38,9 @@
# if defined( BOOST_WINDOWS_API ) && defined( BOOST_POSIX_API )
# error both BOOST_WINDOWS_API and BOOST_POSIX_API are defined
# elif !defined( BOOST_WINDOWS_API ) && !defined( BOOST_POSIX_API )
-# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define BOOST_WINDOWS_API
+# if defined(_WIN32)||defined(__WIN32__)||defined(WIN32) // true for all Windows
+ // compilers, including MingW
+# define BOOST_WINDOWS_API
# else
# define BOOST_POSIX_API
# endif
@@ -49,10 +50,10 @@
# error Boost.Filesystem V3 and later requires std::wstring support
# endif
-// BOOST_WINDOWS_PATH enables Windows path syntax recognition
-
-// filesystem.v2 defined BOOST_WINDOWS_PATH unconditionally for __CYGWIN__, but
-// that isn't possible for v3 because BOOST_WINDOWS_PATH requires wstring support
+// BOOST_WINDOWS_PATH enables Windows path syntax recognition.
+// BOOST_WINDOWS_API always imples BOOST_WINDOWS_PATH, but BOOST_WINDOWS_PATH is also
+// defined for Cygwin, even though it uses BOOST_POSIX_API, because it is a Windows only
+// environment.
# if !defined(BOOST_POSIX_PATH) && (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) \
|| defined(__CYGWIN__))
Modified: sandbox/filesystem-v3/boost/filesystem/path.hpp
==============================================================================
--- sandbox/filesystem-v3/boost/filesystem/path.hpp (original)
+++ sandbox/filesystem-v3/boost/filesystem/path.hpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -411,6 +411,7 @@
# if !defined(BOOST_FILESYSTEM_NO_DEPRECATED)
// recently deprecated functions supplied by default
+ path& normalize() { return m_normalize(); }
path& remove_leaf() { return remove_filename(); }
path leaf() const { return filename(); }
path branch_path() const { return parent_path(); }
@@ -437,7 +438,6 @@
//static void default_name_check(name_check) {}
//static name_check default_name_check() { return 0; }
//basic_path& canonize();
- //basic_path& normalize();
# endif
//--------------------------------------------------------------------------------------//
@@ -471,7 +471,7 @@
string_type::size_type m_parent_path_end() const;
void m_portable();
- //path& m_normalize();
+ path& m_normalize();
// Was qualified; como433beta8 reports:
// warning #427-D: qualified name is not allowed in member declaration
Modified: sandbox/filesystem-v3/libs/filesystem/doc/index.htm
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/index.htm (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/index.htm 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -81,7 +81,7 @@
<p>Programs using the library are <b><i>portable</i></b>, both in the sense that
the syntax of program code is portable, and the sense that the semantics or
behavior of code is portable. The <a href="reference.html">generic path
-grammar</a> is another important aid to portability.</p>
+grammar</a> is an important aid to portability.</p>
<p>Usage is <i><b>safe</b></i> in the sense that errors cannot be ignored since most functions throw C++
exceptions when errors are detected. This is also convenient for users because
@@ -802,7 +802,7 @@
<hr>
<p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->12 December, 2009<!--webbot bot="Timestamp" endspan i-checksum="38514" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->22 December, 2009<!--webbot bot="Timestamp" endspan i-checksum="38515" --></p>
<p>© Copyright Beman Dawes, 2002-2005</p>
<p> Use, modification, and distribution are subject to the Boost Software
Modified: sandbox/filesystem-v3/libs/filesystem/doc/reference.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/reference.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/reference.html 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -1606,12 +1606,10 @@
{
class directory_iterator
: public boost::iterator_facade< directory_iterator,
- directory_entry,
+ directory_entry,
boost::single_pass_traversal_tag >
{
public:
- typedef Path path_type;
-
// member functions
directory_iterator(); // creates the "end" iterator
@@ -3310,7 +3308,7 @@
<p>Distributed under the Boost Software License, Version 1.0. See
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
<p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->12 December 2009<!--webbot bot="Timestamp" endspan i-checksum="39737" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->22 December 2009<!--webbot bot="Timestamp" endspan i-checksum="39738" --></p>
</body>
Modified: sandbox/filesystem-v3/libs/filesystem/doc/v3.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/v3.html (original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/v3.html 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -15,7 +15,7 @@
<a href="../../../index.htm">
<img src="../../../boost.png" alt="boost.png (6897 bytes)" align="middle" width="277" height="86" border="0"></a></td>
<td width="633" align="middle">
- <font size="7">Filesystem Library<br>
+ <font size="7">Filesystem
Version 3<br>
</font></td>
</tr>
@@ -57,12 +57,40 @@
</li>
</ul>
+<h2>Breaking changes</h2>
+<h3>Class <code>path</code></h3>
+<ul>
+ <li>Class template <code>basic_path</code> and its specializations are gone.
+ <span style="background-color: #FFFF00">...</span></li>
+ <li>Certain functions now return <code>path</code> objects rather than <code>
+ basic_string</code> objects:<ul>
+ <li><code>root_name()</code></li>
+ <li><code>root_directory()</code></li>
+ <li><code>filename()</code></li>
+ <li><code>stem()</code></li>
+ <li><code>extension()</code></li>
+ </ul>
+ </li>
+ <li> <code>path::iterator::value_type</code> and <code>
+ path::const_iterator::value_type</code> is <code>path</code> rather than <code>
+ basic_string</code>.</li>
+</ul>
+<h3>Compiler support</h3>
+<ul>
+ <li>Compilers and standard libraries that do not fully support wide characters
+ and wide character strings (<code>wstring</code>) are no longer supported.
+ This impacts primarily Cygwin users; versions prior to 1.7 are no longer
+ supported.<br>
+ </li>
+ <li>Microsoft VC++ 7.1 and earlier are not currently supported.</li>
+</ul>
+
<hr>
<p>© Copyright Beman Dawes, 2009</p>
<p>Distributed under the Boost Software License, Version 1.0. See
<a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a></p>
<p>Revised
-<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->12 December 2009<!--webbot bot="Timestamp" endspan i-checksum="39737" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->22 December 2009<!--webbot bot="Timestamp" endspan i-checksum="39738" --></p>
</body>
Modified: sandbox/filesystem-v3/libs/filesystem/src/path.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/path.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/path.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -94,20 +94,20 @@
;
}
- bool is_non_root_separator(const string_type & str, size_type pos);
+ bool is_non_root_separator(const string_type& str, size_type pos);
// pos is position of the separator
- size_type filename_pos(const string_type & str,
+ size_type filename_pos(const string_type& str,
size_type end_pos); // end_pos is past-the-end position
// Returns: 0 if str itself is filename (or empty)
- size_type root_directory_start(const string_type & path, size_type size);
+ size_type root_directory_start(const string_type& path, size_type size);
// Returns: npos if no root_directory found
void first_element(
- const string_type & src,
- size_type & element_pos,
- size_type & element_size,
+ const string_type& src,
+ size_type& element_pos,
+ size_type& element_size,
# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) // VC++ 7.1
size_type size = string_type::npos
# else
@@ -345,75 +345,73 @@
return *this;
}
-//
-// // m_normalize ------------------------------------------------------------//
-// //
-//
-// path & path::m_normalize()
-// {
-// if (m_path.empty()) return *this;
-//
-// path_type temp;
-// iterator start(begin());
-// iterator last(end());
-// iterator stop(last--);
-// for (iterator itr(start); itr != stop; ++itr)
-// {
-// // ignore "." except at start and last
-// if (itr->size() == 1
-// && (*itr)[0] == dot
-// && itr != start
-// && itr != last) continue;
-//
-// // ignore a name and following ".."
-// if (!temp.empty()
-// && itr->size() == 2
-// && (*itr)[0] == dot
-// && (*itr)[1] == dot) // dot dot
-// {
-// string_type lf(temp.filename());
-// if (lf.size() > 0
-// && (lf.size() != 1
-// || (lf[0] != dot
-// && lf[0] != separator))
-// && (lf.size() != 2
-// || (lf[0] != dot
-// && lf[1] != dot
-//# ifdef BOOST_WINDOWS_PATH
-// && lf[1] != colon
-//# endif
-// )
-// )
-// )
-// {
-// temp.remove_filename();
-// // if not root directory, must also remove "/" if any
-// if (temp.m_path.size() > 0
-// && temp.m_path[temp.m_path.size()-1]
-// == separator)
-// {
-// typename string_type::size_type rds(
-// detail::root_directory_start<String,Traits>(temp.m_path,
-// temp.m_path.size()));
-// if (rds == string_type::npos
-// || rds != temp.m_path.size()-1)
-// { temp.m_path.erase(temp.m_path.size()-1); }
-// }
-//
-// iterator next(itr);
-// if (temp.empty() && ++next != stop
-// && next == last && *last == dot_str) temp /= dot_str;
-// continue;
-// }
-// }
-//
-// temp /= *itr;
-// };
-//
-// if (temp.empty()) temp /= dot_str;
-// m_path = temp.m_path;
-// return *this;
-// }
+
+ // m_normalize ----------------------------------------------------------------------//
+
+ path& path::m_normalize()
+ {
+ if (m_path.empty()) return *this;
+
+ path temp;
+ iterator start(begin());
+ iterator last(end());
+ iterator stop(last--);
+ for (iterator itr(start); itr != stop; ++itr)
+ {
+ // ignore "." except at start and last
+ if (itr->native().size() == 1
+ && (itr->native())[0] == dot
+ && itr != start
+ && itr != last) continue;
+
+ // ignore a name and following ".."
+ if (!temp.empty()
+ && itr->native().size() == 2
+ && (itr->native())[0] == dot
+ && (itr->native())[1] == dot) // dot dot
+ {
+ string_type lf(temp.filename().native());
+ if (lf.size() > 0
+ && (lf.size() != 1
+ || (lf[0] != dot
+ && lf[0] != separator))
+ && (lf.size() != 2
+ || (lf[0] != dot
+ && lf[1] != dot
+# ifdef BOOST_WINDOWS_PATH
+ && lf[1] != colon
+# endif
+ )
+ )
+ )
+ {
+ temp.remove_filename();
+ // if not root directory, must also remove "/" if any
+ if (temp.m_path.size() > 0
+ && temp.m_path[temp.m_path.size()-1]
+ == separator)
+ {
+ string_type::size_type rds(
+ root_directory_start(temp.m_path, temp.m_path.size()));
+ if (rds == string_type::npos
+ || rds != temp.m_path.size()-1)
+ { temp.m_path.erase(temp.m_path.size()-1); }
+ }
+
+ iterator next(itr);
+ if (temp.empty() && ++next != stop
+ && next == last && *last == dot_path) temp /= dot_path;
+ continue;
+ }
+ }
+
+ temp /= *itr;
+ };
+
+ if (temp.empty()) temp /= dot_path;
+ m_path = temp.m_path;
+ return *this;
+ }
} // namespace filesystem
} // namespace boost
@@ -448,7 +446,7 @@
;
}
- // filename_pos ----------------------------------------------------------//
+ // filename_pos --------------------------------------------------------------------//
size_type filename_pos(const string_type & str,
size_type end_pos) // end_pos is past-the-end position
@@ -477,7 +475,7 @@
: pos + 1; // or starts after delimiter
}
- // root_directory_start --------------------------------------------------//
+ // root_directory_start ------------------------------------------------------------//
size_type root_directory_start(const string_type & path, size_type size)
// return npos if no root_directory found
@@ -511,7 +509,7 @@
return string_type::npos;
}
- // first_element ----------------------------------------------------------//
+ // first_element --------------------------------------------------------------------//
// sets pos and len of first element, excluding extra separators
// if src.empty(), sets pos,len, to 0,0.
Modified: sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -37,111 +37,111 @@
<< "\"" << std::endl;
}
- //void check_normalize()
- //{
- // PATH_CHECK(path("").normalize(), "");
- // PATH_CHECK(path("/").normalize(), "/");
- // PATH_CHECK(path("//").normalize(), "//");
- // PATH_CHECK(path("///").normalize(), "/");
- // PATH_CHECK(path("f").normalize(), "f");
- // PATH_CHECK(path("foo").normalize(), "foo");
- // PATH_CHECK(path("foo/").normalize(), "foo/.");
- // PATH_CHECK(path("f/").normalize(), "f/.");
- // PATH_CHECK(path("/foo").normalize(), "/foo");
- // PATH_CHECK(path("foo/bar").normalize(), "foo/bar");
- // PATH_CHECK(path("..").normalize(), "..");
- // PATH_CHECK(path("../..").normalize(), "../..");
- // PATH_CHECK(path("/..").normalize(), "/..");
- // PATH_CHECK(path("/../..").normalize(), "/../..");
- // PATH_CHECK(path("../foo").normalize(), "../foo");
- // PATH_CHECK(path("foo/..").normalize(), ".");
- // PATH_CHECK(path("foo/../").normalize(), "./.");
- // PATH_CHECK((path("foo") / "..").normalize() , ".");
- // PATH_CHECK(path("foo/...").normalize(), "foo/...");
- // PATH_CHECK(path("foo/.../").normalize(), "foo/.../.");
- // PATH_CHECK(path("foo/..bar").normalize(), "foo/..bar");
- // PATH_CHECK(path("../f").normalize(), "../f");
- // PATH_CHECK(path("/../f").normalize(), "/../f");
- // PATH_CHECK(path("f/..").normalize(), ".");
- // PATH_CHECK((path("f") / "..").normalize() , ".");
- // PATH_CHECK(path("foo/../..").normalize(), "..");
- // PATH_CHECK(path("foo/../../").normalize(), "../.");
- // PATH_CHECK(path("foo/../../..").normalize(), "../..");
- // PATH_CHECK(path("foo/../../../").normalize(), "../../.");
- // PATH_CHECK(path("foo/../bar").normalize(), "bar");
- // PATH_CHECK(path("foo/../bar/").normalize(), "bar/.");
- // PATH_CHECK(path("foo/bar/..").normalize(), "foo");
- // PATH_CHECK(path("foo/bar/../").normalize(), "foo/.");
- // PATH_CHECK(path("foo/bar/../..").normalize(), ".");
- // PATH_CHECK(path("foo/bar/../../").normalize(), "./.");
- // PATH_CHECK(path("foo/bar/../blah").normalize(), "foo/blah");
- // PATH_CHECK(path("f/../b").normalize(), "b");
- // PATH_CHECK(path("f/b/..").normalize(), "f");
- // PATH_CHECK(path("f/b/../").normalize(), "f/.");
- // PATH_CHECK(path("f/b/../a").normalize(), "f/a");
- // PATH_CHECK(path("foo/bar/blah/../..").normalize(), "foo");
- // PATH_CHECK(path("foo/bar/blah/../../bletch").normalize(), "foo/bletch");
- // PATH_CHECK(path("//net").normalize(), "//net");
- // PATH_CHECK(path("//net/").normalize(), "//net/");
- // PATH_CHECK(path("//..net").normalize(), "//..net");
- // PATH_CHECK(path("//net/..").normalize(), "//net/..");
- // PATH_CHECK(path("//net/foo").normalize(), "//net/foo");
- // PATH_CHECK(path("//net/foo/").normalize(), "//net/foo/.");
- // PATH_CHECK(path("//net/foo/..").normalize(), "//net/");
- // PATH_CHECK(path("//net/foo/../").normalize(), "//net/.");
-
- // PATH_CHECK(path("/net/foo/bar").normalize(), "/net/foo/bar");
- // PATH_CHECK(path("/net/foo/bar/").normalize(), "/net/foo/bar/.");
- // PATH_CHECK(path("/net/foo/..").normalize(), "/net");
- // PATH_CHECK(path("/net/foo/../").normalize(), "/net/.");
-
- // PATH_CHECK(path("//net//foo//bar").normalize(), "//net/foo/bar");
- // PATH_CHECK(path("//net//foo//bar//").normalize(), "//net/foo/bar/.");
- // PATH_CHECK(path("//net//foo//..").normalize(), "//net/");
- // PATH_CHECK(path("//net//foo//..//").normalize(), "//net/.");
-
- // PATH_CHECK(path("///net///foo///bar").normalize(), "/net/foo/bar");
- // PATH_CHECK(path("///net///foo///bar///").normalize(), "/net/foo/bar/.");
- // PATH_CHECK(path("///net///foo///..").normalize(), "/net");
- // PATH_CHECK(path("///net///foo///..///").normalize(), "/net/.");
-
- // if (platform == "Windows")
- // {
- // PATH_CHECK(path("c:..").normalize(), "c:..");
- // PATH_CHECK(path("c:foo/..").normalize(), "c:");
-
- // PATH_CHECK(path("c:foo/../").normalize(), "c:.");
-
- // PATH_CHECK(path("c:/foo/..").normalize(), "c:/");
- // PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
- // PATH_CHECK(path("c:/..").normalize(), "c:/..");
- // PATH_CHECK(path("c:/../").normalize(), "c:/../.");
- // PATH_CHECK(path("c:/../..").normalize(), "c:/../..");
- // PATH_CHECK(path("c:/../../").normalize(), "c:/../../.");
- // PATH_CHECK(path("c:/../foo").normalize(), "c:/../foo");
- // PATH_CHECK(path("c:/../foo/").normalize(), "c:/../foo/.");
- // PATH_CHECK(path("c:/../../foo").normalize(), "c:/../../foo");
- // PATH_CHECK(path("c:/../../foo/").normalize(), "c:/../../foo/.");
- // PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
- // }
- // else // POSIX
- // {
- // PATH_CHECK(path("c:..").normalize(), "c:..");
- // PATH_CHECK(path("c:foo/..").normalize(), ".");
- // PATH_CHECK(path("c:foo/../").normalize(), "./.");
- // PATH_CHECK(path("c:/foo/..").normalize(), "c:");
- // PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
- // PATH_CHECK(path("c:/..").normalize(), ".");
- // PATH_CHECK(path("c:/../").normalize(), "./.");
- // PATH_CHECK(path("c:/../..").normalize(), "..");
- // PATH_CHECK(path("c:/../../").normalize(), "../.");
- // PATH_CHECK(path("c:/../foo").normalize(), "foo");
- // PATH_CHECK(path("c:/../foo/").normalize(), "foo/.");
- // PATH_CHECK(path("c:/../../foo").normalize(), "../foo");
- // PATH_CHECK(path("c:/../../foo/").normalize(), "../foo/.");
- // PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
- // }
- //}
+ void normalize_test()
+ {
+ PATH_CHECK(path("").normalize(), "");
+ PATH_CHECK(path("/").normalize(), "/");
+ PATH_CHECK(path("//").normalize(), "//");
+ PATH_CHECK(path("///").normalize(), "/");
+ PATH_CHECK(path("f").normalize(), "f");
+ PATH_CHECK(path("foo").normalize(), "foo");
+ PATH_CHECK(path("foo/").normalize(), "foo/.");
+ PATH_CHECK(path("f/").normalize(), "f/.");
+ PATH_CHECK(path("/foo").normalize(), "/foo");
+ PATH_CHECK(path("foo/bar").normalize(), "foo/bar");
+ PATH_CHECK(path("..").normalize(), "..");
+ PATH_CHECK(path("../..").normalize(), "../..");
+ PATH_CHECK(path("/..").normalize(), "/..");
+ PATH_CHECK(path("/../..").normalize(), "/../..");
+ PATH_CHECK(path("../foo").normalize(), "../foo");
+ PATH_CHECK(path("foo/..").normalize(), ".");
+ PATH_CHECK(path("foo/../").normalize(), "./.");
+ PATH_CHECK((path("foo") / "..").normalize() , ".");
+ PATH_CHECK(path("foo/...").normalize(), "foo/...");
+ PATH_CHECK(path("foo/.../").normalize(), "foo/.../.");
+ PATH_CHECK(path("foo/..bar").normalize(), "foo/..bar");
+ PATH_CHECK(path("../f").normalize(), "../f");
+ PATH_CHECK(path("/../f").normalize(), "/../f");
+ PATH_CHECK(path("f/..").normalize(), ".");
+ PATH_CHECK((path("f") / "..").normalize() , ".");
+ PATH_CHECK(path("foo/../..").normalize(), "..");
+ PATH_CHECK(path("foo/../../").normalize(), "../.");
+ PATH_CHECK(path("foo/../../..").normalize(), "../..");
+ PATH_CHECK(path("foo/../../../").normalize(), "../../.");
+ PATH_CHECK(path("foo/../bar").normalize(), "bar");
+ PATH_CHECK(path("foo/../bar/").normalize(), "bar/.");
+ PATH_CHECK(path("foo/bar/..").normalize(), "foo");
+ PATH_CHECK(path("foo/bar/../").normalize(), "foo/.");
+ PATH_CHECK(path("foo/bar/../..").normalize(), ".");
+ PATH_CHECK(path("foo/bar/../../").normalize(), "./.");
+ PATH_CHECK(path("foo/bar/../blah").normalize(), "foo/blah");
+ PATH_CHECK(path("f/../b").normalize(), "b");
+ PATH_CHECK(path("f/b/..").normalize(), "f");
+ PATH_CHECK(path("f/b/../").normalize(), "f/.");
+ PATH_CHECK(path("f/b/../a").normalize(), "f/a");
+ PATH_CHECK(path("foo/bar/blah/../..").normalize(), "foo");
+ PATH_CHECK(path("foo/bar/blah/../../bletch").normalize(), "foo/bletch");
+ PATH_CHECK(path("//net").normalize(), "//net");
+ PATH_CHECK(path("//net/").normalize(), "//net/");
+ PATH_CHECK(path("//..net").normalize(), "//..net");
+ PATH_CHECK(path("//net/..").normalize(), "//net/..");
+ PATH_CHECK(path("//net/foo").normalize(), "//net/foo");
+ PATH_CHECK(path("//net/foo/").normalize(), "//net/foo/.");
+ PATH_CHECK(path("//net/foo/..").normalize(), "//net/");
+ PATH_CHECK(path("//net/foo/../").normalize(), "//net/.");
+
+ PATH_CHECK(path("/net/foo/bar").normalize(), "/net/foo/bar");
+ PATH_CHECK(path("/net/foo/bar/").normalize(), "/net/foo/bar/.");
+ PATH_CHECK(path("/net/foo/..").normalize(), "/net");
+ PATH_CHECK(path("/net/foo/../").normalize(), "/net/.");
+
+ PATH_CHECK(path("//net//foo//bar").normalize(), "//net/foo/bar");
+ PATH_CHECK(path("//net//foo//bar//").normalize(), "//net/foo/bar/.");
+ PATH_CHECK(path("//net//foo//..").normalize(), "//net/");
+ PATH_CHECK(path("//net//foo//..//").normalize(), "//net/.");
+
+ PATH_CHECK(path("///net///foo///bar").normalize(), "/net/foo/bar");
+ PATH_CHECK(path("///net///foo///bar///").normalize(), "/net/foo/bar/.");
+ PATH_CHECK(path("///net///foo///..").normalize(), "/net");
+ PATH_CHECK(path("///net///foo///..///").normalize(), "/net/.");
+
+ if (platform == "Windows")
+ {
+ PATH_CHECK(path("c:..").normalize(), "c:..");
+ PATH_CHECK(path("c:foo/..").normalize(), "c:");
+
+ PATH_CHECK(path("c:foo/../").normalize(), "c:.");
+
+ PATH_CHECK(path("c:/foo/..").normalize(), "c:/");
+ PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
+ PATH_CHECK(path("c:/..").normalize(), "c:/..");
+ PATH_CHECK(path("c:/../").normalize(), "c:/../.");
+ PATH_CHECK(path("c:/../..").normalize(), "c:/../..");
+ PATH_CHECK(path("c:/../../").normalize(), "c:/../../.");
+ PATH_CHECK(path("c:/../foo").normalize(), "c:/../foo");
+ PATH_CHECK(path("c:/../foo/").normalize(), "c:/../foo/.");
+ PATH_CHECK(path("c:/../../foo").normalize(), "c:/../../foo");
+ PATH_CHECK(path("c:/../../foo/").normalize(), "c:/../../foo/.");
+ PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
+ }
+ else // POSIX
+ {
+ PATH_CHECK(path("c:..").normalize(), "c:..");
+ PATH_CHECK(path("c:foo/..").normalize(), ".");
+ PATH_CHECK(path("c:foo/../").normalize(), "./.");
+ PATH_CHECK(path("c:/foo/..").normalize(), "c:");
+ PATH_CHECK(path("c:/foo/../").normalize(), "c:/.");
+ PATH_CHECK(path("c:/..").normalize(), ".");
+ PATH_CHECK(path("c:/../").normalize(), "./.");
+ PATH_CHECK(path("c:/../..").normalize(), "..");
+ PATH_CHECK(path("c:/../../").normalize(), "../.");
+ PATH_CHECK(path("c:/../foo").normalize(), "foo");
+ PATH_CHECK(path("c:/../foo/").normalize(), "foo/.");
+ PATH_CHECK(path("c:/../../foo").normalize(), "../foo");
+ PATH_CHECK(path("c:/../../foo/").normalize(), "../foo/.");
+ PATH_CHECK(path("c:/..foo").normalize(), "c:/..foo");
+ }
+ }
// Compile-only tests not intended to be executed -----------------------------------//
@@ -205,8 +205,7 @@
BOOST_TEST(!fs::symbolic_link_exists("nosuchfileordirectory"));
remove_leaf_test();
-
- //check_normalize();
+ normalize_test();
// extension() tests ---------------------------------------------------------//
Modified: sandbox/filesystem-v3/libs/filesystem/test/msvc/filesystem-v3-sandbox.sln
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/msvc/filesystem-v3-sandbox.sln (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/filesystem-v3-sandbox.sln 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -52,31 +52,27 @@
{FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut_errors", "tut_errors\tut_errors.vcproj", "{B2F3B52F-A143-4BE1-9636-7AC7F75E7B63}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut0", "tut0\tut0.vcproj", "{6B5ABD07-0289-484D-BD96-6F1BC92677D3}"
ProjectSection(ProjectDependencies) = postProject
{F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
{FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut_i18n", "tut_i18n\tut_i18n.vcproj", "{CE7D7A5E-C747-4056-9908-20584923DAEB}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut1", "tut1\tut1.vcproj", "{6376B8E4-7FD4-466B-978E-E8DA6E938689}"
ProjectSection(ProjectDependencies) = postProject
{F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
{FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut_intro", "tut_intro\tut_intro.vcproj", "{B31E3591-B45E-4139-8675-60C2158A8160}"
- ProjectSection(ProjectDependencies) = postProject
- {F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
- {FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
- EndProjectSection
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut3", "tut3\tut3.vcproj", "{4FF64FA7-6806-401D-865C-79DD064D4A9E}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut_more", "tut_more\tut_more.vcproj", "{FC70A98E-428C-4B04-924F-9658969BA00C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut2", "tut2\tut2.vcproj", "{CD69B175-389E-4F8F-85DC-03C56A47CD1D}"
ProjectSection(ProjectDependencies) = postProject
{F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
{FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut_path", "tut_path\tut_path.vcproj", "{F407A97C-703F-464B-BF23-5C1DBECF887A}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tut4", "tut4\tut4.vcproj", "{256EA89A-E073-4CE8-B675-BE2FBC6B2691}"
ProjectSection(ProjectDependencies) = postProject
{F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
{FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
@@ -143,26 +139,26 @@
{709A954B-4F1E-4375-A418-BCBFFE598715}.Debug|Win32.Build.0 = Debug|Win32
{709A954B-4F1E-4375-A418-BCBFFE598715}.Release|Win32.ActiveCfg = Release|Win32
{709A954B-4F1E-4375-A418-BCBFFE598715}.Release|Win32.Build.0 = Release|Win32
- {B2F3B52F-A143-4BE1-9636-7AC7F75E7B63}.Debug|Win32.ActiveCfg = Debug|Win32
- {B2F3B52F-A143-4BE1-9636-7AC7F75E7B63}.Debug|Win32.Build.0 = Debug|Win32
- {B2F3B52F-A143-4BE1-9636-7AC7F75E7B63}.Release|Win32.ActiveCfg = Release|Win32
- {B2F3B52F-A143-4BE1-9636-7AC7F75E7B63}.Release|Win32.Build.0 = Release|Win32
- {CE7D7A5E-C747-4056-9908-20584923DAEB}.Debug|Win32.ActiveCfg = Debug|Win32
- {CE7D7A5E-C747-4056-9908-20584923DAEB}.Debug|Win32.Build.0 = Debug|Win32
- {CE7D7A5E-C747-4056-9908-20584923DAEB}.Release|Win32.ActiveCfg = Release|Win32
- {CE7D7A5E-C747-4056-9908-20584923DAEB}.Release|Win32.Build.0 = Release|Win32
- {B31E3591-B45E-4139-8675-60C2158A8160}.Debug|Win32.ActiveCfg = Debug|Win32
- {B31E3591-B45E-4139-8675-60C2158A8160}.Debug|Win32.Build.0 = Debug|Win32
- {B31E3591-B45E-4139-8675-60C2158A8160}.Release|Win32.ActiveCfg = Release|Win32
- {B31E3591-B45E-4139-8675-60C2158A8160}.Release|Win32.Build.0 = Release|Win32
- {FC70A98E-428C-4B04-924F-9658969BA00C}.Debug|Win32.ActiveCfg = Debug|Win32
- {FC70A98E-428C-4B04-924F-9658969BA00C}.Debug|Win32.Build.0 = Debug|Win32
- {FC70A98E-428C-4B04-924F-9658969BA00C}.Release|Win32.ActiveCfg = Release|Win32
- {FC70A98E-428C-4B04-924F-9658969BA00C}.Release|Win32.Build.0 = Release|Win32
- {F407A97C-703F-464B-BF23-5C1DBECF887A}.Debug|Win32.ActiveCfg = Debug|Win32
- {F407A97C-703F-464B-BF23-5C1DBECF887A}.Debug|Win32.Build.0 = Debug|Win32
- {F407A97C-703F-464B-BF23-5C1DBECF887A}.Release|Win32.ActiveCfg = Release|Win32
- {F407A97C-703F-464B-BF23-5C1DBECF887A}.Release|Win32.Build.0 = Release|Win32
+ {6B5ABD07-0289-484D-BD96-6F1BC92677D3}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6B5ABD07-0289-484D-BD96-6F1BC92677D3}.Debug|Win32.Build.0 = Debug|Win32
+ {6B5ABD07-0289-484D-BD96-6F1BC92677D3}.Release|Win32.ActiveCfg = Release|Win32
+ {6B5ABD07-0289-484D-BD96-6F1BC92677D3}.Release|Win32.Build.0 = Release|Win32
+ {6376B8E4-7FD4-466B-978E-E8DA6E938689}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6376B8E4-7FD4-466B-978E-E8DA6E938689}.Debug|Win32.Build.0 = Debug|Win32
+ {6376B8E4-7FD4-466B-978E-E8DA6E938689}.Release|Win32.ActiveCfg = Release|Win32
+ {6376B8E4-7FD4-466B-978E-E8DA6E938689}.Release|Win32.Build.0 = Release|Win32
+ {4FF64FA7-6806-401D-865C-79DD064D4A9E}.Debug|Win32.ActiveCfg = Debug|Win32
+ {4FF64FA7-6806-401D-865C-79DD064D4A9E}.Debug|Win32.Build.0 = Debug|Win32
+ {4FF64FA7-6806-401D-865C-79DD064D4A9E}.Release|Win32.ActiveCfg = Release|Win32
+ {4FF64FA7-6806-401D-865C-79DD064D4A9E}.Release|Win32.Build.0 = Release|Win32
+ {CD69B175-389E-4F8F-85DC-03C56A47CD1D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CD69B175-389E-4F8F-85DC-03C56A47CD1D}.Debug|Win32.Build.0 = Debug|Win32
+ {CD69B175-389E-4F8F-85DC-03C56A47CD1D}.Release|Win32.ActiveCfg = Release|Win32
+ {CD69B175-389E-4F8F-85DC-03C56A47CD1D}.Release|Win32.Build.0 = Release|Win32
+ {256EA89A-E073-4CE8-B675-BE2FBC6B2691}.Debug|Win32.ActiveCfg = Debug|Win32
+ {256EA89A-E073-4CE8-B675-BE2FBC6B2691}.Debug|Win32.Build.0 = Debug|Win32
+ {256EA89A-E073-4CE8-B675-BE2FBC6B2691}.Release|Win32.ActiveCfg = Release|Win32
+ {256EA89A-E073-4CE8-B675-BE2FBC6B2691}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Added: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut0/tut0.vcproj 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tut0"
+ ProjectGUID="{6B5ABD07-0289-484D-BD96-6F1BC92677D3}"
+ RootNamespace="tut0"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\tutorial\tut0.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut1/tut1.vcproj 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tut1"
+ ProjectGUID="{6376B8E4-7FD4-466B-978E-E8DA6E938689}"
+ RootNamespace="tut1"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\tutorial\tut1.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut2/tut2.vcproj 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tut2"
+ ProjectGUID="{CD69B175-389E-4F8F-85DC-03C56A47CD1D}"
+ RootNamespace="tut2"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\tutorial\tut2.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut3/tut3.vcproj 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tut3"
+ ProjectGUID="{4FF64FA7-6806-401D-865C-79DD064D4A9E}"
+ RootNamespace="tut3"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\tutorial\tut3.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Added: sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/test/msvc/tut4/tut4.vcproj 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="9.00"
+ Name="tut4"
+ ProjectGUID="{256EA89A-E073-4CE8-B675-BE2FBC6B2691}"
+ RootNamespace="tut4"
+ Keyword="Win32Proj"
+ TargetFrameworkVersion="196613"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="..\common.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ EnableIntrinsicFunctions="true"
+ AdditionalIncludeDirectories=""
+ RuntimeLibrary="2"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\..\tutorial\tut4.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
Modified: sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/operations_unit_test.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -47,11 +47,19 @@
CHECK(status("no-such-file") == file_status(file_not_found));
CHECK(exists("/"));
+ CHECK(is_directory("/"));
CHECK(!exists("no-such-file"));
- CHECK(is_directory("/"));
- CHECK(!is_directory(this_file));
+ exists(this_file, ec);
+ if (ec)
+ {
+ std::cout << "ec non-zero: " << ec.value() << ", message: "<< ec.message() << std::endl;
+ std::cout << " file: " << this_file << std::endl;
+ }
+ CHECK(!ec);
+ CHECK(exists(this_file));
+ CHECK(!is_directory(this_file));
CHECK(is_regular_file(this_file));
CHECK(!boost::filesystem::is_empty(this_file));
CHECK(!is_other(this_file));
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/tutorial/tut0.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,25 @@
+// filesystem tut0.cpp ------------------------------------------------------------- //
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2)
+ {
+ std::cout << "Usage: tut0 path\n";
+ return 1;
+ }
+
+ std::cout << argv[1] << '\n';
+
+ return 0;
+}
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/tutorial/tut1.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,25 @@
+// filesystem tut1.cpp ---------------------------------------------------------------//
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2)
+ {
+ std::cout << "Usage: tut1 path\n";
+ return 1;
+ }
+
+ std::cout << argv[1] << ": " << fs::file_size(argv[1]) << '\n';
+
+ return 0;
+}
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut1_crash.jpg
==============================================================================
Binary file. No diff available.
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/tutorial/tut2.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,36 @@
+// filesystem tut2.cpp ---------------------------------------------------------------//
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2)
+ {
+ std::cout << "Usage: tut2 path\n";
+ return 1;
+ }
+
+ std::cout << argv[1] << ": ";
+ if ( fs::exists(argv[1]) )
+ {
+ if ( fs::is_regular_file(argv[1]) )
+ std::cout << fs::file_size(argv[1]) << '\n';
+ else if ( fs::is_directory(argv[1]) )
+ std::cout << "is a directory\n";
+ else
+ std::cout << "exists, but is neither a regular file nor a directory\n";
+ }
+ else
+ std::cout << "does not exist\n";
+
+ return 0;
+}
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/tutorial/tut3.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,23 @@
+// filesystem tut0.cpp ------------------------------------------------------------- //
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+
+int main( int argc, char* argv[] )
+{
+ if ( argc < 2 )
+ {
+ std::cout << "Usage: tut0 filename\n";
+ return 1;
+ }
+
+ std::cout << argv[1] << "\n";
+
+ return 0;
+}
Added: sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/tutorial/tut4.cpp 2009-12-22 17:03:35 EST (Tue, 22 Dec 2009)
@@ -0,0 +1,42 @@
+// filesystem tut4.cpp ---------------------------------------------------------------//
+
+// Copyright Beman Dawes 2009
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+// Library home page: http://www.boost.org/libs/filesystem
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+namespace fs = boost::filesystem;
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2)
+ {
+ std::cout << "Usage: tut4 path\n";
+ return 1;
+ }
+
+ std::cout << argv[1] << ": ";
+ if ( fs::exists(argv[1]) )
+ {
+ if ( fs::is_regular_file(argv[1]) )
+ std::cout << fs::file_size(argv[1]) << '\n';
+ else if ( fs::is_directory(argv[1]) )
+ {
+ std::cout << "is a directory containing:\n";
+ for ( fs::directory_iterator it (argv[1]); it != fs::directory_iterator(); ++it )
+ {
+ std::cout << " " << it->path() << '\n';
+ }
+ }
+ else
+ std::cout << "exists, but is neither a regular file nor a directory\n";
+ }
+ else
+ std::cout << "does not exist\n";
+
+ return 0;
+}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk