Changeset 4dab7e8 for libcfa/src


Ignore:
Timestamp:
Aug 5, 2024, 11:13:27 PM (3 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
1c957a11, c4d6c90
Parents:
0e6cf54c
Message:

formatting, add str conversion routines, add more combinations of ?+? routines

Location:
libcfa/src/collections
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/collections/string.cfa

    r0e6cf54c r4dab7e8  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 15 21:56:28 2024
    13 // Update Count     : 260
     12// Last Modified On : Mon Aug  5 23:12:05 2024
     13// Update Count     : 273
    1414//
    1515
     
    4545}
    4646
    47 void ?{}( string & s, const string & s2, size_t maxlen) {
     47void ?{}( string & s, const string & s2, size_t maxlen ) {
    4848    (s.inner) { malloc() };
    4949    ?{}( *s.inner, *s2.inner, COPY_VALUE, maxlen );
     
    6565}
    6666
    67 void ?{}( string & s, const char * c, size_t size) {
     67void ?{}( string & s, const char * c, size_t size ) {
    6868    (s.inner) { malloc() };
    6969    ?{}( *s.inner, c, size );
     
    9898    (s.inner) { malloc() };
    9999    ?{}( *s.inner, rhs );
     100}
     101
     102string str( ssize_t rhs ) {
     103        string s = rhs;
     104        return s;
     105}
     106
     107string str( size_t rhs ) {
     108        string s = rhs;
     109        return s;
     110}
     111
     112string str( double rhs ) {
     113        string s = rhs;
     114        return s;
     115}
     116
     117string str( long double rhs ) {
     118        string s = rhs;
     119        return s;
     120}
     121
     122string str( double _Complex rhs ) {
     123        string s = rhs;
     124        return s;
     125}
     126
     127string str( long double _Complex rhs ) {
     128        string s = rhs;
     129        return s;
    100130}
    101131
     
    115145
    116146void ?{}( string & s, string_WithSharedEdits src ) {
    117     ?{}( s, *src.s->inner, 0, src.s->inner->Handle.lnth);
     147    ?{}( s, *src.s->inner, 0, src.s->inner->Handle.lnth );
    118148}
    119149
     
    121151// Assignment
    122152
    123 string & ?=?(string & s, const string & c) {
     153string & ?=?( string & s, const string & c ) {
    124154    (*s.inner) = (*c.inner);
    125155    return s;
    126156}
    127157
    128 string & ?=?(string & s, string & c) {
     158string & ?=?( string & s, string & c ) {
    129159    (*s.inner) = (*c.inner);
    130160    return s;
     
    141171}
    142172
    143 string & assign(string & s, const string & c, size_t n) {
    144     assign(*s.inner, *c.inner, n);
    145     return s;
    146 }
    147 
    148 string & assign(string & s, const char * c, size_t n) {
    149     assign(*s.inner, c, n);
     173string & assign( string & s, const string & c, size_t n ) {
     174    assign( *s.inner, *c.inner, n );
     175    return s;
     176}
     177
     178string & assign( string & s, const char * c, size_t n ) {
     179    assign( *s.inner, c, n );
    150180    return s;
    151181}
     
    205235}
    206236
    207 ifstream & ?|?(ifstream & in, string & s) {
     237ifstream & ?|?( ifstream & in, string & s ) {
    208238    return in | (*s.inner); // read to internal string_res
    209239}
     
    236266// Comparison
    237267
    238 int  strcmp(const string & s1, const string & s2) { return strcmp(*s1.inner, *s2.inner); }
    239 bool ?==?(const string & s1, const string & s2) { return *s1.inner == *s2.inner; }
    240 bool ?!=?(const string & s1, const string & s2) { return *s1.inner != *s2.inner; }
    241 bool ?>? (const string & s1, const string & s2) { return *s1.inner >  *s2.inner; }
    242 bool ?>=?(const string & s1, const string & s2) { return *s1.inner >= *s2.inner; }
    243 bool ?<=?(const string & s1, const string & s2) { return *s1.inner <= *s2.inner; }
    244 bool ?<? (const string & s1, const string & s2) { return *s1.inner <  *s2.inner; }
    245 
    246 int  strcmp(const string & s1, const char * s2) { return strcmp(*s1.inner, s2 ); }
    247 bool ?==?(const string & s1, const char * s2) { return *s1.inner == s2; }
    248 bool ?!=?(const string & s1, const char * s2) { return *s1.inner != s2; }
    249 bool ?>? (const string & s1, const char * s2) { return *s1.inner >  s2; }
    250 bool ?>=?(const string & s1, const char * s2) { return *s1.inner >= s2; }
    251 bool ?<=?(const string & s1, const char * s2) { return *s1.inner <= s2; }
    252 bool ?<? (const string & s1, const char * s2) { return *s1.inner <  s2; }
    253 
    254 int  strcmp(const char * s1, const string & s2) { return strcmp( s1, *s2.inner); }
    255 bool ?==?(const char * s1, const string & s2) { return s1 == *s2.inner; }
    256 bool ?!=?(const char * s1, const string & s2) { return s1 != *s2.inner; }
    257 bool ?>? (const char * s1, const string & s2) { return s1 >  *s2.inner; }
    258 bool ?>=?(const char * s1, const string & s2) { return s1 >= *s2.inner; }
    259 bool ?<=?(const char * s1, const string & s2) { return s1 <= *s2.inner; }
    260 bool ?<? (const char * s1, const string & s2) { return s1 <  *s2.inner; }
     268int strcmp( const string & s1, const string & s2 ) { return strcmp( *s1.inner, *s2.inner ); }
     269bool ?==?( const string & s1, const string & s2 ) { return *s1.inner == *s2.inner; }
     270bool ?!=?( const string & s1, const string & s2 ) { return *s1.inner != *s2.inner; }
     271bool ?>? ( const string & s1, const string & s2 ) { return *s1.inner >  *s2.inner; }
     272bool ?>=?( const string & s1, const string & s2 ) { return *s1.inner >= *s2.inner; }
     273bool ?<=?( const string & s1, const string & s2 ) { return *s1.inner <= *s2.inner; }
     274bool ?<? ( const string & s1, const string & s2 ) { return *s1.inner <  *s2.inner; }
     275
     276int strcmp( const string & s1, const char * s2 ) { return strcmp( *s1.inner, s2 ); }
     277bool ?==?( const string & s1, const char * s2 ) { return *s1.inner == s2; }
     278bool ?!=?( const string & s1, const char * s2 ) { return *s1.inner != s2; }
     279bool ?>? ( const string & s1, const char * s2 ) { return *s1.inner >  s2; }
     280bool ?>=?( const string & s1, const char * s2 ) { return *s1.inner >= s2; }
     281bool ?<=?( const string & s1, const char * s2 ) { return *s1.inner <= s2; }
     282bool ?<? ( const string & s1, const char * s2 ) { return *s1.inner <  s2; }
     283
     284int strcmp( const char * s1, const string & s2 ) { return strcmp( s1, *s2.inner ); }
     285bool ?==?( const char * s1, const string & s2 ) { return s1 == *s2.inner; }
     286bool ?!=?( const char * s1, const string & s2 ) { return s1 != *s2.inner; }
     287bool ?>? ( const char * s1, const string & s2 ) { return s1 >  *s2.inner; }
     288bool ?>=?( const char * s1, const string & s2 ) { return s1 >= *s2.inner; }
     289bool ?<=?( const char * s1, const string & s2 ) { return s1 <= *s2.inner; }
     290bool ?<? ( const char * s1, const string & s2 ) { return s1 <  *s2.inner; }
    261291
    262292
     
    264294// Getter
    265295
    266 size_t size(const string & s) {
     296size_t size( const string & s ) {
    267297    return size( *s.inner );
    268298}
     
    271301// Concatenation
    272302
    273 void ?+=?(string & s, char c) {
     303void ?+=?( string & s, char c ) {
    274304    (*s.inner) += c;
    275305}
    276306
    277 void ?+=?(string & s, const string & s2) {
     307void ?+=?( string & s, const string & s2 ) {
    278308    (*s.inner) += (*s2.inner);
    279309}
    280310
    281 void append(string & s, const string & s2, size_t maxlen) {
     311void append( string & s, const string & s2, size_t maxlen ) {
    282312    append( (*s.inner), (*s2.inner), maxlen );
    283313}
    284314
    285 void ?+=?(string & s, const char * c) {
     315void ?+=?( string & s, const char * c ) {
    286316    (*s.inner) += c;
    287317}
    288318
    289 void append(string & s, const char * buffer, size_t bsize) {
     319void append( string & s, const char * buffer, size_t bsize ) {
    290320    append( (*s.inner), buffer, bsize );
    291321}
    292322
    293 string ?+?(const string & s, char c) {
     323string ?+?( const string & s, char c ) {
    294324    string ret = s;
    295325    ret += c;
     
    297327}
    298328
    299 string ?+?(const string & s, const string & s2) {
     329string ?+?( char c, const string & s ) {
     330    string ret = s;
     331    ret += c;
     332    return ret;
     333}
     334
     335string ?+?( const string & s, const string & s2 ) {
    300336    string ret = s;
    301337    ret += s2;
     
    303339}
    304340
    305 string ?+?(const char * s1, const char * s2) {
     341string ?+?( const char * s,  char c ) {
     342    string ret = s;
     343    ret += c;
     344    return ret;
     345}
     346
     347string ?+?( char c, const char * s ) {
     348    string ret = c;
     349    ret += s;
     350    return ret;
     351}
     352
     353string ?+?( const char * s1, const char * s2 ) {
    306354    string ret = s1;
    307355    ret += s2;
     
    309357}
    310358
    311 string ?+?(const string & s, const char * c) {
     359string ?+?( const char * s1, string & s2 ) {
     360    string ret = s1;
     361    ret += s2;
     362    return ret;
     363}
     364
     365string ?+?( const string & s, const char * c ) {
    312366    string ret = s;
    313367    ret += c;
     
    318372// Repetition
    319373
    320 void ?*=?(string & s, size_t factor) {
     374void ?*=?( string & s, size_t factor ) {
    321375    (*s.inner) *= factor;
    322376}
    323377
    324 string ?*?(const string & s, size_t factor) {
     378string ?*?( const string & s, size_t factor ) {
    325379    string ret = s;
    326380    ret *= factor;
     
    328382}
    329383
    330 string ?*?(char c, size_t factor) {
     384string ?*?( char c, size_t factor ) {
    331385    string ret = c;
    332386    ret *= factor;
     
    334388}
    335389
    336 string ?*?(const char * s, size_t factor) {
     390string ?*?( const char * s, size_t factor ) {
    337391    string ret = s;
    338392    ret *= factor;
     
    343397// Character access
    344398
    345 char ?[?](const string & s, size_t index) {
     399char ?[?]( const string & s, size_t index ) {
    346400    return (*s.inner)[index];
    347401}
    348402
    349 string ?[?](string & s, size_t index) {
     403string ?[?]( string & s, size_t index ) {
    350404    string ret = { *s.inner, index, 1 };
    351405    return ret`shareEdits;
     
    355409// Search
    356410
    357 bool contains(const string & s, char ch) {
     411bool contains( const string & s, char ch ) {
    358412    return contains( *s.inner, ch );
    359413}
    360414
    361 int find(const string & s, char search) {
     415int find( const string & s, char search ) {
    362416    return find( *s.inner, search );
    363417}
    364418
    365 int find(const string & s, const string & search) {
     419int find( const string & s, const string & search ) {
    366420    return find( *s.inner, *search.inner );
    367421}
    368422
    369 int find(const string & s, const char * search) {
    370     return find( *s.inner, search);
    371 }
    372 
    373 int find(const string & s, const char * search, size_t searchsize) {
    374     return find( *s.inner, search, searchsize);
    375 }
    376 
    377 int findFrom(const string & s, size_t fromPos, char search) {
     423int find( const string & s, const char * search ) {
     424    return find( *s.inner, search );
     425}
     426
     427int find( const string & s, const char * search, size_t searchsize ) {
     428    return find( *s.inner, search, searchsize );
     429}
     430
     431int findFrom( const string & s, size_t fromPos, char search ) {
    378432    return findFrom( *s.inner, fromPos, search );
    379433}
    380434
    381 int findFrom(const string & s, size_t fromPos, const string & search) {
     435int findFrom( const string & s, size_t fromPos, const string & search ) {
    382436    return findFrom( *s.inner, fromPos, *search.inner );
    383437}
    384438
    385 int findFrom(const string & s, size_t fromPos, const char * search) {
     439int findFrom( const string & s, size_t fromPos, const char * search ) {
    386440    return findFrom( *s.inner, fromPos, search );
    387441}
    388442
    389 int findFrom(const string & s, size_t fromPos, const char * search, size_t searchsize) {
     443int findFrom( const string & s, size_t fromPos, const char * search, size_t searchsize ) {
    390444    return findFrom( *s.inner, fromPos, search, searchsize );
    391445}
    392446
    393 bool includes(const string & s, const string & search) {
     447bool includes( const string & s, const string & search ) {
    394448    return includes( *s.inner, *search.inner );
    395449}
    396450
    397 bool includes(const string & s, const char * search) {
     451bool includes( const string & s, const char * search ) {
    398452    return includes( *s.inner, search );
    399453}
    400454
    401 bool includes(const string & s, const char * search, size_t searchsize) {
     455bool includes( const string & s, const char * search, size_t searchsize ) {
    402456    return includes( *s.inner, search, searchsize );
    403457}
    404458
    405 bool startsWith(const string & s, const string & prefix) {
     459bool startsWith( const string & s, const string & prefix ) {
    406460    return startsWith( *s.inner, *prefix.inner );
    407461}
    408462
    409 bool startsWith(const string & s, const char * prefix) {
     463bool startsWith( const string & s, const char * prefix ) {
    410464    return startsWith( *s.inner, prefix );
    411465}
    412466
    413 bool startsWith(const string & s, const char * prefix, size_t prefixsize) {
     467bool startsWith( const string & s, const char * prefix, size_t prefixsize ) {
    414468    return startsWith( *s.inner, prefix, prefixsize );
    415469}
    416470
    417 bool endsWith(const string & s, const string & suffix) {
     471bool endsWith( const string & s, const string & suffix ) {
    418472    return endsWith( *s.inner, *suffix.inner );
    419473}
    420474
    421 bool endsWith(const string & s, const char * suffix) {
     475bool endsWith( const string & s, const char * suffix ) {
    422476    return endsWith( *s.inner, suffix );
    423477}
    424478
    425 bool endsWith(const string & s, const char * suffix, size_t suffixsize) {
     479bool endsWith( const string & s, const char * suffix, size_t suffixsize ) {
    426480    return endsWith( *s.inner, suffix, suffixsize );
    427481}
     
    431485// charclass, include, exclude
    432486
    433 void ?{}( charclass & s, const string & chars) {
     487void ?{}( charclass & s, const string & chars ) {
    434488    (s.inner) { malloc() };
    435489    ?{}( *s.inner, *(const string_res *)chars.inner );
     
    453507
    454508
    455 int exclude(const string & s, const charclass & mask) {
     509int exclude( const string & s, const charclass & mask ) {
    456510    return exclude( *s.inner, *mask.inner );
    457511}
    458512/*
    459 StrSlice exclude(string & s, const charclass & mask) {
     513StrSlice exclude( string & s, const charclass & mask ) {
    460514}
    461515*/
    462516
    463 int include(const string & s, const charclass & mask) {
     517int include( const string & s, const charclass & mask ) {
    464518    return include( *s.inner, *mask.inner );
    465519}
    466520
    467521/*
    468 StrSlice include(string & s, const charclass & mask) {
     522StrSlice include( string & s, const charclass & mask ) {
    469523}
    470524*/
    471 
  • libcfa/src/collections/string.hfa

    r0e6cf54c r4dab7e8  
    1010// Created On       : Fri Sep 03 11:00:00 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  6 20:59:18 2024
    13 // Update Count     : 118
     12// Last Modified On : Mon Aug  5 23:06:14 2024
     13// Update Count     : 128
    1414//
    1515
     
    2828
    2929// Getters
    30 size_t size(const string & s);
    31 static inline size_t strlen(const string & s) { return size( s ); }
     30size_t size( const string & s );
     31static inline size_t strlen( const string & s ) { return size( s ); }
    3232
    3333// RAII, assignment
    34 void ?{}(string & s); // empty string
    35 void ?{}(string & s, const string & s2);
    36 void ?{}(string & s, const string & s2, size_t maxlen);
    37 void ?{}(string & s, string & s2);
    38 
    39 void ?{}(string & s, char);
    40 void ?{}(string & s, const char * c); // copy from string literal (NULL-terminated)
    41 void ?{}(string & s, const char * c, size_t size); // copy specific length from buffer
     34void ?{}( string & s ); // empty string
     35void ?{}( string & s, const string & s2 );
     36void ?{}( string & s, const string & s2, size_t maxlen );
     37void ?{}( string & s, string & s2 );
     38
     39void ?{}( string & s, char );
     40void ?{}( string & s, const char * c );                                 // copy from string literal (NULL-terminated)
     41void ?{}( string & s, const char * c, size_t size );    // copy specific length from buffer
    4242
    4343void ?{}( string & s, ssize_t rhs );
     
    4848void ?{}( string & s, long double _Complex rhs );
    4949
    50 string & ?=?(string & s, const string & c);
    51 string & ?=?(string & s, string & c);
    52 string & ?=?(string & s, const char * c); // copy from "literal"
    53 string & ?=?(string & s, char c);  // copy from 'l'
    54 string & assign(string & s, const string & c, size_t n);
    55 string & assign(string & s, const char * c, size_t n);
    56 
    57 static inline string & strcpy(string & s, const char * c) { s = c; return s; }
    58 static inline string & strncpy(string & s, const char * c, size_t n) { assign( s, c, n); return s; }
    59 static inline string & strcpy(string & s, const string & c) { s = c; return s; }
    60 static inline string & strncpy(string & s, const string & c, size_t n) { assign(s, c, n); return s; }
     50string str( ssize_t rhs );
     51string str( size_t rhs );
     52string str( double rhs );
     53string str( long double rhs );
     54string str( double _Complex rhs );
     55string str( long double _Complex rhs );
     56
     57string & ?=?( string & s, const string & c );
     58string & ?=?( string & s, string & c );
     59string & ?=?( string & s, const char * c );                             // copy from "literal"
     60string & ?=?( string & s, char c );                                             // copy from 'l'
     61string & assign( string & s, const string & c, size_t n );
     62string & assign( string & s, const char * c, size_t n );
     63
     64static inline string & strcpy( string & s, const char * c ) { s = c; return s; }
     65static inline string & strncpy( string & s, const char * c, size_t n ) { assign( s, c, n ); return s; }
     66static inline string & strcpy( string & s, const string & c ) { s = c; return s; }
     67static inline string & strncpy( string & s, const string & c, size_t n ) { assign( s, c, n ); return s; }
    6168
    6269string & ?=?( string & s, ssize_t rhs );
     
    6774string & ?=?( string & s, long double _Complex rhs );
    6875
    69 void ^?{}(string & s);
     76void ^?{}( string & s );
    7077
    7178// Alternate construction: request shared edits
     
    7784
    7885// IO Operator
    79 ofstream & ?|?(ofstream & out, const string & s);
    80 void ?|?(ofstream & out, const string & s);
    81 ifstream & ?|?(ifstream & in, string & s);
     86ofstream & ?|?( ofstream & out, const string & s );
     87void ?|?( ofstream & out, const string & s );
     88ifstream & ?|?( ifstream & in, string & s );
    8289
    8390static inline {
     
    145152
    146153// Concatenation
    147 void ?+=?(string & s, char c); // append a character
    148 void ?+=?(string & s, const string & s2); // append-concatenate to first string
    149 void append(string & s, const string & s2, size_t maxlen);  // append-concatenate to first string, up to maxlen
    150 void ?+=?(string & s, const char * s2); // append-concatenate NULL-terminated string to first string
    151 void append(string & s, const char * buffer, size_t bsize);  // append-concatenate given range to first string
    152 
    153 string ?+?(const string & s, char c); // add a character to a copy of the string
    154 string ?+?(const string & s, const string & s2); // copy and concatenate both strings
    155 string ?+?(const char * s1, const char * s2); // copy and concatenate both strings
    156 string ?+?(const string & s, const char * c); // copy and concatenate with NULL-terminated string
    157 
    158 static inline string & strcat(string & s, const string & s2) { s += s2; return s; }
    159 static inline string & strcat(string & s, const char * c) { s += c; return s; }
    160 static inline string & strncat(string & s, const string & s2, size_t maxlen) { append(s, s2, maxlen); return s; }
    161 static inline string & strncat(string & s, const char * buffer, size_t bsize) { append(s, buffer, bsize); return s; }
     154void ?+=?( string & s, char c );                                                // append a character
     155void ?+=?( string & s, const string & s2 );                             // append-concatenate to first string
     156void append( string & s, const string & s2, size_t maxlen );  // append-concatenate to first string, up to maxlen
     157void ?+=?( string & s, const char * s2 );                               // append-concatenate NULL-terminated string to first string
     158void append( string & s, const char * buffer, size_t bsize ); // append-concatenate given range to first string
     159
     160string ?+?( const string & s, char c );                                 // add a character to a copy of the string
     161string ?+?( char c, const string & s );                                 // add a character to a copy of the string
     162string ?+?( const string & s, const string & s2 );              // copy and concatenate both strings
     163string ?+?( const char * s, char c );                                   // copy and concatenate both strings
     164string ?+?( char c, const char * s );                                   // copy and concatenate both strings
     165string ?+?( const char * s1, const char * s2 );                 // copy and concatenate both strings
     166string ?+?( const char * s1, string & s2 );                             // copy and concatenate both strings
     167string ?+?( const string & s, const char * c );                 // copy and concatenate with NULL-terminated string
     168
     169static inline string & strcat( string & s, const string & s2 ) { s += s2; return s; }
     170static inline string & strcat( string & s, const char * c ) { s += c; return s; }
     171static inline string & strncat( string & s, const string & s2, size_t maxlen ) { append( s, s2, maxlen ); return s; }
     172static inline string & strncat( string & s, const char * buffer, size_t bsize ) { append( s, buffer, bsize ); return s; }
    162173
    163174// Repetition
    164 string ?*?(const string & s, size_t factor);
    165 void ?*=?(string & s, size_t factor);
    166 string ?*?(char c, size_t factor);
    167 string ?*?(const char *s, size_t factor);
     175string ?*?( const string & s, size_t factor );
     176void ?*=?( string & s, size_t factor );
     177string ?*?( char c, size_t factor );
     178string ?*?( const char *s, size_t factor );
    168179
    169180// Character access
    170 char ?[?](const string & s, size_t index);
    171 string ?[?](string & s, size_t index);  // mutable length-1 slice of original
    172 //char codePointAt(const string & s, size_t index);  // to revisit under Unicode
     181char ?[?]( const string & s, size_t index );
     182string ?[?]( string & s, size_t index );                                // mutable length-1 slice of original
     183//char codePointAt(const string & s, size_t index );            // to revisit under Unicode
    173184
    174185// Comparisons
    175 int  strcmp (const string &, const string &);
    176 bool ?==?(const string &, const string &);
    177 bool ?!=?(const string &, const string &);
    178 bool ?>? (const string &, const string &);
    179 bool ?>=?(const string &, const string &);
    180 bool ?<=?(const string &, const string &);
    181 bool ?<? (const string &, const string &);
    182 
    183 int  strcmp (const string &, const char *);
    184 bool ?==?(const string &, const char *);
    185 bool ?!=?(const string &, const char *);
    186 bool ?>? (const string &, const char *);
    187 bool ?>=?(const string &, const char *);
    188 bool ?<=?(const string &, const char *);
    189 bool ?<? (const string &, const char *);
    190 
    191 int  strcmp (const char *, const string &);
    192 bool ?==?(const char *, const string &);
    193 bool ?!=?(const char *, const string &);
    194 bool ?>? (const char *, const string &);
    195 bool ?>=?(const char *, const string &);
    196 bool ?<=?(const char *, const string &);
    197 bool ?<? (const char *, const string &);
     186int strcmp ( const string &, const string &);
     187bool ?==?( const string &, const string &);
     188bool ?!=?( const string &, const string &);
     189bool ?>? ( const string &, const string &);
     190bool ?>=?( const string &, const string &);
     191bool ?<=?( const string &, const string &);
     192bool ?<? ( const string &, const string &);
     193
     194int strcmp( const string &, const char *);
     195bool ?==?( const string &, const char *);
     196bool ?!=?( const string &, const char *);
     197bool ?>? ( const string &, const char *);
     198bool ?>=?( const string &, const char *);
     199bool ?<=?( const string &, const char *);
     200bool ?<? ( const string &, const char *);
     201
     202int strcmp( const char *, const string &);
     203bool ?==?( const char *, const string &);
     204bool ?!=?( const char *, const string &);
     205bool ?>? ( const char *, const string &);
     206bool ?>=?( const char *, const string &);
     207bool ?<=?( const char *, const string &);
     208bool ?<? ( const char *, const string &);
    198209
    199210
    200211// Slicing
    201 string ?()( string & s, size_t start, size_t len );  // TODO const?
    202 string ?()( string & s, size_t start);
     212string ?()( string & s, size_t start, size_t len );             // TODO const?
     213string ?()( string & s, size_t start );
    203214
    204215// String search
    205 bool contains(const string & s, char ch); // single character
    206 
    207 int find(const string & s, char search);
    208 int find(const string & s, const string & search);
    209 int find(const string & s, const char * search);
    210 int find(const string & s, const char * search, size_t searchsize);
    211 
    212 int findFrom(const string & s, size_t fromPos, char search);
    213 int findFrom(const string & s, size_t fromPos, const string & search);
    214 int findFrom(const string & s, size_t fromPos, const char * search);
    215 int findFrom(const string & s, size_t fromPos, const char * search, size_t searchsize);
    216 
    217 bool includes(const string & s, const string & search);
    218 bool includes(const string & s, const char * search);
    219 bool includes(const string & s, const char * search, size_t searchsize);
    220 
    221 bool startsWith(const string & s, const string & prefix);
    222 bool startsWith(const string & s, const char * prefix);
    223 bool startsWith(const string & s, const char * prefix, size_t prefixsize);
    224 
    225 bool endsWith(const string & s, const string & suffix);
    226 bool endsWith(const string & s, const char * suffix);
    227 bool endsWith(const string & s, const char * suffix, size_t suffixsize);
     216bool contains( const string & s, char ch );                             // single character
     217
     218int find( const string & s, char search );
     219int find( const string & s, const string & search );
     220int find( const string & s, const char * search );
     221int find( const string & s, const char * search, size_t searchsize );
     222
     223int findFrom( const string & s, size_t fromPos, char search );
     224int findFrom( const string & s, size_t fromPos, const string & search );
     225int findFrom( const string & s, size_t fromPos, const char * search );
     226int findFrom( const string & s, size_t fromPos, const char * search, size_t searchsize );
     227
     228bool includes( const string & s, const string & search );
     229bool includes( const string & s, const char * search );
     230bool includes( const string & s, const char * search, size_t searchsize );
     231
     232bool startsWith( const string & s, const string & prefix );
     233bool startsWith( const string & s, const char * prefix );
     234bool startsWith( const string & s, const char * prefix, size_t prefixsize );
     235
     236bool endsWith( const string & s, const string & suffix );
     237bool endsWith( const string & s, const char * suffix );
     238bool endsWith( const string & s, const char * suffix, size_t suffixsize );
    228239
    229240// Modifiers
    230 void padStart(string & s, size_t n);
    231 void padStart(string & s, size_t n, char padding);
    232 void padEnd(string & s, size_t n);
    233 void padEnd(string & s, size_t n, char padding);
     241void padStart( string & s, size_t n );
     242void padStart( string & s, size_t n, char padding );
     243void padEnd( string & s, size_t n );
     244void padEnd( string & s, size_t n, char padding );
    234245
    235246
     
    239250
    240251void ?{}( charclass & ) = void;
    241 void ?{}( charclass &, charclass) = void;
    242 charclass ?=?( charclass &, charclass) = void;
    243 
    244 void ?{}( charclass &, const string & chars);
     252void ?{}( charclass &, charclass ) = void;
     253charclass ?=?( charclass &, charclass ) = void;
     254
     255void ?{}( charclass &, const string & chars );
    245256void ?{}( charclass &, const char * chars );
    246257void ?{}( charclass &, const char * chars, size_t charssize );
    247258void ^?{}( charclass & );
    248259
    249 int include(const string & s, const charclass & mask);
    250 
    251 int exclude(const string & s, const charclass & mask);
     260int include( const string & s, const charclass & mask );
     261
     262int exclude( const string & s, const charclass & mask );
    252263
    253264/*
    254265What to do with?
    255 StrRet include(string & s, const charclass & mask);
    256 StrRet exclude(string & s, const charclass & mask);
     266StrRet include( string & s, const charclass & mask );
     267StrRet exclude( string & s, const charclass & mask );
    257268*/
Note: See TracChangeset for help on using the changeset viewer.