source: libcfa/src/collections/string.hfa@ bb1eabc

Last change on this file since bb1eabc was bb1eabc, checked in by Peter A. Buhr <pabuhr@…>, 11 days ago

harmonize output quote manipulator with input quote manipulator, adding left/right quote parameters

  • Property mode set to 100644
File size: 20.3 KB
RevLine 
[f450f2f]1//
2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// string -- variable-length, mutable run of text, with value semantics
8//
9// Author : Michael L. Brooks
10// Created On : Fri Sep 03 11:00:00 2021
[6264087]11// Last Modified By : Peter A. Buhr
[bb1eabc]12// Last Modified On : Sun May 3 23:24:08 2026
13// Update Count : 324
[f450f2f]14//
15
16#pragma once
17
[3f631d6]18#include <iostream.hfa>
[9018dcf]19#include <string_res.hfa>
[f450f2f]20
[d03a386]21static struct __cfa_string_preference_boost_t {} __cfa_string_preference_boost;
22#define PBOOST forall ( | { __cfa_string_preference_boost_t __cfa_string_preference_boost; } )
23
[f450f2f]24struct string {
[4223317]25 string_res * inner;
[f450f2f]26};
27
28// RAII, assignment
[234c432]29void ^?{}( string & s );
30
[4223317]31void ?{}( string & s ); // empty string
[570e7ad]32void ?{}( string & s, string s2, size_t maxlen );
[d03a386]33PBOOST void ?{}( string & s, string s2 );
[4dab7e8]34void ?{}( string & s, char );
35void ?{}( string & s, const char * c ); // copy from string literal (NULL-terminated)
36void ?{}( string & s, const char * c, size_t size ); // copy specific length from buffer
[479fbe3]37
[570e7ad]38void ?{}( string & s, signed long int rhs );
[f2898df]39void ?{}( string & s, size_t rhs );
40void ?{}( string & s, double rhs );
41void ?{}( string & s, long double rhs );
42void ?{}( string & s, double _Complex rhs );
43void ?{}( string & s, long double _Complex rhs );
[570e7ad]44static inline void ?{}( string & s, int rhs ) { (s){(signed long int) rhs}; }
[f2898df]45
[d03a386]46PBOOST string & ?=?( string & s, string c );
[4dab7e8]47string & ?=?( string & s, const char * c ); // copy from "literal"
48string & ?=?( string & s, char c ); // copy from 'l'
49string & assign( string & s, const string & c, size_t n );
50string & assign( string & s, const char * c, size_t n );
[570e7ad]51string & ?=?( string & s, signed long int rhs );
[f2898df]52string & ?=?( string & s, size_t rhs );
53string & ?=?( string & s, double rhs );
54string & ?=?( string & s, long double rhs );
55string & ?=?( string & s, double _Complex rhs );
56string & ?=?( string & s, long double _Complex rhs );
[570e7ad]57static inline string & ?=?( string & s, int rhs ) { return s = ((signed long int) rhs); } // to match cost of (char * int): int
[f2898df]58
[234c432]59static inline string & strcpy( string & s, const char * c ) { s = c; return s; }
60static inline string & strncpy( string & s, const char * c, size_t n ) { assign( s, c, n ); return s; }
61static inline string & strcpy( string & s, const string & c ) { s = c; return s; }
62static inline string & strncpy( string & s, const string & c, size_t n ) { assign( s, c, n ); return s; }
[829a955]63char * strncpy( char * dst, string & src, size_t n );
64char * ?=?( char *& dst, string & src );
65void ?{}( char *& dst, string & src );
[f450f2f]66
67// Alternate construction: request shared edits
[8c2723f]68struct string_Share {
[4223317]69 string * s;
[f450f2f]70};
[8c2723f]71string_Share ?`share( string & s );
72void ?{}( string & s, string_Share src );
[f450f2f]73
[234c432]74// Getters
75static inline size_t len( const string & s ) { return len( *s.inner ); }
76static inline size_t len( const char * cs ) { return strlen( cs ); };
77static inline size_t strlen( const string & s ) { return len( s ); }
[5ad6f0d]78size_t strnlen( const string & s, size_t maxlen );
[234c432]79
[f450f2f]80// IO Operator
[3f631d6]81forall( ostype & | basic_ostream( ostype ) ) {
82 ostype & ?|?( ostype & out, string s );
83 void ?|?( ostype & out, string s );
84}
85forall( istype & | basic_istream( istype ) )
86istype & ?|?( istype & in, string & s );
[7e1dbd7]87
[34c6e1e6]88static inline {
[b19b362]89 _Ostream_Manip(string) bin( string s ) { return (_Ostream_Manip(string))@{ .val = s, .wd = 1, .pc = 0, .base = 'b', { .all = 0 } }; }
90 _Ostream_Manip(string) oct( string s ) { return (_Ostream_Manip(string))@{ .val = s, .wd = 1, .pc = 0, .base = 'o', { .all = 0 } }; }
91 _Ostream_Manip(string) hex( string s ) { return (_Ostream_Manip(string))@{ .val = s, .wd = 1, .pc = 0, .base = 'x', { .all = 0 } }; }
[bb1eabc]92 _Ostream_Manip(string) quote( string s, const char qleft = '"', const char qright = '\0' ) {
93 return (_Ostream_Manip(string))@{ .val = s, .wd = 1, .pc = 0, .base = 's', { .flags.quote = true }, .qleft = qleft, .qright = qright }; }
[b19b362]94 _Ostream_Manip(string) wd( unsigned int wd, string s ) { return (_Ostream_Manip(string))@{ .val = s, .wd = wd, .pc = 0, .base = 's', { .all = 0 } }; }
95 _Ostream_Manip(string) wd( unsigned int wd, unsigned int pc, string s ) { return (_Ostream_Manip(string))@{ .val = s, .wd = wd, .pc = pc, .base = 's', { .flags.pc = true } }; }
96 _Ostream_Manip(string) & wd( unsigned int wd, _Ostream_Manip(string) & fmt ) { fmt.wd = wd; return fmt; }
97 _Ostream_Manip(string) & wd( unsigned int wd, unsigned int pc, _Ostream_Manip(string) & fmt ) { fmt.wd = wd; fmt.pc = pc; fmt.flags.pc = true; return fmt; }
[34c6e1e6]98 _Ostream_Manip(string) & left( _Ostream_Manip(string) & fmt ) { fmt.flags.left = true; return fmt; }
99 _Ostream_Manip(string) & nobase( _Ostream_Manip(string) & fmt ) { fmt.flags.nobsdp = true; return fmt; }
[b19b362]100 _Ostream_Manip(string) & upcase( _Ostream_Manip(string) & fmt ) { if ( fmt.base == 'x' || fmt.base == 'b' ) fmt.base -= 32; /* upper case */ return fmt; }
[bb1eabc]101 _Ostream_Manip(string) & quote( _Ostream_Manip(string) & fmt, const char qleft = '"', const char qright = '\0' ) {
102 fmt.flags.quote = true; fmt.qleft = qleft, fmt.qright = qright; return fmt; }
[34c6e1e6]103} // distribution
[dab6e39]104
[3f631d6]105forall( ostype & | basic_ostream( ostype ) ) {
106 ostype & ?|?( ostype & os, _Ostream_Manip(string) f );
107 void ?|?( ostype & os, _Ostream_Manip(string) );
108}
[34c6e1e6]109
[211def2]110struct _Istream_Swidth {
111 string & s;
112 inline _Istream_str_base;
113}; // _Istream_Swidth
114
[30548de]115struct _Istream_Squote {
[211def2]116 _Istream_Swidth sstr;
[30548de]117}; // _Istream_Squote
[211def2]118
[34c6e1e6]119struct _Istream_Sstr {
[7e1dbd7]120 string & s;
[38de914]121 inline _Istream_str_base;
[211def2]122// _Istream_Swidth sstr;
[34c6e1e6]123}; // _Istream_Sstr
[7e1dbd7]124
125static inline {
126 // read width does not include null terminator
[1a7203d]127 _Istream_Swidth wdi( unsigned int rwd, string & s ) { return (_Istream_Swidth)@{ .s = s, { {.scanset = 0p}, .wd = rwd, {.flags.rwd = true} } }; }
[34c6e1e6]128 _Istream_Sstr getline( string & s, const char delimiter = '\n' ) {
[1a7203d]129 return (_Istream_Sstr)@{ .s = s, { {.delimiters = { delimiter, '\0' } }, .wd = -1, {.flags.delimiter = true} } };
[211def2]130 }
131 _Istream_Sstr & getline( _Istream_Swidth & f, const char delimiter = '\n' ) {
132 f.delimiters[0] = delimiter; f.delimiters[1] = '\0'; f.flags.delimiter = true; return (_Istream_Sstr &)f;
133 }
[30548de]134 _Istream_Squote quote( string & s, const char Ldelimiter = '\"', const char Rdelimiter = '\0' ) {
135 return (_Istream_Squote)@{ { .s = s, { {.delimiters = { Ldelimiter, Rdelimiter, '\0' }}, .wd = -1, {.flags.rwd = true} } } };
[7e1dbd7]136 }
[30548de]137 _Istream_Squote & quote( _Istream_Swidth & f, const char Ldelimiter = '"', const char Rdelimiter = '\0' ) {
[211def2]138 f.delimiters[0] = Ldelimiter; f.delimiters[1] = Rdelimiter; f.delimiters[2] = '\0';
[30548de]139 return (_Istream_Squote &)f;
[7e1dbd7]140 }
[1a7203d]141 _Istream_Sstr incl( const char scanset[], string & s ) { return (_Istream_Sstr)@{ .s = s, { {.scanset = scanset}, .wd = -1, {.flags.inex = false} } }; }
[211def2]142 _Istream_Sstr & incl( const char scanset[], _Istream_Swidth & f ) { f.scanset = scanset; f.flags.inex = false; return (_Istream_Sstr &)f; }
[1a7203d]143 _Istream_Sstr excl( const char scanset[], string & s ) { return (_Istream_Sstr)@{ .s = s, { {.scanset = scanset}, .wd = -1, {.flags.inex = true} } }; }
[211def2]144 _Istream_Sstr & excl( const char scanset[], _Istream_Swidth & f ) { f.scanset = scanset; f.flags.inex = true; return (_Istream_Sstr &)f; }
[1a7203d]145 _Istream_Sstr ignore( string & s ) { return (_Istream_Sstr)@{ .s = s, { {.scanset = 0p}, .wd = -1, {.flags.ignore = true} } }; }
[211def2]146 _Istream_Sstr & ignore( _Istream_Swidth & f ) { f.flags.ignore = true; return (_Istream_Sstr &)f; }
[30548de]147 _Istream_Squote & ignore( _Istream_Squote & f ) { f.sstr.flags.ignore = true; return (_Istream_Squote &)f; }
[211def2]148 _Istream_Sstr & ignore( _Istream_Sstr & f ) { f.flags.ignore = true; return (_Istream_Sstr &)f; }
[7e1dbd7]149} // distribution
[dab6e39]150
[3f631d6]151forall( istype & | basic_istream( istype ) ) {
[30548de]152 istype & ?|?( istype & is, _Istream_Squote f );
[3f631d6]153 istype & ?|?( istype & is, _Istream_Sstr f );
154 static inline istype & ?|?( istype & is, _Istream_Swidth f ) { return is | *(_Istream_Sstr *)&f; }
155}
[f450f2f]156
157// Concatenation
[6b765d5]158void ?+=?( string & s, char c );
[c4f8c4bf]159PBOOST void ?+=?( string & s, string );
[6b765d5]160void append( string & s, const string & s2, size_t maxlen );
161void ?+=?( string & s, const char * s2 );
162void append( string & s, const char * buffer, size_t bsize );
163
[570e7ad]164string ?+?( string s, char c );
165string ?+?( char c, string s );
[d03a386]166PBOOST string ?+?( string s, string s2 );
[6b765d5]167string ?+?( const char * s, char c ); // not backwards compatible
168string ?+?( char c, const char * s );
169string ?+?( const char * c, const char * s );
[570e7ad]170string ?+?( const char * c, string s );
171string ?+?( string s, const char * c );
[6b765d5]172string ?+?( char, char ); // not being called 8-(
[4dab7e8]173
174static inline string & strcat( string & s, const string & s2 ) { s += s2; return s; }
175static inline string & strcat( string & s, const char * c ) { s += c; return s; }
176static inline string & strncat( string & s, const string & s2, size_t maxlen ) { append( s, s2, maxlen ); return s; }
177static inline string & strncat( string & s, const char * buffer, size_t bsize ) { append( s, buffer, bsize ); return s; }
[e891349]178
[f450f2f]179// Repetition
[570e7ad]180
181// Type `signed long long int` chosen for `factor` argument to achieve cost detente.
182// This way, the call `'a' * 3` gets the same safe conversion cost calling here as for
183// the built-in definition `int * int`.
184typedef signed long long int strmul_factor_t;
185
186void ?*=?( string & s, strmul_factor_t factor );
187string ?*?( char c, strmul_factor_t factor ); // not backwards compatible
[d03a386]188PBOOST string ?*?( string s, strmul_factor_t factor );
[570e7ad]189string ?*?( const char * s, strmul_factor_t factor );
[421b242]190static inline string ?*?( strmul_factor_t factor, char c ) { return c * factor; }
[d03a386]191PBOOST static inline string ?*?( strmul_factor_t factor, string s ) { return s * factor; }
[570e7ad]192static inline string ?*?( strmul_factor_t factor, const char * s ) { return s * factor; }
[f450f2f]193
194// Character access
[4dab7e8]195char ?[?]( const string & s, size_t index );
196string ?[?]( string & s, size_t index ); // mutable length-1 slice of original
197//char codePointAt(const string & s, size_t index ); // to revisit under Unicode
[f450f2f]198
199// Comparisons
[5ad6f0d]200static inline int strcmp( const string & s1, const string & s2 ) { return strcmp( *s1.inner, *s2.inner ); }
201int strncmp( const string & s1, const string & s2, size_t maxlen );
202static inline bool ?==?( const string & s1, const string & s2 ) { return *s1.inner == *s2.inner; }
203static inline bool ?!=?( const string & s1, const string & s2 ) { return *s1.inner != *s2.inner; }
204static inline bool ?>? ( const string & s1, const string & s2 ) { return *s1.inner > *s2.inner; }
205static inline bool ?>=?( const string & s1, const string & s2 ) { return *s1.inner >= *s2.inner; }
206static inline bool ?<=?( const string & s1, const string & s2 ) { return *s1.inner <= *s2.inner; }
207static inline bool ?<? ( const string & s1, const string & s2 ) { return *s1.inner < *s2.inner; }
208
209static inline int strcmp( const string & s1, const char * s2 ) { return strcmp( *s1.inner, s2 ); }
210int strncmp( const string & s1, const char * s2, size_t maxlen );
211static inline bool ?==?( const string & s1, const char * s2 ) { return *s1.inner == s2; }
212static inline bool ?!=?( const string & s1, const char * s2 ) { return *s1.inner != s2; }
213static inline bool ?>? ( const string & s1, const char * s2 ) { return *s1.inner > s2; }
214static inline bool ?>=?( const string & s1, const char * s2 ) { return *s1.inner >= s2; }
215static inline bool ?<=?( const string & s1, const char * s2 ) { return *s1.inner <= s2; }
216static inline bool ?<? ( const string & s1, const char * s2 ) { return *s1.inner < s2; }
217
218static inline int strcmp( const char * s1, const string & s2 ) { return strcmp( s1, *s2.inner ); }
219int strncmp( const char * s1, const string & s2, size_t maxlen );
220static inline bool ?==?( const char * s1, const string & s2 ) { return s1 == *s2.inner; }
221static inline bool ?!=?( const char * s1, const string & s2 ) { return s1 != *s2.inner; }
222static inline bool ?>? ( const char * s1, const string & s2 ) { return s1 > *s2.inner; }
223static inline bool ?>=?( const char * s1, const string & s2 ) { return s1 >= *s2.inner; }
224static inline bool ?<=?( const char * s1, const string & s2 ) { return s1 <= *s2.inner; }
225static inline bool ?<? ( const char * s1, const string & s2 ) { return s1 < *s2.inner; }
[416b443]226
[f450f2f]227// String search
[4dab7e8]228bool contains( const string & s, char ch ); // single character
[f450f2f]229
[9018dcf]230//int find( const string & s, size_t start, size_t len, const string & key, size_t kstart, size_t klen );
231size_t find$( const string_res & s, size_t start, size_t len, const string & key_res, size_t kstart, size_t klen );
[f450f2f]232
[9018dcf]233size_t find( const string & s, char key );
234size_t find( const string & s, const char * key );
235size_t find( const string & s, const string & key );
236size_t find( const string & s, const char * key, size_t keysize );
237
238size_t find( const string & s, size_t start, char key );
239size_t find( const string & s, size_t start, const string & key );
240size_t find( const string & s, size_t start, const char * key );
241size_t find( const string & s, size_t start, const char * key, size_t keysize );
[08ed947]242
[ed5023d1]243bool includes( const string & s, const string & mask );
244bool includes( const string & s, const char * mask );
245bool includes( const string & s, const char * mask, size_t masksize );
[f450f2f]246
[4dab7e8]247bool startsWith( const string & s, const string & prefix );
248bool startsWith( const string & s, const char * prefix );
249bool startsWith( const string & s, const char * prefix, size_t prefixsize );
[f450f2f]250
[4dab7e8]251bool endsWith( const string & s, const string & suffix );
252bool endsWith( const string & s, const char * suffix );
253bool endsWith( const string & s, const char * suffix, size_t suffixsize );
[f450f2f]254
[ed5023d1]255// Slicing
[9018dcf]256string ?()( string & s, ssize_t start, ssize_t len );
257static inline string ?()( const string & s, ssize_t start, ssize_t len ) { string & w = (string &)s; return w( start, len ); } // FIX ME
[ed5023d1]258string ?()( string & s, ssize_t start );
[9018dcf]259static inline string ?()( const string & s, ssize_t start ) { string & w = (string &)s; return w( start ); } // FIX ME
[ed5023d1]260static inline string ?()( string & s, char m ) { return s( find( s, m ), 1 )`share; }
[9018dcf]261static inline string ?()( const string & s, char m ) { string & w = (string &)s; return w( find( s, m ), 1 )`share; } // FIX ME
[ed5023d1]262static inline string ?()( string & s, const char * m ) { return s( find( s, m ), len( m ) )`share; }
[9018dcf]263static inline string ?()( const string & s, const char * m ) { string & w = (string &)s; return w( find( s, m ), len( m ) )`share; } // FIX ME
[ed5023d1]264static inline string ?()( string & s, const string & m ) { return s( find( s, m ), len( m ) )`share; }
[9018dcf]265static inline string ?()( const string & s, const string & m ) { string & w = (string &)s; return w( find( s, m ), len( m ) )`share; } // FIX ME
[f450f2f]266
267struct charclass {
[4223317]268 charclass_res * inner;
[f450f2f]269};
270
271void ?{}( charclass & ) = void;
[4dab7e8]272void ?{}( charclass &, charclass ) = void;
273charclass ?=?( charclass &, charclass ) = void;
[f450f2f]274
[4dab7e8]275void ?{}( charclass &, const string & chars );
[f450f2f]276void ?{}( charclass &, const char * chars );
277void ?{}( charclass &, const char * chars, size_t charssize );
278void ^?{}( charclass & );
279
[9018dcf]280size_t include( const string & s, const charclass & mask );
[1324fde]281static inline size_t include( const string & s, const char * mask ) { return include( s, (charclass){ mask } ); }
282static inline size_t include( const string & s, const string & mask ) { return include( s, (charclass){ mask } ); }
283static inline size_t include( const char * cs, const charclass & mask ) { return include( (string){ cs }, mask ); }
284static inline size_t include( const char * cs, const char * mask ) { return include( (string){ cs }, (charclass){ mask } ); }
285static inline size_t include( const char * cs, const string & mask ) { return include( (string){ cs }, (charclass){ mask } ); }
286
[5ad6f0d]287static inline string include( const string & s, const charclass & mask ) { return s( 0, include( s, mask ) ); }
[1324fde]288static inline string include( const string & s, const char * mask ) { return s( 0, include( s, (charclass){ mask } ) ); }
289static inline string include( const string & s, const string & mask ) { return s( 0, include( s, (charclass){ mask } ) ); }
[5ad6f0d]290static inline string include( const char * cs, const charclass & mask ) { const string s = cs; return s( 0, include( s, mask ) ); }
[1324fde]291static inline string include( const char * cs, const char * mask ) { const string s = cs; return s( 0, include( s, (charclass){ mask } ) ); }
292static inline string include( const char * cs, const string & mask ) { const string s = cs; return s( 0, include( s, (charclass){ mask } ) ); }
[9018dcf]293
294size_t exclude( const string & s, const charclass & mask );
[1324fde]295static inline size_t exclude( const string & s, const char * mask ) { return exclude( s, (charclass){ mask } ); }
296static inline size_t exclude( const string & s, const string & mask ) { return exclude( s, (charclass){ mask } ); }
297static inline size_t exclude( const char * cs, const charclass & mask ) { return exclude( (string){ cs }, mask ); }
298static inline size_t exclude( const char * cs, const string & mask ) { return exclude( (string){ cs }, (charclass){ mask } ); }
299static inline size_t exclude( const char * cs, const char * mask ) { return exclude( (string){ cs }, (charclass){ mask } ); }
300
[5ad6f0d]301static inline string exclude( const string & s, const charclass & mask ) { return s( 0, exclude( s, mask ) ); }
[1324fde]302static inline string exclude( const string & s, const char * mask ) { return s( 0, exclude( s, (charclass){ mask } ) ); }
303static inline string exclude( const string & s, const string & mask ) { return s( 0, exclude( s, (charclass){ mask } ) ); }
[5ad6f0d]304static inline string exclude( const char * cs, const charclass & mask ) { const string s = cs; return s( 0, exclude( s, mask ) ); }
[1324fde]305static inline string exclude( const char * cs, const string & mask ) { const string s = cs; return s( 0, exclude( s, (charclass){ mask } ) ); }
306static inline string exclude( const char * cs, const char * mask ) { const string s = cs; return s( 0, exclude( s, (charclass){ mask } ) ); }
307
308size_t include( const string & s, int (* f)( int ) ); // for C character-class functions, e.g., isdigit
309static inline size_t include( const char * cs, int (* f)( int ) ) { return include( (string){ cs }, f ); }
310static inline string include( const string & s, int (* f)( int ) ) { return s( 0, include( s, f ) ); }
311static inline string include( const char * cs, int (* f)( int ) ) { const string s = cs; return s( 0, include( s, f ) ); }
[5ad6f0d]312
[1324fde]313static inline size_t include( const string & s, bool (* f)( char ) ) { return include( s, (int (*)( int ))f ); }
314static inline size_t include( const char * cs, bool (* f)( char ) ) { return include( (string){ cs }, f ); }
315static inline string include( const string & s, bool (* f)( char ) ) { return s( 0, include( s, f ) ); }
316static inline string include( const char * cs, bool (* f)( char ) ) { const string s = cs; return s( 0, include( s, f ) ); }
[5ad6f0d]317
[1324fde]318size_t exclude( const string & s, int (* f)( int ) ); // for C character-class functions, e.g., isdigit
319static inline size_t exclude( const char * cs, int (* f)( int ) ) { return exclude( (string){ cs }, f ); }
320static inline string exclude( const string & s, int (* f)( int ) ) { return s( 0, exclude( s, f ) ); }
321static inline string exclude( const char * cs, int (* f)( int ) ) { const string s = cs; return s( 0, exclude( s, f ) ); }
322
323static inline size_t exclude( const string & s, bool (* f)( char ) ) { return exclude( s, (int (*)( int ))f ); }
324static inline size_t exclude( const char * cs, bool (* f)( char ) ) { return exclude( (string){ cs }, f ); }
325static inline string exclude( const string & s, bool (* f)( char ) ) { return s( 0, exclude( s, f ) ); }
326static inline string exclude( const char * cs, bool (* f)( char ) ) { const string s = cs; return s( 0, exclude( s, f ) ); }
[5ad6f0d]327
328string replace( const string & s, const string & from, const string & to );
[1324fde]329static inline string replace( const char * s, const char * from, const char * to ) { return replace( (string){ s }, (string){ from }, (string){ to } ); }
330static inline string replace( const string & s, const char * from, const char * to ) { return replace( s, (string){ from }, (string){ to } ); }
331static inline string replace( const string & s, const char * from, const string & to ) { return replace( s, (string){ from }, to ); }
332static inline string replace( const string & s, string & from, const char * to ) { return replace( s, from, (string){ to } ); }
333
334string translate( const string & s, int (* f)( int ) ); // for C character-class functions, e.g., isdigit
335static inline string translate( const char * cs, int (* f)( int ) ) { return translate( (string){ cs }, f ); }
[9018dcf]336
[1324fde]337static inline string translate( const string & s, bool (* f)( char ) ) { return translate( s, (int (*)( int ))f ); }
338static inline string translate( const char * cs, bool (* f)( char ) ) { return translate( (string){ cs }, f ); }
[d03a386]339
340#ifndef _COMPILING_STRING_CFA_
341#undef PBOOST
342#endif
Note: See TracBrowser for help on using the repository browser.