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