Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73437 - in branches/release: boost boost/filesystem boost/filesystem/v3 libs/filesystem libs/filesystem/test libs/filesystem/tools libs/filesystem/v2/src libs/filesystem/v3/src libs/filesystem/v3/test libs/filesystem/v3/test/msvc10 libs/filesystem/v3/test/msvc10/locale_info
From: bdawes_at_[hidden]
Date: 2011-07-29 15:51:27


Author: bemandawes
Date: 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
New Revision: 73437
URL: http://svn.boost.org/trac/boost/changeset/73437

Log:
Merge from trunk, including local_info.cpp and changeset 73402 fixes for #7534, missing POSIX close()
Added:
   branches/release/libs/filesystem/tools/ (props changed)
      - copied from r73435, /trunk/libs/filesystem/tools/
   branches/release/libs/filesystem/tools/backup.bat
      - copied unchanged from r73435, /trunk/libs/filesystem/tools/backup.bat
   branches/release/libs/filesystem/tools/exclude.txt
      - copied unchanged from r73435, /trunk/libs/filesystem/tools/exclude.txt
   branches/release/libs/filesystem/v3/test/locale_info.cpp (contents, props changed)
   branches/release/libs/filesystem/v3/test/msvc10/locale_info/ (props changed)
      - copied from r73435, /trunk/libs/filesystem/v3/test/msvc10/locale_info/
   branches/release/libs/filesystem/v3/test/msvc10/locale_info/locale_info.vcxproj
      - copied unchanged from r73435, /trunk/libs/filesystem/v3/test/msvc10/locale_info/locale_info.vcxproj
Properties modified:
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/filesystem.hpp (props changed)
   branches/release/libs/filesystem/ (props changed)
Text files modified:
   branches/release/boost/filesystem/v3/path.hpp | 12 ++++++------
   branches/release/libs/filesystem/test/Jamfile.v2 | 1 +
   branches/release/libs/filesystem/v2/src/v2_operations.cpp | 5 ++++-
   branches/release/libs/filesystem/v3/src/operations.cpp | 5 ++++-
   branches/release/libs/filesystem/v3/test/msvc10/filesystem-v3.sln | 15 ++++++---------
   5 files changed, 21 insertions(+), 17 deletions(-)

Modified: branches/release/boost/filesystem/v3/path.hpp
==============================================================================
--- branches/release/boost/filesystem/v3/path.hpp (original)
+++ branches/release/boost/filesystem/v3/path.hpp 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -95,7 +95,7 @@
     // TODO: rules needed for operating systems that use / or .
     // differently, or format directory paths differently from file paths.
     //
- // ************************************************************************
+ // **********************************************************************************
     //
     // More work needed: How to handle an operating system that may have
     // slash characters or dot characters in valid filenames, either because
@@ -107,7 +107,7 @@
     // ^^^^
     // Note that 0x2F is the ASCII slash character
     //
- // ************************************************************************
+ // **********************************************************************************
 
     // Supported source arguments: half-open iterator range, container, c-array,
     // and single pointer to null terminated string.
@@ -116,9 +116,9 @@
     // multi-byte character strings which may have embedded nulls. Embedded null
     // support is required for some Asian languages on Windows.
 
- // "const codecvt_type& cvt=codecvt()" default arguments are not used because some
- // compilers, such as Microsoft prior to VC++ 10, do not handle defaults correctly
- // in templates.
+ // [defaults] "const codecvt_type& cvt=codecvt()" default arguments are not used
+ // because some compilers, such as Microsoft prior to VC++ 10, do not handle defaults
+ // correctly in templates.
 
     // ----- constructors -----
 
@@ -147,7 +147,7 @@
 
     template <class Source>
     path(Source const& source, const codecvt_type& cvt)
- // see note above explaining why codecvt() default arguments are not used
+ // see [defaults] note above explaining why codecvt() default arguments are not used
     {
       path_traits::dispatch(source, m_pathname, cvt);
     }

Modified: branches/release/libs/filesystem/test/Jamfile.v2
==============================================================================
--- branches/release/libs/filesystem/test/Jamfile.v2 (original)
+++ branches/release/libs/filesystem/test/Jamfile.v2 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -28,4 +28,5 @@
        [ run ../v3/test/deprecated_test.cpp : : : : v3_deprecated_test ]
        [ run ../v3/example/simple_ls.cpp : : : : v3_simple_ls ]
  
+ [ run ../v3/test/locale_info.cpp : : : <test-info>always_show_run_output ]
        ;

Modified: branches/release/libs/filesystem/v2/src/v2_operations.cpp
==============================================================================
--- branches/release/libs/filesystem/v2/src/v2_operations.cpp (original)
+++ branches/release/libs/filesystem/v2/src/v2_operations.cpp 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -1212,7 +1212,10 @@
 
         struct stat from_stat;
         if ( ::stat( from_file_ph.c_str(), &from_stat ) != 0 )
- { return error_code( errno, system_category() ); }
+ {
+ ::close(infile);
+ return error_code( errno, system_category() );
+ }
 
         int oflag = O_CREAT | O_WRONLY | O_TRUNC;
         if ( fail_if_exists )

Modified: branches/release/libs/filesystem/v3/src/operations.cpp
==============================================================================
--- branches/release/libs/filesystem/v3/src/operations.cpp (original)
+++ branches/release/libs/filesystem/v3/src/operations.cpp 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -431,7 +431,10 @@
 
     struct stat from_stat;
     if (::stat(from_p.c_str(), &from_stat)!= 0)
- { return false; }
+ {
+ ::close(infile);
+ return false;
+ }
 
     int oflag = O_CREAT | O_WRONLY | O_TRUNC;
     if (fail_if_exists)

