|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58643 - in sandbox/filesystem-v3/libs/filesystem: doc src test
From: bdawes_at_[hidden]
Date: 2010-01-02 10:51:45
Author: bemandawes
Date: 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
New Revision: 58643
URL: http://svn.boost.org/trac/boost/changeset/58643
Log:
Rename path::is_complete to is_absolute, add is_relative
Text files modified:
sandbox/filesystem-v3/libs/filesystem/doc/reference.html | 38 +++++++++++++---------
sandbox/filesystem-v3/libs/filesystem/doc/v3.html | 12 ++++++
sandbox/filesystem-v3/libs/filesystem/src/operations.cpp | 2
sandbox/filesystem-v3/libs/filesystem/test/deprecated_test.cpp | 7 ++-
sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp | 4 +-
sandbox/filesystem-v3/libs/filesystem/test/path_test.cpp | 66 ++++++++++++++++++++--------------------
sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp | 6 ++-
7 files changed, 78 insertions(+), 57 deletions(-)
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 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -494,7 +494,8 @@
bool has_filename() const;
bool has_stem() const;
bool has_extension() const;
- bool is_complete() const;
+ bool is_absolute() const;
+ bool is_relative() const;
// iterators
class iterator;
@@ -1008,11 +1009,6 @@
<blockquote>
<p><i>Returns:</i> <code>native().empty()</code>.</p>
</blockquote>
-<pre>bool is_complete() const;</pre>
-<blockquote>
- <p><span style="background-color: #FFFFFF"><i>Returns:</i> <code>true</code>,
- if the elements of root_path() uniquely identify a directory, else <code>false</code>.</span></p>
-</blockquote>
<pre>bool has_root_path() const;</pre>
<blockquote>
<p><i>Returns:</i> <code>!root_path().empty()</code></p>
@@ -1045,6 +1041,18 @@
<blockquote>
<p><i>Returns:</i> <code>!extension().empty()</code></p>
</blockquote>
+<pre>bool is_absolute() const;</pre>
+<blockquote>
+ <p><span style="background-color: #FFFFFF"><i>Returns:</i> <code>true</code>
+ if the elements of <code>root_path()</code> uniquely identify a directory, else <code>false</code>.</span></p>
+ <p><span style="background-color: #FFFFFF">[<i>Note:</i> On POSIX,<code>
+ path("/foo").is_absolute()</code> returns <code>true</code>. On Windows, <code>
+ path("/foo").is_absolute()</code> returns <code>false</code>. <i>--end note</i>]</span></p>
+</blockquote>
+<pre>bool is_relative() const;</pre>
+<blockquote>
+ <p><span style="background-color: #FFFFFF"><i>Returns:</i> <code>!is_absolute()</code>.</span></p>
+</blockquote>
<h4> <code><font size="4">class </font></code> <a name="path-iterators"> <code>
<font size="4">path</font></code> iterators</a></h4>
<p> A <code>path::iterator</code> is a constant iterator satisfying all
@@ -1961,12 +1969,12 @@
</tr>
</table>
<p><i>Postconditions:</i> For the returned path, <code>rp,</code> <code>
- rp.is_complete()</code> is true.</p>
+ rp.is_absolute()</code> is true.</p>
<p><i>Returns:</i> The composed path.</p>
<p><i><span style="background-color: #FFFF00">Throws: </span> </i> <code>
<span style="background-color: #FFFF00">filesystem_error</span></code><span style="background-color: #FFFF00"> if
</span> <code>
- <span style="background-color: #FFFF00">!(base.is_complete() && (p.is_complete() || !p.has_root_name()))</span></code></p>
+ <span style="background-color: #FFFF00">!(base.is_absolute() && (p.is_absolute() || !p.has_root_name()))</span></code></p>
<p>[<i><a name="complete_note">Note</a>:</i> When portable behavior is
required, use <i>complete()</i>. When operating system dependent behavior is
required, use <i>system_complete()</i>.</p>
@@ -2098,7 +2106,7 @@
<p><i>Returns:</i> The current working directory path, as if by <i>POSIX</i>
<code>
<a href="http://www.opengroup.org/onlinepubs/000095399/functions/getcwd.html">
- getcwd()</a></code>. <code>is_complete()</code> is true for the returned path.</p>
+ getcwd()</a></code>. <code>is_absolute()</code> is true for the returned path.</p>
<p><i>Throws:</i> As specified in
<a href="file:///C:/boost/filesystem-v3-sandbox/libs/filesystem/doc/reference.html#Error-reporting">
Error reporting</a>.</p>
@@ -2556,7 +2564,7 @@
filename argument to standard library open functions.</p>
<p><i>Returns:</i> The composed path.</p>
<p><i>Postconditions:</i> For the returned path, <code>rp,</code> <code>
- rp.is_complete()</code> is true.</p>
+ rp.is_absolute()</code> is true.</p>
<p><i>Throws:</i> As specified in
<a href="file:///C:/boost/filesystem-v3-sandbox/libs/filesystem/doc/reference.html#Error-reporting">
Error reporting</a>.</p>
@@ -2564,7 +2572,7 @@
<code>complete(p, current_path())</code>.</p>
<p><a name="windows_effects">For <i>Windows</i></a>, <code>system_complete(p)</code> has the
same semantics as <code>complete(ph, current_path())</code> if
- <code>p.is_complete() || !p.has_root_name()</code> or <code>p</code> and <code>base</code> have the same
+ <code>p.is_absolute() || !p.has_root_name()</code> or <code>p</code> and <code>base</code> have the same
<code>root_name()</code>.
Otherwise it acts like <code>complete(p, kinky)</code>, where <code>kinky</code>
is the current directory for the <code>p.root_name()</code> drive. This will
@@ -2665,14 +2673,14 @@
sentence:</i></span></p>
<blockquote>
<p><span style="background-color: #FFFFFF">It then opens a file, if possible,
-whose name is the NTBS s (âas ifâ by calling <code>std::fopen(s ,<i>modstr</i>
+whose name is the NTBS s (ââ¬Åas ifââ¬Â by calling <code>std::fopen(s ,<i>modstr</i>
))</code>.</span></p>
</blockquote>
<p><span style="background-color: #FFFFFF"><i>with:</i></span></p>
<blockquote>
<p><span style="background-color: #FFFFFF">It then opens, if possible, the file
that
-<code>p</code> or <code>path(s)</code> resolves to, âas ifâ by calling <code>std::fopen()</code> with a
+<code>p</code> or <code>path(s)</code> resolves to, ââ¬Åas ifââ¬Â by calling <code>std::fopen()</code> with a
second argument of <i>modstr</i>.</span></p>
</blockquote>
<p><span style="background-color: #FFFFFF"><i>In 27.8.1.5 Class template
@@ -3319,7 +3327,7 @@
<tr>
<td width="16%" valign="top">[<a name="ISO_POSIX">ISO-POSIX</a>]</td>
<td width="84%">ISO/IEC 9945:2003, IEEE Std 1003.1-2001, and The Open Group
- Base Specifications, Issue 6. Also known as The Single Unix<font face="Times New Roman">®
+ Base Specifications, Issue 6. Also known as The Single Unix<font face="Times New Roman">®
Specification, Version 3. Available from each of the organizations involved
in its creation. For example, read online or download from
<a href="http://www.unix.org/single_unix_specification/">
@@ -3335,7 +3343,7 @@
</tr>
</table>
<hr>
-<p>© Copyright Beman Dawes, 2002, 2006, 2007, 2009</p>
+<p>© Copyright Beman Dawes, 2002, 2006, 2007, 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
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 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -60,6 +60,16 @@
<ul>
<li><code>has_stem()</code></li>
<li><code>has_extension()</code></li>
+ <li><code>is_relative()<br>
+ </code></li>
+</ul>
+
+ </li>
+ <li>Other changes:<br>
+ <ul>
+ <li>The preferred name for <code>path</code> member <code>is_complete()</code>
+ is now <code>is_absolute()</code>. Use of <code>is_complete()</code> is
+ deprecated.</li>
</ul>
</li>
@@ -98,7 +108,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 -->24 December 2009<!--webbot bot="Timestamp" endspan i-checksum="39742" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->02 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32136" --></p>
</body>
Modified: sandbox/filesystem-v3/libs/filesystem/src/operations.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/src/operations.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/src/operations.cpp 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -1408,7 +1408,7 @@
path system_complete(const path& p, system::error_code* ec)
{
# ifdef BOOST_POSIX_API
- return (p.empty() || p.is_complete())
+ return (p.empty() || p.is_absolute())
? p : current_path()/ p;
# else
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 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -156,9 +156,9 @@
p.directory_string();
}
- // remove_leaf_test -----------------------------------------------------------------//
+ // path_rename_test -----------------------------------------------------------------//
- void remove_leaf_test()
+ void path_rename_test()
{
fs::path p("foo/bar/blah");
@@ -167,6 +167,7 @@
BOOST_TEST_EQ(p.branch_path(), "foo/bar");
BOOST_TEST(p.has_leaf());
BOOST_TEST(p.has_branch_path());
+ BOOST_TEST(!p.is_complete());
if (platform == "Windows")
{
@@ -204,7 +205,7 @@
BOOST_TEST(!fs::is_regular(ng)); // verify deprecated name still works
BOOST_TEST(!fs::symbolic_link_exists("nosuchfileordirectory"));
- remove_leaf_test();
+ path_rename_test();
normalize_test();
// extension() tests ---------------------------------------------------------//
Modified: sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/operations_test.cpp 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -1101,8 +1101,8 @@
std::cout << " initial_path().string() is\n \""
<< fs::initial_path().string()
<< "\"\n\n";
- BOOST_TEST(fs::initial_path().is_complete());
- BOOST_TEST(fs::current_path().is_complete());
+ BOOST_TEST(fs::initial_path().is_absolute());
+ BOOST_TEST(fs::current_path().is_absolute());
BOOST_TEST(fs::initial_path().string()
== fs::current_path().string());
Modified: sandbox/filesystem-v3/libs/filesystem/test/path_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/path_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/path_test.cpp 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -686,7 +686,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(!p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "/";
BOOST_TEST(p.relative_path().string() == "");
@@ -703,9 +703,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "//";
CHECK_EQUAL(p.relative_path().string(), "");
@@ -721,7 +721,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "///";
@@ -739,9 +739,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = ".";
BOOST_TEST(p.relative_path().string() == ".");
@@ -757,7 +757,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "..";
BOOST_TEST(p.relative_path().string() == "..");
@@ -773,7 +773,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "foo";
BOOST_TEST(p.relative_path().string() == "foo");
@@ -789,7 +789,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "/foo";
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -806,9 +806,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "/foo/";
CHECK_EQUAL(p.relative_path().string(), "foo/");
@@ -825,9 +825,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "///foo";
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -844,9 +844,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "foo/bar";
BOOST_TEST(p.relative_path().string() == "foo/bar");
@@ -862,7 +862,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "../foo";
BOOST_TEST(p.relative_path().string() == "../foo");
@@ -878,7 +878,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "..///foo";
CHECK_EQUAL(p.relative_path().string(), "..///foo");
@@ -894,7 +894,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = "/foo/bar";
BOOST_TEST(p.relative_path().string() == "foo/bar");
@@ -911,9 +911,9 @@
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
if (platform == "POSIX")
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
else
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
// Both POSIX and Windows allow two leading slashs
// (POSIX meaning is implementation defined)
@@ -936,7 +936,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = path("//net/");
BOOST_TEST(p.relative_path().string() == "");
@@ -952,7 +952,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("//net/foo");
BOOST_TEST(p.relative_path().string() == "foo");
@@ -968,7 +968,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("//net///foo");
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -984,7 +984,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
if (platform == "Windows")
{
@@ -1003,7 +1003,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = path("c:foo");
BOOST_TEST(p.relative_path().string() == "foo");
@@ -1019,7 +1019,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = path("c:/");
BOOST_TEST(p.relative_path().string() == "");
@@ -1035,7 +1035,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("c:..");
BOOST_TEST(p.relative_path().string() == "..");
@@ -1051,7 +1051,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = path("c:/foo");
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -1067,7 +1067,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("c://foo");
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -1083,7 +1083,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("c:\\foo\\bar");
CHECK_EQUAL(p.relative_path().string(), "foo\\bar");
@@ -1099,7 +1099,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
p = q = path("prn:");
BOOST_TEST(p.relative_path().string() == "");
@@ -1115,7 +1115,7 @@
BOOST_TEST(!p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(!p.has_parent_path());
- BOOST_TEST(!p.is_complete());
+ BOOST_TEST(!p.is_absolute());
p = q = path("\\\\net\\\\\\foo");
CHECK_EQUAL(p.relative_path().string(), "foo");
@@ -1131,7 +1131,7 @@
BOOST_TEST(p.has_relative_path());
BOOST_TEST(p.has_filename());
BOOST_TEST(p.has_parent_path());
- BOOST_TEST(p.is_complete());
+ BOOST_TEST(p.is_absolute());
} // Windows
else
Modified: sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp (original)
+++ sandbox/filesystem-v3/libs/filesystem/test/path_unit_test.cpp 2010-01-02 10:51:44 EST (Sat, 02 Jan 2010)
@@ -502,7 +502,8 @@
CHECK(!p1.has_filename());
CHECK(!p1.has_stem());
CHECK(!p1.has_extension());
- CHECK(!p1.is_complete());
+ CHECK(!p1.is_absolute());
+ CHECK(p1.is_relative());
CHECK(!p2.empty());
CHECK(p2.has_root_path());
@@ -513,7 +514,8 @@
CHECK(p2.has_filename());
CHECK(p2.has_stem());
CHECK(p2.has_extension());
- CHECK(p2.is_complete());
+ CHECK(p2.is_absolute());
+ CHECK(!p2.is_relative());
}
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