$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r59366 - in sandbox/filesystem-v3/libs/filesystem: doc example example/test src test/msvc
From: bdawes_at_[hidden]
Date: 2010-01-30 07:12:49
Author: bemandawes
Date: 2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
New Revision: 59366
URL: http://svn.boost.org/trac/boost/changeset/59366
Log:
work-in-progress
Added:
   sandbox/filesystem-v3/libs/filesystem/example/test/
   sandbox/filesystem-v3/libs/filesystem/example/test/Jamfile.v2   (contents, props changed)
Text files modified: 
   sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html                   |   191 +++++++++++++++++++++++++-------------- 
   sandbox/filesystem-v3/libs/filesystem/example/tut1.cpp                    |     7 -                                       
   sandbox/filesystem-v3/libs/filesystem/src/path.cpp                        |     2                                         
   sandbox/filesystem-v3/libs/filesystem/test/msvc/filesystem-v3-sandbox.sln |    10 ++                                      
   4 files changed, 135 insertions(+), 75 deletions(-)
Modified: sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html	(original)
+++ sandbox/filesystem-v3/libs/filesystem/doc/tutorial.html	2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
@@ -36,11 +36,129 @@
   </tr>
 </table>
 
+<h2>Introduction</h2>
+
+<p>This tutorial develops a little command line program to list information 
+about files and directories - essentially a much simplified version of the POSIX <code>ls</code> or Windows <code>dir</code> 
+commands. We'll start with the simplest possible version and progress to more 
+complex functionality. Along the way we'll digress to cover topics you'll need 
+to know about to use Boost.Filesystem effectively.</p>
+
+<p>Source code for each version of the tutorial program is available, and you 
+are encouraged to compile, test, and experiment with it. To conserve space, we won't 
+always show boilerplate code here, but the provided source is complete and 
+ready to build.</p>
+
 <h3>Preliminaries</h3>
 
-<p>Install the Boost distribution if you haven't already done so. Since 
-Boost.Filesystem is a compiled library, you will need to do a library build if 
-this hasn't been done already.</p>
+<p>Install the Boost distribution if you haven't already done so. See the
+<a href="http://www.boost.org/more/getting_started/index.html">Boost Getting 
+Started</a> docs.</p>
+
+<p>The Boost.Filesystem and Boost.System compiled libraries are going to be 
+needed. If you are planning to use Boost's bjam for builds, it will take care of 
+building these if needed. If you are a different build system, or are planning 
+to build by hand, you might want to make sure your build approach knows where to 
+locate or build the library binaries.</p>
+
+<h2>tut1.cpp - Reporting the size of a file</h2>
+
+<p>Let's get started. One of the simplest things we can do is report the size of 
+a file.</p>
+
+<table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+  <tr>
+    <td style="font-size: 10pt">
+    <pre>tut1.cpp</pre>
+    <blockquote style="font-size: 10pt">
+      <pre>#include <iostream>
+#include <boost/filesystem.hpp>
+using namespace boost::filesystem;
+
+int main(int argc, char* argv[])
+{
+  if (argc < 2)
+  {
+    std::cout << "Usage: tut1 path\n";
+    return 1;
+  }
+  std::cout << argv[1] << ": " << file_size(argv[1]) << '\n';
+  return 0;
+}</pre>
+    </blockquote>
+    </td>
+  </tr>
+</table>
+
+<p>The Boost.Filesystem <code>file_size</code> function returns an <code>uintmax_t</code> 
+containing the size of the file named by the argument. The code should be 
+self-evident - if not you are probably in the wrong place!</p>
+
+<p>Build tut1.cpp.  Use whatever build environment you 
+are most comfortable with.</p>
+<blockquote>
+
+<p>Building using the Boost build system:</p>
+  <blockquote>
+    <pre>cd <i><b>boost-root</b></i>/libs/filesystem/example
+bjam tut1</pre>
+  </blockquote>
+  <p>Building using Microsoft Visual C++, with all variants of the Boost 
+  libraries located in <i><b><code>boost-root</code></b></i><code>\stage\lib</code>:</p>
+  <blockquote>
+    <pre>cd <i><b>boost-root</b></i>\libs\filesystem\example
+cl /EHsc /I ..\..\.. tut1.cpp /link /LIBPATH:..\..\..\stage\lib</pre>
+  </blockquote>
+</blockquote>
+<p>Here are tests on Linux and Windows:</p>
+
+  <table align="center" border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
+    <tr>
+      <td align="center" width="50%" style="font-size: 10pt"><i><b>Ubuntu Linux </b></i></td>
+      <td align="center" style="font-size: 10pt"><i><b>Microsoft Windows</b></i></td>
+    </tr>
+    <tr>
+      <td width="50%" style="font-size: 10pt">
+      <pre>$ ./tut1 tut1.cpp
+tut1.cpp: 570</pre>
+      </td>
+      <td style="font-size: 10pt">
+      <pre>>tut1 tut1.cpp
+tut1.cpp: 593</pre>
+      </td>
+    </tr>
+  </table>
+
+<p>So far, so good. </p>
+<p>Here's a test on Windows, in the 
+directory containing the build output. It contains a directory named test with a 
+file named valentine:</p>
+<blockquote style="font-size: 10pt">
+  <pre>C:\v3d>dir test\valentine          
+...
+12/30/2009 10:06 AM 23 valentine
+...
+
+C:\v3d>tut1 test\valentine
+test\valentine: 23
+
+C:\v3d>tut1 test/valentine
+test/valentine: 23
+
+C:\v3d>tut1 test</pre>
+</blockquote>
+  <p><img border="0" src="tut1_crash.jpg" width="474" height="302"><br>
+  <br>
+  Oops! <code>file_size</code> only works on files, not directories, so an 
+  exception was thrown.</p>
+<blockquote style="font-size: 10pt">
+  <pre>C:\v3d>tut1 foo</pre>
+</blockquote>
+  <p><img border="0" src="tut1_crash.jpg" width="474" height="302"><br>
+  <br>
+  There's no file named <code>foo</code> in the current directory, so again an 
+exception was thrown.</p>
+  <p>We'll deal with those conditions in <code>tut2.cpp</code>.</p>
 
 <h2>Basics</h2>
 