Added: branches/release/libs/filesystem/v3/test/locale_info.cpp
==============================================================================
--- (empty file)
+++ branches/release/libs/filesystem/v3/test/locale_info.cpp 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -0,0 +1,88 @@
+// locale_info.cpp ---------------------------------------------------------//
+
+// Copyright Beman Dawes 2011
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+#include <locale>
+#include <iostream>
+#include <exception>
+#include <cstdlib>
+using namespace std;
+
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable: 4996) // ... Function call with parameters that may be unsafe
+#endif
+
+namespace
+{
+ void facet_info(const locale& loc, const char* msg)
+ {
+ cout << "has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >("
+ << msg << ") is "
+ << (has_facet<std::codecvt<wchar_t, char, std::mbstate_t> >(loc)
+ ? "true\n"
+ : "false\n");
+ }
+
+ void default_info()
+ {
+ try
+ {
+ locale loc;
+ cout << "\nlocale default construction OK" << endl;
+ facet_info(loc, "locale()");
+ }
+ catch (const exception& ex)
+ {
+ cout << "\nlocale default construction threw: " << ex.what() << endl;
+ }
+ }
+
+ void null_string_info()
+ {
+ try
+ {
+ locale loc("");
+ cout << "\nlocale(\"\") construction OK" << endl;
+ facet_info(loc, "locale(\"\")");
+ }
+ catch (const exception& ex)
+ {
+ cout << "\nlocale(\"\") construction threw: " << ex.what() << endl;
+ }
+ }
+
+ void classic_info()
+ {
+ try
+ {
+ locale loc(locale::classic());
+ cout << "\nlocale(locale::classic()) copy construction OK" << endl;
+ facet_info(loc, "locale::classic()");
+ }
+ catch (const exception& ex)
+ {
+ cout << "\nlocale(locale::clasic()) copy construction threw: " << ex.what() << endl;
+ }
+ }
+}
+
+int main()
+{
+ const char* lang = getenv("LANG");
+ cout << "\nLANG environmental variable is "
+ << (lang ? lang : "not present") << endl;
+
+ default_info();
+ null_string_info();
+ classic_info();
+
+ return 0;
+}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif

Modified: branches/release/libs/filesystem/v3/test/msvc10/filesystem-v3.sln
==============================================================================
--- branches/release/libs/filesystem/v3/test/msvc10/filesystem-v3.sln (original)
+++ branches/release/libs/filesystem/v3/test/msvc10/filesystem-v3.sln 2011-07-29 15:51:24 EDT (Fri, 29 Jul 2011)
@@ -29,12 +29,6 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "windows_attributes", "windows_attributes\windows_attributes.vcxproj", "{FC5C770F-3017-4021-8DAF-C5DCA3FDF005}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scratch_test", "scratch_test\scratch_test.vcxproj", "{214D1FDB-CC19-47C6-8DDD-59C5424C6850}"
- 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}") = "tut5", "tut5\tut5.vcxproj", "{5C9B3380-3C6E-45CC-986A-16D245E27E58}"
         ProjectSection(ProjectDependencies) = postProject
                 {F94CCADD-A90B-480C-A304-C19D015D36B1} = {F94CCADD-A90B-480C-A304-C19D015D36B1}
@@ -77,6 +71,8 @@
                 {FFD738F7-96F0-445C-81EA-551665EF53D1} = {FFD738F7-96F0-445C-81EA-551665EF53D1}
         EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "locale_info", "locale_info\locale_info.vcxproj", "{3667C35E-78D5-43D4-AAC2-349145E4341D}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -137,9 +133,6 @@
                 {256EA89A-E073-4CE8-B675-BE2FBC6B2691}.Release|Win32.Build.0 = Release|Win32
                 {FC5C770F-3017-4021-8DAF-C5DCA3FDF005}.Debug|Win32.ActiveCfg = Debug|Win32
                 {FC5C770F-3017-4021-8DAF-C5DCA3FDF005}.Release|Win32.ActiveCfg = Release|Win32
- {214D1FDB-CC19-47C6-8DDD-59C5424C6850}.Debug|Win32.ActiveCfg = Release|Win32
- {214D1FDB-CC19-47C6-8DDD-59C5424C6850}.Release|Win32.ActiveCfg = Release|Win32
- {214D1FDB-CC19-47C6-8DDD-59C5424C6850}.Release|Win32.Build.0 = Release|Win32
                 {5C9B3380-3C6E-45CC-986A-16D245E27E58}.Debug|Win32.ActiveCfg = Debug|Win32
                 {5C9B3380-3C6E-45CC-986A-16D245E27E58}.Debug|Win32.Build.0 = Debug|Win32
                 {5C9B3380-3C6E-45CC-986A-16D245E27E58}.Release|Win32.ActiveCfg = Release|Win32
@@ -168,6 +161,10 @@
                 {43C4B4D8-0893-4C86-B9FD-6A7DEB1A4426}.Debug|Win32.Build.0 = Debug|Win32
                 {43C4B4D8-0893-4C86-B9FD-6A7DEB1A4426}.Release|Win32.ActiveCfg = Release|Win32
                 {43C4B4D8-0893-4C86-B9FD-6A7DEB1A4426}.Release|Win32.Build.0 = Release|Win32
+ {3667C35E-78D5-43D4-AAC2-349145E4341D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3667C35E-78D5-43D4-AAC2-349145E4341D}.Debug|Win32.Build.0 = Debug|Win32
+ {3667C35E-78D5-43D4-AAC2-349145E4341D}.Release|Win32.ActiveCfg = Release|Win32
+ {3667C35E-78D5-43D4-AAC2-349145E4341D}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE


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