Browse files

Imported upstream 1.9.99

Signed-off-by: Stefan Naewe <stefan.naewe@atlas-elektronik.com>
  • Loading branch information...
1 parent a8d1000 commit 60592960f86d3183699ecb13882ca964b24e26a7 Stefan Naewe committed Aug 2, 2012
View
77 CHANGES.txt
@@ -2,7 +2,7 @@
STLSoft - Changes
; Created: 29th March 2002
-; Updated: 7th June 2010
+; Updated: 21st June 2010
============================================================================
@@ -19,6 +19,81 @@ STLSoft - Changes
============================================================================
+Changes for 1.9.99 (21st June 2010)
+
+Summary:
+========
+
+ * added filesystem_traits::str_fs_compare() (UNIXSTL & WinSTL)
+ * added filesystem_traits::str_fs_n_compare() (UNIXSTL & WinSTL)
+ * added str_n_compare_no_case declaration to system_traits (UNIXSTL & WinSTL)
+ * added assoc_select_first() and assoc_select_second() creator functions for associative_select_iterator
+ * incorporated Manfred Ehrhart's fixes for associative_select_iterator
+ * Borland/GCC-compatibility fixes
+ * GCC-compatibility fixes
+ * nullptr support correction for VC++
+ * various minor fixes
+
+Changes:
+========
+
+ STLSoft:
+ ========
+
+ ~ stlsoft/error/error_desc.hpp:
+ ~ stlsoft/string/special_string_instance.hpp:
+ ~ GCC-compatibility fixes
+
+ ~ stlsoft/filesystem/read_line.hpp:
+ ~ required disambiguation, via separating readers from implementation
+
+ ~ stlsoft/internal/cccap/msvc.h:
+ ~ nullptr support correction for VC++
+
+ ~ stlsoft/iterators/associative_select_iterator.hpp:
+ ~ Borland/GCC-compatibility fixes
+ + added assoc_select_first() function
+ + added assoc_select_second() function
+ - removed the need to be explicit, to allow for assignment-syntax initialisation
+ + incorporate (after inexcusable delay) Manfred Ehrhart's fixes, addressing inappropriate member type and defect in select_second()
+
+ UNIXSTL:
+ ========
+
+ ~ unixstl/filesystem/directory_functions.hpp:
+ ~ improved documentation for remove_directory_recurse()
+
+ ~ unixstl/filesystem/filesystem_traits.hpp:
+ + added filesystem_traits::str_fs_compare()
+ + added filesystem_traits::str_fs_n_compare()
+
+ ~ unixstl/system/system_traits.hpp:
+ + added str_n_compare_no_case declaration to system_traits
+
+ WinSTL:
+ =======
+
+ ~ winstl/conversion/char_conversions.hpp:
+ ~ GCC-compatibility fixes
+
+ ~ winstl/filesystem/directory_functions.hpp:
+ ~ improved documentation for remove_directory_recurse()
+
+ ~ winstl/filesystem/filesystem_traits.hpp:
+ + added filesystem_traits::str_fs_compare()
+ + added filesystem_traits::str_fs_n_compare()
+
+ ~ winstl/filesystem/findvolume_sequence.hpp:
+ ~ adds missing inclusion of shims header file(s)
+
+ ~ winstl/system/system_traits.hpp:
+ + added str_n_compare_no_case declaration to system_traits
+ ~ documentation markup
+
+
+
+============================================================================
+
Changes for 1.9.98 (7th June 2010)
Summary:
View
16 HISTORY.txt
@@ -2,11 +2,25 @@
STLSoft - History
; Created: 29th March 2002
-; Updated: 7th June 2010
+; Updated: 21st June 2010
============================================================================
+21st June 2010 - 1.9.99 released
+--------------------------------
+
+ * added filesystem_traits::str_fs_compare() (UNIXSTL & WinSTL)
+ * added filesystem_traits::str_fs_n_compare() (UNIXSTL & WinSTL)
+ * added str_n_compare_no_case declaration to system_traits (UNIXSTL & WinSTL)
+ * added assoc_select_first() and assoc_select_second() creator functions for associative_select_iterator
+ * incorporated Manfred Ehrhart's fixes for associative_select_iterator
+ * Borland/GCC-compatibility fixes
+ * GCC-compatibility fixes
+ * nullptr support correction for VC++
+ * various minor fixes
+
+
7th June 2010 - 1.9.98 released
-------------------------------
View
12 INSTALL.txt
@@ -2,7 +2,7 @@
STLSoft - Install
; Created: 29th March 2002
-; Updated: 7th June 2010
+; Updated: 21st June 2010
============================================================================
@@ -11,16 +11,16 @@ STLSoft - Install
It is recommended that you define an STLSOFT environment variable.
For example, if you're using UNIX and you install
- to /usr/local/stlsoft/stlsoft-1.9.98 then you should set the environment
- variable STLSOFT to /usr/local/stlsoft/stlsoft-1.9.98 in which case the
+ to /usr/local/stlsoft/stlsoft-1.9.99 then you should set the environment
+ variable STLSOFT to /usr/local/stlsoft/stlsoft-1.9.99 in which case the
file stlsoft/stlsoft.h will be located in
$STLSOFT/include/stlsoft/stlsoft.h
Conversely, if you're using Windows and you intall
- to C:\3pty\STLSoft\stlsoft-1.9.98 then you should set the environment
- variable STLSoft to C:\3pty\STLSoft\stlsoft-1.9.98 in which case the
+ to C:\3pty\STLSoft\stlsoft-1.9.99 then you should set the environment
+ variable STLSoft to C:\3pty\STLSoft\stlsoft-1.9.99 in which case the
file stlsoft/stlsoft.h will be located in
- C:\3pty\STLSoft\stlsoft-1.9.98\stlsoft\stlsoft.h
+ C:\3pty\STLSoft\stlsoft-1.9.99\stlsoft\stlsoft.h
The makefiles / project files of several other open-source projects expect
this symbol, including:
View
6 KNOWN_ISSUES.txt
@@ -2,7 +2,7 @@
STLSoft - Known Issues:
; Created: 29th March 2002
-; Updated: 7th June 2010
+; Updated: 21st June 2010
============================================================================
@@ -22,6 +22,10 @@ STLSoft 1.9 Known Issues:
* The documentation is still hopeless. This will be addressed in the
release of 1.10.
+ * Several unixstl::system_traits methods are declared but not defined, with
+ the intention to flesh them out from Linux system calls (and have
+ emulations/workarounds for other architectures)
+
STLSoft 1.9 Suspected Issues:
-----------------------------
View
4 NEWS.txt
@@ -2,13 +2,15 @@
STLSoft - News
; Created: 29th March 2002
-; Updated: 7th June 2010
+; Updated: 21st June 2010
============================================================================
News:
+ 21st June 2010 - Release of STLSoft 1.9.99
+
7th June 2010 - Release of STLSoft 1.9.98
4th April 2010 - Release of STLSoft 1.9.97
View
10 include/inetstl/filesystem/filesystem_traits.hpp
@@ -5,7 +5,7 @@
* Unicode specialisations thereof.
*
* Created: 30th April 1999
- * Updated: 31st March 2010
+ * Updated: 16th June 2010
*
* Home: http://stlsoft.org/
*
@@ -53,7 +53,7 @@
# define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MAJOR 4
# define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MINOR 2
# define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_REVISION 2
-# define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 75
+# define INETSTL_VER_INETSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 76
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -161,11 +161,11 @@ struct filesystem_traits
/// Appends the contents of \c src to \c dest
static char_type* str_cat(char_type* dest, char_type const* src);
#endif /* !STLSOFT_USING_SAFE_STR_FUNCTIONS || _CRT_SECURE_NO_DEPRECATE */
- /// Comparies the contents of \c src and \c dest
+ /// Compares the contents of \c src and \c dest
static int_type str_compare(char_type const* s1, char_type const* s2);
- /// Comparies the contents of \c src and \c dest in a case-insensitive fashion
+ /// Compares the contents of \c src and \c dest in a case-insensitive fashion
static int_type str_compare_no_case(char_type const* s1, char_type const* s2);
- /// Comparies the contents of \c src and \c dest up to \c cch characters
+ /// Compares the contents of \c src and \c dest up to \c cch characters
static int_type str_n_compare(char_type const* s1, char_type const* s2, size_type cch);
/// Evaluates the length of \c src
static size_type str_len(char_type const* src);
View
64 include/stlsoft/error/error_desc.hpp
@@ -4,36 +4,37 @@
* Purpose: Converts a standard rerror code (errno) to a printable string.
*
* Created: 18th July 2006
- * Updated: 11th May 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2006-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,8 +52,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_MAJOR 1
# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_MINOR 2
-# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_REVISION 2
-# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_EDIT 21
+# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_REVISION 4
+# define STLSOFT_VER_STLSOFT_ERROR_HPP_ERROR_DESC_EDIT 23
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -213,11 +214,7 @@ struct error_desc_traits<ss_char_w_t>
if(size_t(-1) == n)
{
- ss.swap(return_t(L"could not determine error"));
- }
- else
- {
- ;
+ return return_t(L"could not determine error");
}
return ss;
@@ -301,6 +298,15 @@ class basic_error_desc
ss_explicit_k basic_error_desc(error_type error = errno);
/// \brief Releases any resources.
~basic_error_desc() stlsoft_throw_0();
+
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+# ifdef STLSOFT_COMPILER_IS_GCC
+ basic_error_desc(class_type const& rhs)
+ : m_str(string_dup(rhs.m_str, rhs.m_length, get_allocator_()))
+ , m_length(rhs.m_length)
+ {}
+# endif /* compiler */
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/// @}
/// \name Attributes
@@ -337,7 +343,9 @@ class basic_error_desc
/// \name Not to be implemented
/// @{
private:
+#ifndef STLSOFT_COMPILER_IS_GCC
basic_error_desc(class_type const&);
+#endif /* compiler */
basic_error_desc& operator =(class_type const&);
/// @}
};
View
43 include/stlsoft/filesystem/read_line.hpp
@@ -4,7 +4,7 @@
* Purpose: Definition of stlsoft::read_line() function template.
*
* Created: 2nd January 2007
- * Updated: 11th May 2010
+ * Updated: 9th June 2010
*
* Home: http://stlsoft.org/
*
@@ -51,8 +51,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_MAJOR 2
# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_MINOR 1
-# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_REVISION 1
-# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_EDIT 12
+# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_REVISION 2
+# define STLSOFT_VER_STLSOFT_FILESYSTEM_HPP_READ_LINE_EDIT 14
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -98,11 +98,16 @@ struct read_line_flags
{
enum flags_t
{
- recogniseCrAsEOL = 0x0001, /*!< Recognises a sole carriage return ('\r') character as a line feed */
+ /** Recognises a sole carriage return (<code>'\r'</code>) character as the end-of-line marker */
+ recogniseCrAsEOL = 0x0001,
+ /** Recognises a sole line feed (<code>'\r'</code>) character as the end-of-line marker */
recogniseLfAsEOL = 0x0002,
+ /** Recognises the carriage return + line feed sequence (<code>"\r\n"</code>) as the end-of-line marker */
recogniseCrLfAsEOL = 0x0004,
+ /** Recognises a sole carriage return (<code>'\r'</code>) character, or a sole line feed (<code>'\r'</code>) character or the carriage return + line feed sequence (<code>"\r\n"</code>) as the end-of-line marker */
recogniseAll = (recogniseCrAsEOL | recogniseLfAsEOL | recogniseCrLfAsEOL),
+ /** Flags mask */
mask = 0x0007
};
};
@@ -118,7 +123,7 @@ inline read_line_flags::flags_t operator |(read_line_flags::flags_t const& lhs,
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
-struct read_line_impl
+namespace readers
{
class read_from_FILE
{
@@ -276,6 +281,10 @@ struct read_line_impl
ss_size_t m_current;
};
+} /* namespace readers */
+
+namespace read_line_impl
+{
template< ss_typename_param_k S
, ss_typename_param_k P
>
@@ -369,7 +378,8 @@ struct read_line_impl
return !line.empty();
}
-};
+
+} /* namespace read_line_impl */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
@@ -391,14 +401,18 @@ struct read_line_impl
* \retval true The parsing is not complete
* \retval false The parsing is complete
*
- * \remarks The function can any or all of the following as line-termination
- * sequences: carriage-return ('\r'), line-feed ('\n'), or
+ * \remarks The function can recognise any or all of the following as
+ * line-termination sequences: carriage-return ('\r'), line-feed ('\n'), or
* carriage-return+line-feed ("\r\n").
*/
template <ss_typename_param_k S>
-ss_bool_t read_line(FILE* stm, S& line, read_line_flags::flags_t flags = read_line_flags::recogniseAll)
+ss_bool_t read_line(
+ FILE* stm
+, S& line
+, read_line_flags::flags_t flags = read_line_flags::recogniseAll
+)
{
- read_line_impl::read_from_FILE policy(stm);
+ readers::read_from_FILE policy(stm);
return read_line_impl::read_line(policy, line, flags);
}
@@ -408,9 +422,14 @@ ss_bool_t read_line(FILE* stm, S& line, read_line_flags::flags_t flags = read_li
template< ss_typename_param_k I
, ss_typename_param_k S
>
-ss_bool_t read_line(I from, I to, S& line, read_line_flags::flags_t flags = read_line_flags::recogniseAll)
+ss_bool_t read_line(
+ I from
+, I to
+, S& line
+, read_line_flags::flags_t flags = read_line_flags::recogniseAll
+)
{
- read_line_impl::read_from_iterator_range<I> policy(from, to);
+ readers::read_from_iterator_range<I> policy(from, to);
return read_line_impl::read_line(policy, line, flags);
}
View
8 include/stlsoft/internal/cccap/msvc.h
@@ -4,7 +4,7 @@
* Purpose: Compiler feature discrimination for Visual C++.
*
* Created: 7th February 2003
- * Updated: 28th April 2010
+ * Updated: 9th June 2010
*
* Thanks: To Cláudio Albuquerque for working on the
* Win64-compatibility.
@@ -64,8 +64,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_MAJOR 3
# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_MINOR 22
-# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_REVISION 1
-# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_EDIT 116
+# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_REVISION 2
+# define STLSOFT_VER_H_STLSOFT_CCCAP_MSVC_EDIT 117
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -189,7 +189,7 @@
* - -ve % +ve => -ve result
*/
-#if _MSC_VER >= 1500
+#if _MSC_VER >= 1600
# define STLSOFT_CF_BUILTIN_nullptr_SUPPORT
#endif /* compiler */
View
47 include/stlsoft/iterators/adapted_iterator_traits.hpp
@@ -4,36 +4,37 @@
* Purpose: Traits for detecting characteristics of adapted iterators.
*
* Created: 9th July 2004
- * Updated: 10th August 2009
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
- * Copyright (c) 2004-2009, Matthew Wilson and Synesis Software
+ * Copyright (c) 2004-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -52,7 +53,7 @@
# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ADAPTED_ITERATOR_TRAITS_MAJOR 2
# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ADAPTED_ITERATOR_TRAITS_MINOR 5
# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ADAPTED_ITERATOR_TRAITS_REVISION 4
-# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ADAPTED_ITERATOR_TRAITS_EDIT 48
+# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ADAPTED_ITERATOR_TRAITS_EDIT 49
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
View
209 include/stlsoft/iterators/associative_select_iterator.hpp
@@ -1,40 +1,44 @@
/* /////////////////////////////////////////////////////////////////////////
* File: stlsoft/iterators/associative_select_iterator.hpp
*
- * Purpose: An iterator adaptor that uses a select functor on its underlying
- * iterator in order to obtain the value_type.
+ * Purpose: An iterator adaptor that uses a selection function on its
+ * underlying iterator in order to obtain the key/mapped type.
*
* Created: 28th January 2005
- * Updated: 10th August 2009
+ * Updated: 21st June 2010
+ *
+ * Thanks: To Manfred Ehrhart, for detecting issues with iterator
+ * member types and select_second().
*
* Home: http://stlsoft.org/
*
- * Copyright (c) 2005-2009, Matthew Wilson and Synesis Software
+ * Copyright (c) 2005-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,9 +55,9 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_MAJOR 2
-# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_MINOR 0
+# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_MINOR 2
# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_REVISION 1
-# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_EDIT 24
+# define STLSOFT_VER_STLSOFT_ITERATORS_HPP_ASSOCIATIVE_SELECT_ITERATOR_EDIT 27
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -77,6 +81,19 @@
# include <stlsoft/util/std/iterator_helper.hpp>
#endif /* !STLSOFT_INCL_STLSOFT_UTIL_STD_HPP_ITERATOR_HELPER */
+#if defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT) && \
+ !defined(STLSOFT_COMPILER_IS_BORLAND)
+# ifndef STLSOFT_INCL_STLSOFT_ITERATOR_HPP_ADAPTED_ITERATOR_TRAITS
+# include <stlsoft/iterators/adapted_iterator_traits.hpp>
+# endif /* !STLSOFT_INCL_STLSOFT_ITERATOR_HPP_ADAPTED_ITERATOR_TRAITS */
+# ifndef STLSOFT_INCL_STLSOFT_META_HPP_IS_POINTER_TYPE
+# include <stlsoft/meta/is_pointer_type.hpp>
+# endif /* !STLSOFT_INCL_STLSOFT_META_HPP_IS_POINTER_TYPE */
+# ifndef STLSOFT_INCL_STLSOFT_META_HPP_YESNO
+# include <stlsoft/meta/yesno.hpp>
+# endif /* !STLSOFT_INCL_STLSOFT_META_HPP_YESNO */
+#endif /* STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
+
/* /////////////////////////////////////////////////////////////////////////
* Namespace
*/
@@ -104,16 +121,35 @@ struct select_first
typedef value_type const& const_reference;
public:
- reference operator ()(P const& p)
+ reference operator ()(P& p)
+ {
+ return p.first;
+ }
+ const_reference operator ()(P const& p) const
{
return p.first;
}
+};
+
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+
+template <class P>
+struct select_first_const
+{
+public:
+ typedef const ss_typename_type_k P::first_type value_type;
+ typedef value_type& reference;
+ typedef value_type& const_reference;
+
+public:
const_reference operator ()(P const& p) const
{
return p.first;
}
};
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
+
/** \brief Selects the \c first second of the type to which it is applied
*
* \ingroup group__library__iterators
@@ -128,7 +164,7 @@ struct select_second
typedef value_type const& const_reference;
public:
- reference operator ()(P const& p)
+ reference operator ()(P& p)
{
return p.second;
}
@@ -168,21 +204,49 @@ template< ss_typename_param_k I
class associative_select_iterator
{
public:
+ /// The type of the adapted iterator
typedef I adapted_iterator_type;
+ /// The type of the selecting function
typedef F selecting_function_type;
+ /// The iterator category type
typedef ss_typename_type_k I::iterator_category iterator_category;
+ /// The value type
typedef ss_typename_type_k F::value_type value_type;
- typedef ss_typename_type_k I::distance_type distance_type;
- typedef associative_select_iterator<I, F> class_type;
-
- typedef value_type& reference;
- typedef value_type const& const_reference;
- typedef value_type* pointer;
- typedef value_type const* const_pointer;
+ /// The difference type
+ typedef ss_ptrdiff_t difference_type;
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+ typedef difference_type distance_type;
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
+ /// This type
+ typedef associative_select_iterator<I, F> class_type;
+ /// The mutating (non-const) reference type
+ typedef value_type& reference;
+ /// The non-mutating (const) reference type
+ typedef value_type const& const_reference;
+ /// The mutating (non-const) pointer type
+ typedef value_type* pointer;
+ /// The non-mutating (const) pointer type
+ typedef value_type const* const_pointer;
public:
- ss_explicit_k associative_select_iterator( adapted_iterator_type i
- , selecting_function_type f = selecting_function_type())
+ /// Constructs an instance of the iterator from the adapted iterator
+ /// and, optionally, an instance of the selecting function type
+ ///
+ /// \param i The iterator to be adapted
+ /// \param f The selecting function
+#if defined(STLSOFT_COMPILER_IS_MSVC) && \
+ _MSC_VER < 1400
+ associative_select_iterator(
+ adapted_iterator_type i
+ , selecting_function_type f = selecting_function_type()
+ )
+#else /* ? compiler */
+ template <ss_typename_param_k I2>
+ associative_select_iterator(
+ I2 i
+ , selecting_function_type f = selecting_function_type()
+ )
+#endif /* compiler */
: m_i(i)
, m_f(f)
{}
@@ -220,9 +284,74 @@ class associative_select_iterator
};
/* /////////////////////////////////////////////////////////////////////////
+ * Creator functions
+ */
+
+/** Creates an instance of associative_select_iterator.
+ *
+ * \param i The iterator to be adapted
+ * \param f The function to select \c first or \c second member
+ */
+template< ss_typename_param_k I
+ , ss_typename_param_k F
+ >
+inline associative_select_iterator<I, F> make_associative_select_iterator(I i, F f)
+{
+ return associative_select_iterator<I, F>(i, f);
+}
+
+/** Creates an instance of associative_select_iterator.
+ *
+ * \param i The iterator to be adapted
+ * \param f The function to select \c first or \c second member
+ */
+template< ss_typename_param_k I
+ , ss_typename_param_k F
+ >
+inline associative_select_iterator<I, F> associative_select(I i, F f)
+{
+ return make_associative_select_iterator(i, f);
+}
+
+#if defined(STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT) && \
+ !defined(STLSOFT_COMPILER_IS_BORLAND)
+
+/** Creates an instance of associative_select_iterator that selects the
+ * \c first member.
+ *
+ * \param i The iterator to be adapted
+ */
+template <ss_typename_param_k I>
+inline associative_select_iterator<
+ I
+, select_first<ss_typename_type_k adapted_iterator_traits<I>::value_type>
+> assoc_select_first(I i)
+{
+ return make_associative_select_iterator(i, select_first<ss_typename_type_k adapted_iterator_traits<I>::value_type>());
+}
+
+/** Creates an instance of associative_select_iterator that selects the
+ * \c second member.
+ *
+ * \param i The iterator to be adapted
+ */
+template <ss_typename_param_k I>
+inline associative_select_iterator<
+ I
+, select_second<ss_typename_type_k adapted_iterator_traits<I>::value_type>
+> assoc_select_second(I i)
+{
+ return make_associative_select_iterator(i, select_second<ss_typename_type_k adapted_iterator_traits<I>::value_type>());
+}
+
+#endif /* STLSOFT_CF_TEMPLATE_PARTIAL_SPECIALISATION_SUPPORT */
+
+/* /////////////////////////////////////////////////////////////////////////
* Operators
*/
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+
template< ss_typename_param_k I
, ss_typename_param_k F
>
@@ -239,6 +368,8 @@ inline ss_bool_t operator !=(associative_select_iterator<I, F> const& lhs, assoc
return !lhs.equal(rhs);
}
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
+
/* ////////////////////////////////////////////////////////////////////// */
#ifndef _STLSOFT_NO_NAMESPACE
View
47 include/stlsoft/memory/auto_buffer.hpp
@@ -4,39 +4,40 @@
* Purpose: Contains the auto_buffer template class.
*
* Created: 19th January 2002
- * Updated: 10th August 2009
+ * Updated: 21st June 2010
*
* Thanks: To Thorsten Ottosen for pointing out that allocators were
* not swapped.
*
* Home: http://stlsoft.org/
*
- * Copyright (c) 2002-2009, Matthew Wilson and Synesis Software
+ * Copyright (c) 2002-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -54,7 +55,7 @@
# define STLSOFT_VER_STLSOFT_MEMORY_HPP_AUTO_BUFFER_MAJOR 5
# define STLSOFT_VER_STLSOFT_MEMORY_HPP_AUTO_BUFFER_MINOR 2
# define STLSOFT_VER_STLSOFT_MEMORY_HPP_AUTO_BUFFER_REVISION 4
-# define STLSOFT_VER_STLSOFT_MEMORY_HPP_AUTO_BUFFER_EDIT 162
+# define STLSOFT_VER_STLSOFT_MEMORY_HPP_AUTO_BUFFER_EDIT 163
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
View
11 include/stlsoft/stlsoft.h
@@ -6,7 +6,7 @@
* types.
*
* Created: 15th January 2002
- * Updated: 7th June 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
@@ -54,8 +54,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_H_STLSOFT_MAJOR 3
# define STLSOFT_VER_STLSOFT_H_STLSOFT_MINOR 22
-# define STLSOFT_VER_STLSOFT_H_STLSOFT_REVISION 4
-# define STLSOFT_VER_STLSOFT_H_STLSOFT_EDIT 405
+# define STLSOFT_VER_STLSOFT_H_STLSOFT_REVISION 5
+# define STLSOFT_VER_STLSOFT_H_STLSOFT_EDIT 406
#else /* ? STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* # include "./internal/doxygen_defs.h" */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
@@ -261,12 +261,13 @@
# define _STLSOFT_VER_1_9_96 0x010960ff /*!< Version 1.9.96 (10th March 2010) */
# define _STLSOFT_VER_1_9_97 0x010961ff /*!< Version 1.9.97 (3rd April 2010) */
# define _STLSOFT_VER_1_9_98 0x010962ff /*!< Version 1.9.98 (7th June 2010) */
+# define _STLSOFT_VER_1_9_99 0x010963ff /*!< Version 1.9.99 (21st June 2010) */
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
#define _STLSOFT_VER_MAJOR 1
#define _STLSOFT_VER_MINOR 9
-#define _STLSOFT_VER_REVISION 98
-#define _STLSOFT_VER _STLSOFT_VER_1_9_98
+#define _STLSOFT_VER_REVISION 99
+#define _STLSOFT_VER _STLSOFT_VER_1_9_99
/* /////////////////////////////////////////////////////////////////////////
* Basic macros
View
107 include/stlsoft/string/special_string_instance.hpp
@@ -4,39 +4,40 @@
* Purpose: Special string instance class template.
*
* Created: 3rd June 2006
- * Updated: 10th August 2009
+ * Updated: 21st June 2010
*
* Thanks to: Pablo Aguilar for spotting my omission of string access shims
* for special_string_instance_1.
*
* Home: http://stlsoft.org/
*
- * Copyright (c) 2006-2009, Matthew Wilson and Synesis Software
+ * Copyright (c) 2006-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -54,8 +55,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_MAJOR 1
# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_MINOR 2
-# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_REVISION 5
-# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_EDIT 19
+# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_REVISION 6
+# define STLSOFT_VER_STLSOFT_STRING_HPP_SPECIAL_STRING_INSTANCE_EDIT 20
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -118,15 +119,27 @@ struct ssi_buffer
/// \name Member Types
/// @{
public:
- typedef C char_type;
- typedef A allocator_type;
- typedef ss_size_t size_type;
- typedef A0 argument_0_type;
+ /// The character type
+ typedef C char_type;
+ /// The allocator type
+ typedef A allocator_type;
+ /// The size type
+ typedef ss_size_t size_type;
+ /// The argument type
+ typedef A0 argument_0_type;
+ /// The class type
+ typedef ssi_buffer<C, N, A, A0> class_type;
+private:
+ /// The buffer type
+ typedef stlsoft::auto_buffer<
+ char_type
#if defined(STLSOFT_COMPILER_IS_BORLAND)
- typedef stlsoft::auto_buffer<char_type, 128, allocator_type> buffer_type;
+ , 128
#else /* ? compiler */
- typedef stlsoft::auto_buffer<char_type, N, allocator_type> buffer_type;
+ , N
#endif /* compiler */
+ , allocator_type
+ > buffer_type_;
/// @}
/// \name Construction
@@ -136,6 +149,14 @@ struct ssi_buffer
: m_len(0)
, m_buffer(0)
{}
+#ifdef STLSOFT_COMPILER_IS_GCC
+ ssi_buffer(class_type const& rhs)
+ : m_len(rhs.m_len)
+ , m_buffer(rhs.m_len + 1)
+ {
+ ::memcpy(&m_buffer[0], &rhs.m_buffer[0], sizeof(char_type) * (1u + m_len));
+ }
+#endif /* compiler */
void init(size_type (*pfn)(char_type*, size_type))
{
@@ -213,7 +234,7 @@ struct ssi_buffer
/// @{
private:
size_type m_len;
- buffer_type m_buffer;
+ buffer_type_ m_buffer;
/// @}
};
@@ -247,6 +268,11 @@ struct ssi_buffer_non_static
{
parent_class_type::init(a0, pfn);
}
+#ifdef STLSOFT_COMPILER_IS_GCC
+ ssi_buffer_non_static(class_type const& rhs)
+ : parent_class_type(rhs)
+ {}
+#endif /* compiler */
/// @}
/// \name Accessors
@@ -265,7 +291,9 @@ struct ssi_buffer_non_static
/// \name Not to be implemented
/// @{
private:
+#ifndef STLSOFT_COMPILER_IS_GCC
ssi_buffer_non_static(class_type const&);
+#endif /* compiler */
class_type& operator =(class_type const&);
/// @}
};
@@ -300,6 +328,11 @@ struct ssi_buffer_static
ssi_buffer_static(A0 a0, size_type (*pfn)(A0, char_type*, size_type))
: m_buffer(a0, get_buffer(a0, pfn))
{}
+#ifdef STLSOFT_COMPILER_IS_GCC
+ ssi_buffer_static(class_type const& rhs)
+ : m_buffer(rhs.m_buffer)
+ {}
+#endif /* compiler */
/// @}
/// \name Accessors
@@ -359,13 +392,15 @@ struct ssi_buffer_static
/// \name Members
/// @{
private:
- ssi_buffer_type &m_buffer;
+ ssi_buffer_type& m_buffer;
/// @}
/// \name Not to be implemented
/// @{
private:
+#ifndef STLSOFT_COMPILER_IS_GCC
ssi_buffer_static(class_type const&);
+#endif /* compiler */
class_type& operator =(class_type const&);
/// @}
};
@@ -490,7 +525,7 @@ class special_string_instance_0
ssi_buffer_static_type
, ssi_buffer_non_static_type
, policy_indicates_shared_state
- >::type buffer_type;
+ >::type buffer_type_;
/// @}
/// \name Construction
@@ -557,7 +592,7 @@ class special_string_instance_0
/// \name Members
/// @{
private:
- buffer_type m_buffer;
+ buffer_type_ m_buffer;
/// @}
};
@@ -678,7 +713,7 @@ class special_string_instance_1
ssi_buffer_static_type
, ssi_buffer_non_static_type
, policy_indicates_shared_state
- >::type buffer_type;
+ >::type buffer_type_;
/// @}
@@ -745,7 +780,7 @@ class special_string_instance_1
/// \name Member Types
/// @{
private:
- buffer_type m_buffer;
+ buffer_type_ m_buffer;
/// @}
};
View
47 include/stlsoft/util/std/library_discriminator.hpp
@@ -4,36 +4,37 @@
* Purpose: Discriminates between standard library implementations
*
* Created: 2nd January 2000
- * Updated: 22nd March 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2000-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,8 +52,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_MAJOR 4
# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_MINOR 6
-# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_REVISION 2
-# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_EDIT 102
+# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_REVISION 3
+# define STLSOFT_VER_STLSOFT_UTIL_STD_LIBRARY_DISCRIMINATOR_EDIT 103
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
View
83 include/unixstl/filesystem/directory_functions.hpp
@@ -4,7 +4,7 @@
* Purpose: Functions for manipulating directories.
*
* Created: 7th February 2002
- * Updated: 30th January 2010
+ * Updated: 10th June 2010
*
* Home: http://stlsoft.org/
*
@@ -51,7 +51,7 @@
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_MAJOR 3
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_MINOR 0
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_REVISION 5
-# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_EDIT 40
+# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_EDIT 41
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -474,46 +474,55 @@ inline us_bool_t create_directory_recurse(S const& dir, unsigned short mode = 07
*
* \ingroup group__library__filesystem
*
- * \param dir The path of the directory to remove
- * \param pfn Pointer to a callback function, which will receive notifications
- * and requests for file/directory deletion. The semantics of the
- * parameters are specified in the note below
- * \param param Caller-supplied parameter, passed through to the callback
- * function
+ * \param dir The path of the directory to remove.
+ * \param pfn Pointer to a callback function, which will receive
+ * notifications and requests for file/directory deletion. The semantics
+ * of the parameters are specified in the note below.
+ * \param param Caller-supplied parameter, always passed through to the
+ * callback function \c pfn.
*
* \note If no callback function is specified, then the function will remove
- * only empty subdirectories, i.e. no files will be removed. To remove
- * files, a function must be
+ * only empty subdirectories, i.e. no files will be removed. To remove
+ * files, a function must be supplied, and may take additional measures
+ * (such as changing file attributes) before the deletion is attempted by
+ * <code>remove_directory_recurse()</code>. Do not delete the file in the
+ * callback, otherwise the attempt within
+ * <code>remove_directory_recurse()</code> will fail, and the function
+ * will report overall failure of the operation.
*
* \note The semantics of the callback function's parameters are as follows:
- * \par If the err param is ~0 (-1 on UNIX), then the dir param specifies
- * the name of the current directory being traversed. All other params
- * are unspecified. The return value is ignored.
- * \par If the err param is 0 and the st param is NULL, then dir specifies
- * the name of a directory that has been successfully removed. All
- * other params are unspecified. The return value is ignored.
- * \par If the err param is 0 and the st param is not NULL, then dir specifies
- * the name of the currently traversing directory, st specifies the
- * stat information for the entry to be deleted, and de specifies the
- * name of the entry within directory dir that is a candidate for
- * removal. Return true to enable removal of this entry, or false to
- * prevent removal (and cancel the overall operation). All
- * other params are unspecified. The return value is ignored.
- * \par If the err param is any other value, and the st param is NULL, then
- * the dir param specifies the name of a directory that could not be
- * deleted and err specifies the errno value associated with the failure.
- * All other params are unspecified. The return value is ignored.
- * \par If the err param is any other value, and the st param is not NULL, then
- * the dir param specifies the name of a directory within which an entry
- * could not be deleted, st specifies the stat information of the entry
- * that could not be deleted, de specifies the name of the entry that
- * could not be deleted, and err specifies the errno value associated
- * with the failure. All other params are unspecified. The return value
- * is ignored.
+ * \li If the err param is ~0 (-1 on UNIX), then the \c dir param specifies
+ * the name of the current directory being traversed. All other params are
+ * unspecified (except \c param). The return value is ignored.
+ * \li If the err param is 0 and the \c st param is NULL, then \c dir
+ * specifies the name of a directory that has been successfully removed.
+ * All other params are unspecified (except \c param). The return value is
+ * ignored.
+ * \li If the err param is 0 and the \c st param is not NULL, then \c dir
+ * specifies the name of the currently traversing directory, \c st
+ * specifies the stat information for the entry to be deleted, and \c de
+ * specifies the name of the entry within directory \c dir that is a
+ * candidate for removal. Return true to enable removal of this entry, or
+ * false to prevent removal (and cancel the overall operation). All other
+ * params are unspecified (except \c param). The return value is ignored.
+ * \li If the err param is any other value, and the \c st param is NULL,
+ * then the \c dir param specifies the name of a directory that could not
+ * be deleted and err specifies the errno value associated with the
+ * failure. All other params are unspecified (except \c param). The return
+ * value is ignored.
+ * \li If the err param is any other value, and the \c st param is not NULL,
+ * then the \c dir param specifies the name of a directory within which an
+ * entry could not be deleted, \c st specifies the stat information of the
+ * entry that could not be deleted, \c de specifies the name of the entry
+ * that could not be deleted, and err specifies the errno value associated
+ * with the failure. All other params are unspecified (except \c param).
+ * The return value is ignored.
*/
-inline us_bool_t remove_directory_recurse( us_char_a_t const* dir
- , us_int_t (*pfn)(void* param, us_char_a_t const* subDir, struct stat const* st, struct dirent const* de, int err)
- , void* param)
+inline us_bool_t remove_directory_recurse(
+ us_char_a_t const* dir
+, us_int_t (*pfn)(void* param, us_char_a_t const* subDir, struct stat const* st, struct dirent const* de, int err)
+, void* param
+)
{
typedef filesystem_traits<us_char_a_t> traits_t;
View
106 include/unixstl/filesystem/filesystem_traits.hpp
@@ -5,7 +5,7 @@
* Unicode specialisations thereof.
*
* Created: 15th November 2002
- * Updated: 5th February 2010
+ * Updated: 21st June 2010
*
* Thanks: To Sergey Nikulov, for spotting a pre-processor typo that
* broke GCC -pedantic
@@ -16,28 +16,29 @@
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -54,9 +55,9 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MAJOR 4
-# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MINOR 3
-# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_REVISION 11
-# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 110
+# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MINOR 4
+# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_REVISION 1
+# define UNIXSTL_VER_UNIXSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 111
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -215,9 +216,30 @@ struct filesystem_traits
{
maxPathLength = 1 + PATH_MAX //!< The maximum length of a path for the current file system
};
+
+ enum
+ {
+#ifdef _WIN32
+ pathComparisonIsCaseSensitive = false
+#else
+ pathComparisonIsCaseSensitive = true
+#endif
+ };
/// @}
#endif /* PATH_MAX */
+/// \name General string handling
+/// @{
+public:
+ /// Compares the contents of \c src and \c dest, according to the
+ /// lexicographical ordering on the host operating system.
+ static int_type str_fs_compare(char_type const* s1, char_type const* s2);
+ /// Compares the contents of \c src and \c dest up to \c cch
+ /// characters. according to the lexicographical ordering on the host
+ /// operating system.
+ static int_type str_fs_n_compare(char_type const* s1, char_type const* s2, size_type cch);
+/// @}
+
/// \name File-system entry names
/// @{
public:
@@ -422,6 +444,24 @@ struct filesystem_traits<us_char_a_t>
#endif /* PATH_MAX */
public:
+ static int_type str_fs_compare(char_type const* s1, char_type const* s2)
+ {
+#ifdef _WIN32
+ return str_compare_no_case(s1, s2);
+#else
+ return str_compare(s1, s2);
+#endif
+ }
+
+ static int_type str_fs_n_compare(char_type const* s1, char_type const* s2, size_type cch)
+ {
+#ifdef _WIN32
+ return str_n_compare_no_case(s1, s2, cch);
+#else
+ return str_n_compare(s1, s2, cch);
+#endif
+ }
+
static char_type* ensure_dir_end(char_type* dir)
{
UNIXSTL_ASSERT(NULL != dir);
@@ -1160,6 +1200,24 @@ struct filesystem_traits<us_char_w_t>
#endif /* PATH_MAX */
public:
+ static int_type str_fs_compare(char_type const* s1, char_type const* s2)
+ {
+#ifdef _WIN32
+ return str_compare_no_case(s1, s2);
+#else
+ return str_compare(s1, s2);
+#endif
+ }
+
+ static int_type str_fs_n_compare(char_type const* s1, char_type const* s2, size_type cch)
+ {
+#ifdef _WIN32
+ return str_n_compare_no_case(s1, s2, cch);
+#else
+ return str_n_compare(s1, s2, cch);
+#endif
+ }
+
static char_type* ensure_dir_end(char_type* dir)
{
UNIXSTL_ASSERT(NULL != dir);
View
53 include/unixstl/system/system_traits.hpp
@@ -5,36 +5,37 @@
* Unicode specialisations thereof.
*
* Created: 15th November 2002
- * Updated: 31st March 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2002-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,9 +52,9 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_MAJOR 5
-# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_MINOR 2
+# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_MINOR 3
# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_REVISION 1
-# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_EDIT 107
+# define UNIXSTL_VER_UNIXSTL_SYSTEM_HPP_SYSTEM_TRAITS_EDIT 108
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -209,6 +210,8 @@ struct system_traits
static int_type str_compare_no_case(char_type const* s1, char_type const* s2);
/// Comparies the contents of \c src and \c dest up to \c cch characters
static int_type str_n_compare(char_type const* s1, char_type const* s2, size_type cch);
+ /// Comparies the contents of \c src and \c dest up to \c cch characters
+ static int_type str_n_compare_no_case(char_type const* s1, char_type const* s2, size_type cch);
/// Evaluates the length of \c src
static size_type str_len(char_type const* src);
/// Finds the given character \c ch in \c s
@@ -328,6 +331,8 @@ struct system_traits<us_char_a_t>
return ::strncmp(s1, s2, cch);
}
+ static int_type str_n_compare_no_case(char_type const* s1, char_type const* s2, size_type cch);
+
static size_type str_len(char_type const* src)
{
return static_cast<size_type>(::strlen(src));
@@ -523,6 +528,8 @@ struct system_traits<us_char_w_t>
return ::wcsncmp(s1, s2, cch);
}
+ static int_type str_n_compare_no_case(char_type const* s1, char_type const* s2, size_type cch);
+
static size_type str_len(char_type const* src)
{
return static_cast<size_type>(::wcslen(src));
View
117 include/winstl/conversion/char_conversions.hpp
@@ -4,36 +4,37 @@
* Purpose: Type conversions for Windows.
*
* Created: 31st May 2003
- * Updated: 19th January 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2003-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,8 +52,8 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_MAJOR 5
# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_MINOR 3
-# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_REVISION 1
-# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_EDIT 89
+# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_REVISION 2
+# define WINSTL_VER_WINSTL_CONVERSION_HPP_CHAR_CONVERSIONS_EDIT 90
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -130,7 +131,7 @@ namespace winstl_project
* Classes
*/
-/** \brief Converts a multibyte (<code>char</code>-based) string to a wide
+/** Converts a multibyte (<code>char</code>-based) string to a wide
* (<code>whar_t</code>-based) string.
*
* \ingroup group__library__conversion
@@ -144,14 +145,16 @@ class multibyte2wide
private:
typedef auto_buffer_old<ws_char_w_t, processheap_allocator<ws_char_w_t>, CCH> parent_class_type;
public:
- /// \brief The character type
+ /// The character type
typedef ws_char_w_t char_type;
- /// \brief The alternate character type
+ /// The alternate character type
typedef ws_char_a_t alt_char_type;
- /// \brief The size type
+ /// The size type
typedef ss_typename_type_k parent_class_type::size_type size_type;
- /// \brief The pointer type
+ /// The pointer type
typedef ss_typename_type_k parent_class_type::pointer pointer;
+ /// This type
+ typedef multibyte2wide<CCH> class_type;
/// @}
/// \name Construction
@@ -168,6 +171,19 @@ class multibyte2wide
prepare_(stlsoft_ns_qual(c_str_ptr_a)(s));
}
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+# ifdef STLSOFT_COMPILER_IS_GCC
+ multibyte2wide(class_type const& s)
+ : parent_class_type(s.size() + 1)
+ {
+ char_type* p = &static_cast<parent_class_type&>(*this)[0];
+
+ ::memcpy(p, s, sizeof(char_type) * (1u + s.size()));
+ STLSOFT_ASSERT('\0' == (*this)[s.size()]);
+ }
+# endif /* compiler */
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
+
#ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
template <ss_typename_param_k S>
multibyte2wide(S const& s, size_type cch)
@@ -255,14 +271,16 @@ class multibyte2wide
/// \name Not to be implemented
/// @{
private:
- multibyte2wide(multibyte2wide const&);
- multibyte2wide& operator =(multibyte2wide const&);
+#ifndef STLSOFT_COMPILER_IS_GCC
+ multibyte2wide(class_type const&);
+#endif /* compiler */
+ multibyte2wide& operator =(class_type const&);
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/// @}
};
-/** \brief Converts a wide (<code>whar_t</code>-based) string to a
+/** Converts a wide (<code>whar_t</code>-based) string to a
* multibyte (<code>char</code>-based) string.
*
* \ingroup group__library__conversion
@@ -276,14 +294,16 @@ class wide2multibyte
private:
typedef auto_buffer_old<ws_char_a_t, processheap_allocator<ws_char_a_t>, CCH> parent_class_type;
public:
- /// \brief The character type
+ /// The character type
typedef ws_char_a_t char_type;
- /// \brief The alternate character type
+ /// The alternate character type
typedef ws_char_w_t alt_char_type;
- /// \brief The size type
+ /// The size type
typedef ss_typename_type_k parent_class_type::size_type size_type;
- /// \brief The pointer type
+ /// The pointer type
typedef ss_typename_type_k parent_class_type::pointer pointer;
+ /// This type
+ typedef wide2multibyte<CCH> class_type;
/// @}
/// \name Construction
@@ -300,6 +320,19 @@ class wide2multibyte
prepare_(stlsoft_ns_qual(c_str_ptr_w)(s));
}
+#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
+# ifdef STLSOFT_COMPILER_IS_GCC
+ wide2multibyte(class_type const& s)
+ : parent_class_type(s.size() + 1)
+ {
+ char_type* p = &static_cast<parent_class_type&>(*this)[0];
+
+ ::memcpy(p, s, sizeof(char_type) * (1u + s.size()));
+ STLSOFT_ASSERT('\0' == (*this)[s.size()]);
+ }
+# endif /* compiler */
+#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
+
#ifdef STLSOFT_CF_MEMBER_TEMPLATE_CTOR_SUPPORT
template <ss_typename_param_k S>
ss_explicit_k wide2multibyte(S const& s, size_type cch)
@@ -386,8 +419,10 @@ class wide2multibyte
// Not to be implemented
private:
- wide2multibyte(wide2multibyte const&);
- wide2multibyte& operator =(wide2multibyte const&);
+#ifndef STLSOFT_COMPILER_IS_GCC
+ wide2multibyte(class_type const&);
+#endif /* compiler */
+ wide2multibyte& operator =(class_type const&);
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
};
@@ -424,25 +459,25 @@ class encoding2encoding
/* ////////////////////////////////////////////////////////////////////// */
-/** \brief Type that converts a multibyte string to a wide string.
+/** Type that converts a multibyte string to a wide string.
*
* \ingroup group__library__conversion
*/
typedef multibyte2wide<256> m2w;
-/** \brief Type that converts a wide string to a multibyte string.
+/** Type that converts a wide string to a multibyte string.
*
* \ingroup group__library__conversion
*/
typedef wide2multibyte<256> w2m;
-/** \brief [Deprecated] Type that converts a multibyte string to a wide string.
+/** [Deprecated] Type that converts a multibyte string to a wide string.
*
* \ingroup group__library__conversion
*
* \deprecated This name is deprecated in favour of winstl::m2w
*/
typedef multibyte2wide<256> a2w;
-/** \brief [Deprecated] Type that converts a wide string to a multibyte string.
+/** [Deprecated] Type that converts a wide string to a multibyte string.
*
* \ingroup group__library__conversion
*
View
80 include/winstl/filesystem/directory_functions.hpp
@@ -4,7 +4,7 @@
* Purpose: Functions for manipulating directories.
*
* Created: 7th February 2002
- * Updated: 30th January 2010
+ * Updated: 10th June 2010
*
* Home: http://stlsoft.org/
*
@@ -51,7 +51,7 @@
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_MAJOR 5
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_MINOR 0
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_REVISION 3
-# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_EDIT 46
+# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_DIRECTORY_FUNCTIONS_EDIT 47
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -512,41 +512,47 @@ inline ws_bool_t create_directory_recurse(S const& dir, LPSECURITY_ATTRIBUTES lp
*
* \ingroup group__library__filesystem
*
- * \param dir The path of the directory to remove
- * \param pfn Pointer to a callback function, which will receive notifications
- * and requests for file/directory deletion. The semantics of the
- * parameters are specified in the note below
- * \param param Caller-supplied parameter, passed through to the callback
- * function
+ * \param dir The path of the directory to remove.
+ * \param pfn Pointer to a callback function, which will receive
+ * notifications and requests for file/directory deletion. The semantics
+ * of the parameters are specified in the note below.
+ * \param param Caller-supplied parameter, always passed through to the
+ * callback function \c pfn.
*
* \note If no callback function is specified, then the function will remove
- * only empty subdirectories, i.e. no files will be removed. To remove
- * files, a function must be
+ * only empty subdirectories, i.e. no files will be removed. To remove
+ * files, a function must be supplied, and may take additional measures
+ * (such as changing file attributes) before the deletion is attempted by
+ * <code>remove_directory_recurse()</code>. Do not delete the file in the
+ * callback, otherwise the attempt within
+ * <code>remove_directory_recurse()</code> will fail, and the function
+ * will report overall failure of the operation.
*
* \note The semantics of the callback function's parameters are as follows:
- * \li If the err param is ~0 (-1 on UNIX), then the dir param specifies
- * the name of the current directory being traversed. All other params
- * are unspecified. The return value is ignored.
- * \li If the err param is 0 and the st param is NULL, then dir specifies
- * the name of a directory that has been successfully removed. All
- * other params are unspecified. The return value is ignored.
- * \li If the err param is 0 and the st param is not NULL, then dir specifies
- * the name of the currently traversing directory, st specifies the
- * stat information and the name of the entry within directory dir that
- * is a candidate for removal. Return >0 to enable removal of this
- * entry, or 0 to prevent removal and cancel the overall operation, or
- * <0 to prevent removal and continue.
- * All other params are unspecified. The return value is ignored.
- * \li If the err param is any other value, and the st param is NULL, then
- * the dir param specifies the name of a directory that could not be
- * deleted and err specifies the errno value associated with the failure.
- * All other params are unspecified. The return value is ignored.
- * \li If the err param is any other value, and the st param is not NULL, then
- * the dir param specifies the name of a directory within which an entry
- * could not be deleted, st specifies the stat information and the name
- * of the entry that could not be deleted, and err specifies the errno
- * value associated with the failure. All other params are unspecified.
- * The return value is ignored.
+ * \li If the err param is ~0 (-1 on UNIX), then the \c dir param specifies
+ * the name of the current directory being traversed. All other params are
+ * unspecified (except \c param). The return value is ignored.
+ * \li If the err param is 0 and the \c st param is NULL, then \c dir
+ * specifies the name of a directory that has been successfully removed.
+ * All other params are unspecified (except \c param). The return value is
+ * ignored.
+ * \li If the err param is 0 and the \c st param is not NULL, then \c dir
+ * specifies the name of the currently traversing directory, and \c st
+ * specifies the stat information for the entry to be deleted. Return true
+ * to enable removal of this entry, or false to prevent removal (and
+ * cancel the overall operation). All other params are unspecified (except
+ * \c param). The return value is ignored.
+ * \li If the err param is any other value, and the \c st param is NULL,
+ * then the \c dir param specifies the name of a directory that could not
+ * be deleted and err specifies the errno value associated with the
+ * failure. All other params are unspecified (except \c param). The return
+ * value is ignored.
+ * \li If the err param is any other value, and the \c st param is not NULL,
+ * then the \c dir param specifies the name of a directory within which an
+ * entry could not be deleted, \c st specifies the stat information of the
+ * entry that could not be deleted, and err specifies the errno value
+ * associated with the failure. All other params are unspecified (except
+ * \c param). The return value is ignored.
*/
inline ws_bool_t remove_directory_recurse( ws_char_a_t const* dir
, ws_int_t (*pfn)(void* param, ws_char_a_t const* subDir, WIN32_FIND_DATAA const* st, DWORD err)
@@ -574,9 +580,11 @@ inline ws_bool_t remove_directory_recurse(ws_char_a_t const* dir)
*
* \ingroup group__library__filesystem
*/
-inline ws_bool_t remove_directory_recurse( ws_char_w_t const* dir
- , ws_int_t (*pfn)(void* param, ws_char_w_t const* subDir, WIN32_FIND_DATAW const* st, DWORD err)
- , void* param)
+inline ws_bool_t remove_directory_recurse(
+ ws_char_w_t const* dir
+, ws_int_t (*pfn)(void* param, ws_char_w_t const* subDir, WIN32_FIND_DATAW const* st, DWORD err)
+, void* param
+)
{
typedef filesystem_traits<ws_char_w_t> traits_t;
View
87 include/winstl/filesystem/filesystem_traits.hpp
@@ -5,36 +5,37 @@
* Unicode specialisations thereof.
*
* Created: 15th November 2002
- * Updated: 15th February 2010
+ * Updated: 21st June 2010
*
* Home: http://stlsoft.org/
*
* Copyright (c) 2002-2010, Matthew Wilson and Synesis Software
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
+ * modification, are permitted provided that the following conditions are
+ * met:
*
- * - Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
- * any contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
+ * names of any contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ////////////////////////////////////////////////////////////////////// */
@@ -51,9 +52,9 @@
#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MAJOR 4
-# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MINOR 5
-# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_REVISION 10
-# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 120
+# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_MINOR 6
+# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_REVISION 1
+# define WINSTL_VER_WINSTL_FILESYSTEM_HPP_FILESYSTEM_TRAITS_EDIT 121
#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
/* /////////////////////////////////////////////////////////////////////////
@@ -231,6 +232,23 @@ struct filesystem_traits
{
maxPathLength = 1 + WINSTL_CONST_MAX_PATH //!< The maximum length of a path for the current file system
};
+
+ enum
+ {
+ pathComparisonIsCaseSensitive = false
+ };
+/// @}
+
+/// \name General string handling
+/// @{
+public:
+ /// Compares the contents of \c src and \c dest, according to the
+ /// lexicographical ordering on the host operating system.
+ static int_type str_fs_compare(char_type const* s1, char_type const* s2);
+ /// Compares the contents of \c src and \c dest up to \c cch
+ /// characters. according to the lexicographical ordering on the host
+ /// operating system.
+ static int_type str_fs_n_compare(char_type const* s1, char_type const* s2, size_type cch);
/// @}
/// \name File-system entry names
@@ -523,6 +541,16 @@ struct filesystem_traits<ws_char_a_t>
};
public:
+ static int_type str_fs_compare(char_type const* s1, char_type const* s2)
+ {
+ return str_compare_no_case(s1, s2);
+ }
+
+ static int_type str_fs_n_compare(char_type const* s1, char_type const* s2, size_type cch)
+ {
+ return str_n_compare_no_case(s1, s2, cch);