@@ -135,71 +253,6 @@
 do not throw exceptions when I/O errors occur. 
   <span style="background-color: #FFFF00">More on that later in the tutorial.</span></p>
 
-<h2>tut1.cpp - Reporting the size of a file</h2>
-
-<p>Let's develop a little command line program to list information about 
-files and directories - essentially a much simplified version of the POSIX <code>ls</code> or Windows <code>dir</code> 
-commands. We'll start with the simplest possible version and progress to more 
-complex functionality. Source code for each version is available, and you are 
-encouraged to compile, test, and experiment with it.</p>
-
-<p>To conserve space, we won't show all the boilerplate code here, but the 
-source code does include it. </p>
-
-<p>Let's get started.</p>
-
-<table align="center" border="1" cellpadding="3" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" bgcolor="#D7EEFF" width="90%">
-  <tr>
-    <td style="font-size: 10pt">
-    <pre>tut1.cpp</pre>
-    <blockquote>
-      <pre>int main(int argc, char* argv[])
-{
-
-  std::cout << argv[1] << ": " << file_size(argv[1]) << '\n';
-
-  return 0;
-}</pre>
-    </blockquote>
-    </td>
-  </tr>
-</table>
-
-<p>The Boost.Filesystem <code>file_size</code> function returns an <code>uintmax_t</code> 
-containing the size of the file named in the argument.</p>
-
-<p>Build tut1.cpp and give it a try.  Use whatever build environment you 
-are most comfortable with.</p>
-<p>Here's a test on Windows, in the 
-directory containing the build output. It contains a directory named test with a 
-file named valentine:</p>
-<blockquote>
-  <pre>C:\v3d>dir test\valentine          
-...
-12/30/2009 10:06 AM 23 valentine
-...
-
-C:\v3d>tut1 test\valentine
-test\valentine: 23
-
-C:\v3d>tut1 test/valentine
-test/valentine: 23
-
-C:\v3d>tut1 test</pre>
-</blockquote>
-  <p><img border="0" src="tut1_crash.jpg" width="474" height="302"><br>
-  <br>
-  Oops! <code>file_size</code> only works on files, not directories, so an 
-  exception was thrown.</p>
-<blockquote>
-  <pre>C:\v3d>tut1 foo</pre>
-</blockquote>
-  <p><img border="0" src="tut1_crash.jpg" width="474" height="302"><br>
-  <br>
-  There's no file named <code>foo</code> in the current directory, so again an 
-exception was thrown.</p>
-  <p>We'll deal with those conditions in <code>tut2.cpp</code>.</p>
-
 <h2>tut2.cpp - Using status queries to determine file existence and type</h2>
 
 <p>Boost.filesystem includes status query functions such as <code>exists</code>,
