You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
5.8 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/string/string_traits_fwd.hpp
  3. *
  4. * Purpose: Forward declaration of the string_traits traits class.
  5. *
  6. * Created: 1st April 2005
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 2005-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file stlsoft/string/string_traits_fwd.hpp
  40. *
  41. * \brief [C++ only] Forward definition of the stlsoft::string_traits traits
  42. * class
  43. * (\ref group__library__string "String" Library).
  44. */
  45. #ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD
  46. #define STLSOFT_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD
  47. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  48. # define STLSOFT_VER_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD_MAJOR 2
  49. # define STLSOFT_VER_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD_MINOR 0
  50. # define STLSOFT_VER_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD_REVISION 2
  51. # define STLSOFT_VER_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD_EDIT 18
  52. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  53. /* /////////////////////////////////////////////////////////////////////////
  54. * Includes
  55. */
  56. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  57. # include <stlsoft/stlsoft.h>
  58. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  59. /* /////////////////////////////////////////////////////////////////////////
  60. * Namespace
  61. */
  62. #ifndef _STLSOFT_NO_NAMESPACE
  63. namespace stlsoft
  64. {
  65. #endif /* _STLSOFT_NO_NAMESPACE */
  66. /* ////////////////////////////////////////////////////////////////////// */
  67. #ifdef STLSOFT_DOCUMENTATION_SKIP_SECTION
  68. /** \brief Traits for determining the characteristics of strings
  69. *
  70. * string_traits is a traits class for determining various characteristics of
  71. * strings.
  72. *
  73. * \param C The char type
  74. *
  75. * \ingroup group__library__string
  76. */
  77. template <ss_typename_param_k C>
  78. struct string_traits
  79. {
  80. typedef C value_type; //!< The value type
  81. typedef C char_type; //!< The char type
  82. typedef ss_size_t size_type; //!< The size type
  83. typedef ??? string_type; //!< The string type
  84. typedef ??? iterator; //!< The iterator type. Not defined for non-mutating type
  85. typedef ??? const_iterator; //!< The const_iterator type
  86. typedef ??? pointer; //!< The pointer type. Not defined for non-mutating type
  87. typedef ??? const_pointer; //!< The const_pointer type
  88. enum
  89. {
  90. is_pointer //!< non-zero if C is a pointer type
  91. };
  92. enum
  93. {
  94. , is_pointer_to_const //!< non-zero if C is a pointer-to-const type
  95. };
  96. enum
  97. {
  98. , char_type_size //!< The size of \c char_type
  99. };
  100. enum
  101. {
  102. , is_mutating //!< non-zero if C is a mutating type
  103. };
  104. /// \brief Returns an instance of the empty string form of the string type
  105. static string_type empty_string();
  106. /// \brief Constructs an instance of the string type
  107. static string_type construct(string_type const& src, size_type pos, size_type len);
  108. # ifdef STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT
  109. /// \brief Assigns a new value to the string, based on the range [first, last)
  110. ///
  111. /// \note The range [first, last) may be contained within the string instance
  112. template <ss_typename_param_k I>
  113. static string_type &assign_inplace(string_type &str, I first, I last);
  114. # else /* ? STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT */
  115. static string_type &assign_inplace(string_type &str, const_iterator first, const_iterator last);
  116. # endif /* STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION_SUPPORT */
  117. };
  118. #else /* ? STLSOFT_DOCUMENTATION_SKIP_SECTION */
  119. template <ss_typename_param_k T>
  120. struct string_traits;
  121. #endif /* STLSOFT_DOCUMENTATION_SKIP_SECTION */
  122. /* ////////////////////////////////////////////////////////////////////// */
  123. #ifndef _STLSOFT_NO_NAMESPACE
  124. } // namespace stlsoft
  125. #endif /* _STLSOFT_NO_NAMESPACE */
  126. /* ////////////////////////////////////////////////////////////////////// */
  127. #endif /* !STLSOFT_INCL_STLSOFT_STRING_HPP_STRING_TRAITS_FWD */
  128. /* ///////////////////////////// end of file //////////////////////////// */