![]() |
![]() |
|
00001 /* ///////////////////////////////////////////////////////////////////////////// 00002 * File: src/shwild_string.hpp 00003 * 00004 * Purpose: String class for shwild implementation 00005 * 00006 * Created: 17th June 2005 00007 * Updated: 6th April 2008 00008 * 00009 * Home: http://shwild.org/ 00010 * 00011 * Copyright (c) 2005-2008, Matthew Wilson and Sean Kelly 00012 * All rights reserved. 00013 * 00014 * Redistribution and use in source and binary forms, with or without 00015 * modification, are permitted provided that the following conditions are met: 00016 * 00017 * - Redistributions of source code must retain the above copyright notice, this 00018 * list of conditions and the following disclaimer. 00019 * - Redistributions in binary form must reproduce the above copyright notice, 00020 * this list of conditions and the following disclaimer in the documentation 00021 * and/or other materials provided with the distribution. 00022 * - Neither the names of Matthew Wilson and Sean Kelly nor the names of 00023 * any contributors may be used to endorse or promote products derived from 00024 * this software without specific prior written permission. 00025 * 00026 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00027 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00028 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00029 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00030 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00031 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00032 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00033 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00034 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00035 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00036 * POSSIBILITY OF SUCH DAMAGE. 00037 * 00038 * ////////////////////////////////////////////////////////////////////////// */ 00039 00040 00041 #ifndef SHWILD_INCL_HPP_SHWILD_STRING 00042 #define SHWILD_INCL_HPP_SHWILD_STRING 00043 00044 /* ///////////////////////////////////////////////////////////////////////////// 00045 * Version information 00046 */ 00047 00048 #ifndef SHWILD_DOCUMENTATION_SKIP_SECTION 00049 # define SHWILD_VER_SHWILD_STRING_MAJOR 1 00050 # define SHWILD_VER_SHWILD_STRING_MINOR 0 00051 # define SHWILD_VER_SHWILD_STRING_REVISION 7 00052 # define SHWILD_VER_SHWILD_STRING_EDIT 7 00053 #endif /* !SHWILD_DOCUMENTATION_SKIP_SECTION */ 00054 00055 /* ///////////////////////////////////////////////////////////////////////////// 00056 * Includes 00057 */ 00058 00059 #include <shwild/shwild.h> 00060 00061 #include <stlsoft/stlsoft.h> /* If the compiler cannot find this, you are not using STLSoft 1.9 or later, as required. */ 00062 #if !defined(_STLSOFT_VER) || \ 00063 _STLSOFT_VER < 0x01091eff 00064 # error Requires STLSoft 1.9.30, or later. (www.stlsoft.org/downloads.html) 00065 #endif /* STLSoft version */ 00066 00067 #if defined(STLSOFT_CF_std_NAMESPACE) || \ 00068 defined(STLSOFT_CF_std_NAMESPACE) 00069 00070 # if !defined(SHWILD_CUSTOM_STRING_CLASS) 00071 # include <string> 00072 # else /* ? SHWILD_CUSTOM_STRING_CLASS */ 00073 # include SHWILD_CUSTOM_STRING_CLASS_INCLUDE 00074 # endif /* SHWILD_CUSTOM_STRING_CLASS */ 00075 00076 #else /* ? STLSOFT_CF_std_NAMESPACE */ 00077 00078 # if defined(STLSOFT_COMPILER_IS_WATCOM) 00079 # include <string.hpp> 00080 # define SHWILD_CUSTOM_STRING_CLASS WatcomString 00081 # else /* ? compiler */ 00082 # error No other non-std compiler is known 00083 # endif /* ? compiler */ 00084 00085 #endif /* STLSOFT_CF_std_NAMESPACE */ 00086 00087 /* ///////////////////////////////////////////////////////////////////////////// 00088 * Namespace 00089 */ 00090 00091 #if !defined(SHWILD_NO_NAMESPACE) 00092 namespace shwild 00093 { 00094 namespace impl 00095 { 00096 #endif /* !SHWILD_NO_NAMESPACE */ 00097 00098 /* ///////////////////////////////////////////////////////////////////////////// 00099 * Typedefs 00100 */ 00101 00102 #ifndef STLSOFT_CF_std_NAMESPACE 00103 # if defined(STLSOFT_COMPILER_IS_WATCOM) 00104 class WatcomString 00105 : public String 00106 { 00107 public: 00108 WatcomString(char const *s) 00109 : String(s) 00110 {} 00111 WatcomString(char const *s, size_t len) 00112 : String(s, len) 00113 {} 00114 public: 00115 char const *data() const 00116 { 00117 return *this; 00118 } 00119 }; 00120 # endif /* ? compiler */ 00121 #endif /* !STLSOFT_CF_std_NAMESPACE */ 00122 00123 #if !defined(SHWILD_CUSTOM_STRING_CLASS) 00124 typedef std::string shwild_string_t; 00125 #else /* ? SHWILD_CUSTOM_STRING_CLASS */ 00126 typedef SHWILD_CUSTOM_STRING_CLASS shwild_string_t; 00127 #endif /* SHWILD_CUSTOM_STRING_CLASS */ 00128 00129 /* ///////////////////////////////////////////////////////////////////////////// 00130 * Namespace 00131 */ 00132 00133 #if !defined(SHWILD_NO_NAMESPACE) 00134 } // namespace impl 00135 00136 } // namespace shwild 00137 #endif /* !SHWILD_NO_NAMESPACE */ 00138 00139 /* ////////////////////////////////////////////////////////////////////////// */ 00140 00141 #endif /* !SHWILD_INCL_HPP_SHWILD_STRING */ 00142 00143 /* ////////////////////////////////////////////////////////////////////////// */
|
b64 Library documentation © Synesis Software Pty Ltd, 2004-2007 |