@@ -752,7 +805,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 -->20 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32134" --></p>
+<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->29 January 2010<!--webbot bot="Timestamp" endspan i-checksum="32152" --></p>
 
 </body>
 
Added: sandbox/filesystem-v3/libs/filesystem/example/test/Jamfile.v2
==============================================================================
--- (empty file)
+++ sandbox/filesystem-v3/libs/filesystem/example/test/Jamfile.v2	2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
@@ -0,0 +1,29 @@
+# Boost Filesystem Library Example Jamfile
+ 
+# (C) Copyright Vladimir Prus 2003
+
+# Distributed under the Boost Software License, Version 1.0.
+# See www.boost.org/LICENSE_1_0.txt
+
+# Library home page: http://www.boost.org/libs/filesystem
+
+project
+    : requirements
+      <library>/boost/filesystem//boost_filesystem
+      <library>/boost/system//boost_system
+      <toolset>msvc:<asynch-exceptions>on
+      <link>static
+    ;
+    
+exe tut1 : tut1.cpp ;
+exe tut2 : tut2.cpp ;
+exe tut3 : tut3.cpp ;
+exe tut4 : tut4.cpp ;
+exe path_info : path_info.cpp ;
+
+install tut1-copy : tut1 : <location>. ;
+install tut2-copy : tut2 : <location>. ;
+install tut3-copy : tut3 : <location>. ;
+install tut4-copy : tut4 : <location>. ;
+install convenient-copy : path_info : <location>. ;
+  
Modified: sandbox/filesystem-v3/libs/filesystem/example/tut1.cpp
==============================================================================
--- sandbox/filesystem-v3/libs/filesystem/example/tut1.cpp	(original)
+++ sandbox/filesystem-v3/libs/filesystem/example/tut1.cpp	2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
@@ -9,18 +9,15 @@
 
 #include <iostream>
 #include <boost/filesystem.hpp>
-using namespace std;
 using namespace boost::filesystem;
 
 int main(int argc, char* argv[])
 {
   if (argc < 2)
   {
-    cout << "Usage: tut1 path\n";
+    std::cout << "Usage: tut1 path\n";
     return 1;
   }
-
-  cout << argv[1] << ": " << file_size(argv[1]) << '\n';
-
+  std::cout << argv[1] << ": " << file_size(argv[1]) << '\n';
   return 0;
 }
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	2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
@@ -239,7 +239,7 @@
     else if (has_root_directory())
     {
 #     ifdef BOOST_POSIX_PATH
-      if (base_root_name.empty() return *this;
+      if (base_root_name.empty()) return *this;
 #     endif
       path tmp (base_root_name / m_pathname);
       m_pathname.swap(tmp.m_pathname);
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	2010-01-30 07:12:48 EST (Sat, 30 Jan 2010)
@@ -94,6 +94,12 @@
                 {FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
         EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "space", "space\space.vcproj", "{1AEABC96-F4D5-4B15-B246-3AA34A1827CB}"
+	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
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -183,6 +189,10 @@
                 {CDC8DCF8-D55B-4F79-8508-4F32416BCB62}.Debug|Win32.Build.0 = Debug|Win32
                 {CDC8DCF8-D55B-4F79-8508-4F32416BCB62}.Release|Win32.ActiveCfg = Release|Win32
                 {CDC8DCF8-D55B-4F79-8508-4F32416BCB62}.Release|Win32.Build.0 = Release|Win32
+		{1AEABC96-F4D5-4B15-B246-3AA34A1827CB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1AEABC96-F4D5-4B15-B246-3AA34A1827CB}.Debug|Win32.Build.0 = Debug|Win32
+		{1AEABC96-F4D5-4B15-B246-3AA34A1827CB}.Release|Win32.ActiveCfg = Release|Win32
+		{1AEABC96-F4D5-4B15-B246-3AA34A1827CB}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE