00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00047 #ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS
00048 #define STLSOFT_INCL_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS
00049
00050 #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
00051 # define STLSOFT_VER_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS_MAJOR 2
00052 # define STLSOFT_VER_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS_MINOR 0
00053 # define STLSOFT_VER_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS_REVISION 2
00054 # define STLSOFT_VER_STLSOFT_STRING_HPP_TOKENISER_FUNCTIONS_EDIT 22
00055 #endif
00056
00057
00058
00059
00060
00061 #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
00062 # include <stlsoft/stlsoft.h>
00063 #endif
00064
00065 #ifdef STLSOFT_UNITTEST
00066 # if !defined(STLSOFT_COMPILER_IS_WATCOM)
00067 # if defined(STLSOFT_COMPILER_IS_MWERKS) && \
00068 ((__MWERKS__ & 0xff00) < 0x3000)
00069 # ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_SIMPLE_STRING
00070 # include <stlsoft/string/simple_string.hpp>
00071 # endif
00072 # else
00073 # ifndef STLSOFT_INCL_STLSOFT_STRING_HPP_STRING_VIEW
00074 # include <stlsoft/string/string_view.hpp>
00075 # endif
00076 # endif
00077 # include <vector>
00078 # endif
00079 #endif
00080
00081
00082
00083
00084
00085 #ifndef _STLSOFT_NO_NAMESPACE
00086 namespace stlsoft
00087 {
00088 #endif
00089
00090
00091
00092
00093
00115 template <ss_typename_param_k C>
00116 inline C const*
00117 find_next_token(
00118 C const*& p0
00119 , C const*& p1
00120 #if defined(STLSOFT_COMPILER_IS_DMC)
00121 , C const* end
00122 #else
00123 , C const* const end
00124 #endif
00125 , C delim
00126 )
00127 {
00128 STLSOFT_ASSERT(NULL != p0);
00129 STLSOFT_ASSERT(NULL != p1);
00130 STLSOFT_ASSERT(NULL != end);
00131 STLSOFT_ASSERT(p0 <= p1);
00132 STLSOFT_ASSERT(p1 <= end);
00133
00134 if(p1 != end)
00135 {
00136 if(p0 != p1)
00137 {
00138 p0 = ++p1;
00139 }
00140 else
00141 {
00142 p0 = p1;
00143 }
00144
00145 if(delim == *p1)
00146 {
00147 ++p0;
00148 ++p1;
00149 }
00150 else for(; p1 != end; ++p1)
00151 {
00152 if(delim == *p1)
00153 {
00154 break;
00155 }
00156 }
00157 }
00158 else
00159 {
00160 p0 = end;
00161 }
00162
00163 return p0;
00164 }
00165
00184 template <ss_typename_param_k C>
00185 inline bool
00186 find_next_token(
00187 C const*& p0
00188 , C const*& p1
00189 , C delim
00190 )
00191 {
00192 STLSOFT_ASSERT(NULL != p0);
00193 STLSOFT_ASSERT(NULL != p1);
00194 STLSOFT_ASSERT(p0 <= p1);
00195
00196 if('\0' == *p1)
00197 {
00198 p0 = p1;
00199
00200 return false;
00201 }
00202
00203 if(p0 != p1)
00204 {
00205 p0 = ++p1;
00206 }
00207 else
00208 {
00209 p0 = p1;
00210 }
00211
00212 if(delim == *p1)
00213 {
00214 ++p0;
00215 ++p1;
00216 }
00217 else for(;; ++p1)
00218 {
00219 if('\0' == *p1)
00220 {
00221 return p0 != p1;
00222 }
00223 else if(delim == *p1)
00224 {
00225 break;
00226 }
00227 }
00228
00229 return true;
00230 }
00231
00232
00233
00234
00235
00236 #ifdef STLSOFT_UNITTEST
00237 # include "./unittest/tokeniser_functions_unittest_.h"
00238 #endif
00239
00240
00241
00242 #ifndef _STLSOFT_NO_NAMESPACE
00243 }
00244 #endif
00245
00246
00247
00248 #endif
00249
00250