Annotation of parser3/src/include/pa_string.h, revision 1.158

1.41      paf         1: /** @file
1.43      paf         2:        Parser: string class decl.
                      3: 
1.156     paf         4:        Copyright (c) 2001-2004 ArtLebedev Group (http://www.artlebedev.com)
1.124     paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_STRING_H
                      9: #define PA_STRING_H
1.140     paf        10: 
1.158   ! paf        11: static const char * const IDENT_STRING_H="$Date: 2004/02/27 15:07:46 $";
1.145     paf        12: 
                     13: // includes
1.1       paf        14: 
1.4       paf        15: #include "pa_types.h"
1.145     paf        16: #include "pa_array.h"
                     17: 
                     18: extern "C" { // cord's author forgot to do that
                     19: #define CORD_NO_IO
                     20: #include "cord.h"
                     21: };
1.4       paf        22: 
1.146     paf        23: // cord extension
                     24: /* Returns true if x does contain                                       */
                     25: /* char not_c at positions i..i+n. Value i,i+n must be < CORD_len(x).  */
                     26: int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c);
1.148     paf        27: size_t CORD_block_count(CORD x);
1.146     paf        28: 
1.145     paf        29: // forwards
1.9       paf        30: 
1.145     paf        31: class Charset;
1.135     paf        32: class Table;
1.71      paf        33: class SQL_Connection;
1.101     parser     34: class Dictionary;
1.145     paf        35: class Request_charsets;
                     36: class String;
                     37: typedef Array<const String*> ArrayString;
                     38: 
1.155     paf        39: // generally useful
                     40: 
                     41: int pa_atoi(const char* str, const String* problem_source=0);
                     42: double pa_atod(const char* str, const String* problem_source=0);
                     43: 
1.145     paf        44: /// this is result of pos functions which mean that substr were not found
                     45: #define STRING_NOT_FOUND ((size_t)-1)
                     46: 
1.146     paf        47: template<typename T>
                     48: inline size_t get_length(T current) {
                     49:        return current;
                     50: }
1.147     paf        51: 
1.42      paf        52: /** 
1.146     paf        53:        String which knows the lang of all it's langs.
1.41      paf        54: 
                     55:        All pieces remember 
                     56:        - whether they are tainted or not, 
1.146     paf        57:          and the lang which should be used to detaint them
1.41      paf        58: */
1.145     paf        59: class String: public PA_Object {
1.1       paf        60: public:
1.48      paf        61: 
1.146     paf        62:        /** piece is tainted or not. the lang to use when detaint
1.106     parser     63:                remember to change String_Untaint_lang_name @ untaint.C along
1.148     paf        64: 
                     65:                WARNING WARNING WARNING WARNING WARNING WARNING 
                     66:                
                     67:                pos function compares(<=) languages, that is used in searching
                     68:                for table column separator being L_CLEAN or L_AS_IS.
                     69:                they search for AS_IS, meaning AS_IS|CLEAN [doing <=L_AS_IS check].
                     70:                
                     71:                letters assigned for debugging, but it's important for no language-letter
                     72:                come before L_AS_IS other then L_CLEAN
                     73: 
                     74:                WARNING WARNING WARNING WARNING WARNING WARNING 
1.106     parser     75:        */
1.145     paf        76:        enum Language {
1.146     paf        77:                L_UNSPECIFIED=0, ///< no real string has parts of this lange: it's just convinient to check when string's empty
1.145     paf        78:                // these two must go before others, there are checks for >L_AS_IS
1.148     paf        79:                L_CLEAN='0', ///< clean  WARNING: read above warning before changing
                     80:                L_AS_IS='A',     ///< leave all characters intact  WARNING: read above warning before changing
1.122     paf        81: 
1.148     paf        82:                L_PASS_APPENDED='P',
1.41      paf        83:                        /**<
1.146     paf        84:                                leave lang built into string being appended.
1.41      paf        85:                                just a flag, that value not stored
                     86:                        */
1.148     paf        87:                L_TAINTED='T',  ///< tainted, untaint lang as assigned later 
1.146     paf        88:                // untaint langs. assigned by ^untaint[lang]{...}
1.148     paf        89:                L_FILE_SPEC='F', ///< file specification
                     90:                L_HTTP_HEADER='h',    ///< text in HTTP response header
                     91:                L_MAIL_HEADER='m',    ///< text in mail header
                     92:                L_URI='U',       ///< text in uri
                     93:                L_TABLE='L',     ///< ^table:set body
                     94:                L_SQL='Q',       ///< ^table:sql body
                     95:                L_JS='J',        ///< JavaScript code
                     96:                L_XML='X',              ///< ^dom:set xml
                     97:                L_HTML='H',      ///< HTML code (for editing)
                     98:                // READ WARNING ABOVE BEFORE ADDING ANYTHING
1.146     paf        99:                L_OPTIMIZE_BIT = 0x80  ///< flag, requiring cstr whitespace optimization
1.27      paf       100:        };
                    101: 
1.157     paf       102:        enum Trim_kind {
                    103:                TRIM_BOTH,
                    104:                TRIM_START,
                    105:                TRIM_END
                    106:        };
                    107: 
1.147     paf       108:        union Languages {
1.146     paf       109: 
1.147     paf       110:                struct {
                    111:                        Language lang:8;
                    112:                        int is_not_just_lang:sizeof(CORD)*8-8;
                    113:                } opt;
                    114:                CORD langs;
1.146     paf       115: 
                    116:                template<typename C>
                    117:                CORD make_langs(C current) const {
1.147     paf       118:                        return opt.is_not_just_lang?
1.146     paf       119:                                langs
1.147     paf       120:                                :CORD_chars((char)opt.lang, get_length(current));
1.146     paf       121:                }
                    122: 
                    123:                CORD make_langs(size_t aoffset, size_t alength)  const {
1.147     paf       124:                        return opt.is_not_just_lang?
1.146     paf       125:                                CORD_substr(langs, aoffset, alength)
1.147     paf       126:                                :CORD_chars((char)opt.lang, alength);
1.145     paf       127:                }
                    128: 
1.157     paf       129:                /// appending when 'langs' already contain something [simple cases handled elsewhere]
1.146     paf       130:                template<typename C>
                    131:                void append(C current, 
                    132:                        const CORD to_nonempty_target_langs) {
                    133:                        assert(langs);
                    134: 
1.147     paf       135:                        if(opt.is_not_just_lang)
1.146     paf       136:                                langs=CORD_cat(langs, to_nonempty_target_langs);
                    137:                        else { // we were "just lang"
                    138:                                size_t current_size=get_length(current);
                    139:                                assert(current_size);
                    140:                                langs=CORD_cat(
1.147     paf       141:                                        CORD_chars((char)opt.lang, current_size),  // first piece [making from just 'lang']
1.146     paf       142:                                        to_nonempty_target_langs); // new piece
                    143:                        }
1.145     paf       144:                }
1.146     paf       145: 
1.145     paf       146:        public:
1.146     paf       147: 
                    148:                const char* v() const;
                    149: 
                    150:                Languages(): langs(0) {}
1.147     paf       151:                Languages(Language alang) {
                    152:                        opt.lang=alang;
                    153:                        opt.is_not_just_lang=0;
                    154:                }
1.146     paf       155: 
                    156:                /// MUST be called exactly prior to modification of current [uses it's length]
                    157:                template<typename C>
                    158:                void append(C current, Language alang, size_t asize) {
                    159:                        assert(alang);
                    160:                        assert(asize);
                    161: 
1.147     paf       162:                        if(!opt.is_not_just_lang)
                    163:                                if(opt.lang) {
                    164:                                        if(opt.lang==alang) // same length? ignoring
1.146     paf       165:                                                return;
                    166:                                } else {
1.147     paf       167:                                        opt.lang=alang; // to uninitialized
1.146     paf       168:                                        return;
1.145     paf       169:                                }
1.146     paf       170: 
                    171:                        append(current, CORD_chars((char)alang, asize));
                    172:                }
                    173: 
                    174:                /// MUST be called exactly prior to modification of current [uses it's length]
                    175:                template<typename C>
                    176:                void append(C current, size_t appending_length, 
                    177:                        const Languages src) {
                    178:                        assert(appending_length);
                    179: 
                    180:                        if(!langs)
                    181:                                langs=src.langs; // to uninitialized
1.147     paf       182:                        else if(!src.opt.is_not_just_lang)
                    183:                                append(current, src.opt.lang, appending_length); // simplifying when simple source
1.146     paf       184:                        else
                    185:                                append(current, src.make_langs(appending_length));
                    186:                }
                    187:                
                    188:                /// MUST be called exactly prior to modification of current [uses it's length]
                    189:                template<typename C>
                    190:                void append(C current,
                    191:                        const Languages src, size_t aoffset, size_t alength) {
                    192:                        assert(alength);
                    193: 
                    194:                        if(!langs) // to uninitialized?
1.147     paf       195:                                if(src.opt.is_not_just_lang)
1.146     paf       196:                                        langs=CORD_substr(src.langs, aoffset, alength); // to uninitialized complex
                    197:                                else
1.147     paf       198:                                        opt.lang=src.opt.lang; // to uninitialized simple
1.146     paf       199:                        else 
1.147     paf       200:                                if(!opt.is_not_just_lang && !src.opt.is_not_just_lang && opt.lang==src.opt.lang) // both simple & of same language?
1.146     paf       201:                                        return; // ignoring
                    202:                                else
                    203:                                        append(current, src.make_langs(aoffset, alength));
                    204:                }
                    205: 
                    206:                /// checks if we have lang<=alang all from aoffset to aoffset+alength
                    207:                bool check_lang(Language alang, size_t aoffset, size_t alength) const {
                    208:                        if(alang==L_UNSPECIFIED) // ignore lang?
                    209:                                return true;
                    210: 
1.147     paf       211:                        if(opt.is_not_just_lang)
1.146     paf       212:                                return CORD_range_contains_chr_greater_then(langs, aoffset, alength, (unsigned)alang)==0;
                    213:                        else
1.147     paf       214:                                return opt.lang<=alang;
1.146     paf       215:                }
                    216: 
1.148     paf       217:                /// @returns count of blocks
                    218:                /// @todo currently there can be adjucent blocks of same language. someday merge them
                    219:                size_t count() const {
                    220:                        return opt.is_not_just_lang?
                    221:                                CORD_block_count(langs)
                    222:                                : opt.lang?
                    223:                                        1
                    224:                                        : 0;
                    225:                };
                    226: 
1.146     paf       227:                template<typename C, typename I> 
                    228:                void for_each(C current, 
                    229:                        int callback(char, size_t, I), I info) const {
                    230:                        
1.147     paf       231:                        if(opt.is_not_just_lang)
1.146     paf       232:                                CORD_block_iter(langs, 0, (CORD_block_iter_fn)callback, info);
                    233:                        else
1.147     paf       234:                                callback(opt.lang, get_length(current), info);
1.146     paf       235:                }
                    236: 
                    237:                bool invariant(size_t current_length) {
                    238:                        if(!langs)
                    239:                                return current_length==0;
1.147     paf       240:                        if(opt.is_not_just_lang)
1.146     paf       241:                                return CORD_len(langs)==current_length;
                    242:                        return true; // uncheckable, actually
                    243:                }
                    244:        };
                    245: 
                    246:        class Body {
                    247: 
                    248:                CORD body;
                    249: 
                    250:        public:
                    251: 
                    252:                const char* v() const;
                    253: 
                    254:                Body(): body(CORD_EMPTY) {}
                    255:                Body(CORD abody): body(abody) {
                    256:                        assert(!body // no body
                    257:                                || *body // ordinary string
                    258:                                || body[1]==1 // CONCAT_HDR
                    259:                                || body[1]==4 // FN_HDR 
                    260:                                || body[1]==6 // SUBSTR_HDR 
                    261:                                );
                    262:                }
                    263:                /// WARNING: length is only HELPER length, str in ANY case should be zero-terminated
                    264:                Body(const char* str, size_t helper_length): body(CORD_EMPTY) {
                    265:                        append_know_length(str, helper_length?helper_length:strlen(str));
                    266:                }
                    267:                static Body Format(int value);
                    268: 
                    269:                void clear() { body=CORD_EMPTY; }
                    270: 
                    271:                bool operator! () const { return is_empty(); }
                    272: 
                    273:                uint hash_code() const;
                    274: 
                    275:                const char* cstr() const { return CORD_to_const_char_star(body); }
                    276:                char* cstrm() const { return CORD_to_char_star(body); }
                    277: 
                    278:                size_t length() const { return CORD_len(body); }
                    279: 
                    280:                bool is_empty() const { return body==CORD_EMPTY; }
                    281: 
                    282:                void append_know_length(const char *str, size_t known_length) {
                    283:                        if(known_length)
                    284:                                body=CORD_cat_char_star(body, str, known_length);
                    285:                }
                    286:                void append_strdup_know_length(const char* str, size_t known_length) {
                    287:                        if(known_length)
                    288:                                append_know_length(pa_strdup(str, known_length), known_length);
                    289:                }
                    290:                void append(char c) { body=CORD_cat_char(body, c); }
                    291:                Body& operator << (const Body src) { body=CORD_cat(body, src.body); return *this; }
                    292:                Body& operator << (const char* str) { append_know_length(str, strlen(str)); return *this; }
                    293: 
                    294:                // could not figure out why this operator is needed [should do this chain: string->simple->==]
                    295:                bool operator < (const Body src) const { return CORD_cmp(body, src.body)<0; }
                    296:                bool operator > (const Body src) const { return CORD_cmp(body, src.body)>0; }
                    297:                bool operator <= (const Body src) const { return CORD_cmp(body, src.body)<=0; }
                    298:                bool operator >= (const Body src) const { return CORD_cmp(body, src.body)>=0; }
                    299:                bool operator != (const Body src) const { return CORD_cmp(body, src.body)!=0; }
                    300:                bool operator == (const Body src) const { return CORD_cmp(body, src.body)==0; }
                    301: 
                    302:                int ncmp(size_t x_begin, const Body y, size_t y_begin, size_t size) const {
                    303:                        return CORD_ncmp(body, x_begin, y.body, y_begin, size);
1.145     paf       304:                }
                    305: 
1.146     paf       306:                char fetch(size_t index) const { return CORD_fetch(body, index); }
                    307:                Body mid(size_t index, size_t length) const { return CORD_substr(body, index, length); }
                    308:                size_t pos(const char* substr, size_t offset=0) const { return CORD_str(body, offset, substr); }
                    309:                size_t pos(const Body substr, size_t offset=0) const { 
                    310:                        if(!substr.length())
                    311:                                return STRING_NOT_FOUND; // in this case CORD_str returns 0 [parser users got used to -1]
1.150     paf       312: 
                    313:                        // CORD_str checks for bad offset [CORD_chr does not]
1.146     paf       314:                        return CORD_str(body, offset, substr.body); 
                    315:                }
                    316:                size_t pos(char c, 
                    317:                        size_t offset=0) const {
1.150     paf       318:                        if(offset>=length()) // CORD_chr does not check that [and ABORT's in that case]
                    319:                                return STRING_NOT_FOUND;
                    320: 
1.146     paf       321:                        return CORD_chr(body, offset, c);
1.145     paf       322:                }
1.146     paf       323: 
1.149     paf       324:                template<typename I> void for_each(
                    325:                        int (*f1)(char c, I), 
                    326:                        int (*f2)(const char* s, I), 
                    327:                        I info) const {
                    328:                        CORD_iter5(body, 0, (CORD_iter_fn)f1, (CORD_batched_iter_fn)f2, info);
1.148     paf       329:                }
1.146     paf       330: 
                    331:                void set_pos(CORD_pos& pos, size_t index) const { CORD_set_pos(pos, body, index); }
                    332: 
                    333:                /*Body normalize() const {
                    334:                        return Body(CORD_balance(body));
                    335:                }*/
1.157     paf       336: 
                    337:                /// @returns this or 0 or mid. if returns this or 0 out_* are not filled
                    338:                Body trim(Trim_kind kind=TRIM_BOTH, const char* chars=0,
                    339:                        size_t* out_start=0, size_t* out_length=0) const;
1.145     paf       340:        };
                    341: 
                    342:        struct C {
                    343:                const char *str;
                    344:                size_t length;
                    345:                operator const char *() { return str; }
1.158   ! paf       346:                C(): str(0), length(0) {}
1.145     paf       347:                C(const char *astr, size_t asize): str(astr), length(asize) {}
                    348:        };
                    349: 
                    350:        struct Cm {
                    351:                char *str;
                    352:                size_t length;
                    353:                //operator char *() { return str; }
1.158   ! paf       354:                Cm(): str(0), length(0) {}
1.145     paf       355:                Cm(char *astr, size_t asize): str(astr), length(asize) {}
                    356:        };
                    357: 
                    358: private:
                    359: 
1.152     paf       360:        Body body; ///< all characters of string
1.146     paf       361:        Languages langs; ///< string characters lang
                    362: 
                    363:        const char* v() const;
                    364: 
                    365: #define ASSERT_STRING_INVARIANT(string) \
                    366:        assert((string).langs.invariant((string).body.length()))
1.145     paf       367: 
1.8       paf       368: public:
1.151     paf       369: 
                    370:        static const String Empty;
1.8       paf       371: 
1.145     paf       372:        explicit String(const char* cstr=0, size_t helper_length=0, bool tainted=false);
                    373:        explicit String(const C cstr, bool tainted=false);
1.146     paf       374:        String(Body abody, Language alang): body(abody), langs(alang) {
                    375:                ASSERT_STRING_INVARIANT(*this);
                    376:        }
                    377:        String(const String& src): body(src.body), langs(src.langs) {
                    378:                ASSERT_STRING_INVARIANT(*this);
1.145     paf       379:        }
                    380: 
                    381:        /// for convinient hash lookup
1.146     paf       382:        operator const Body() const { return body; }
1.145     paf       383: 
                    384:        bool is_empty() const { return body.is_empty(); }
                    385:        size_t length() const { return body.length(); }
                    386: 
                    387:        /// convert to CORD. if 'lang' known, forcing 'lang' to it
1.146     paf       388:        Body cstr_to_string_body(Language lang=L_AS_IS, 
1.145     paf       389:                SQL_Connection* connection=0,
                    390:                const Request_charsets *charsets=0) const;
                    391: 
                    392:        /// convert to constant C string. if 'lang' known, forcing 'lang' to it
                    393:        const char* cstr(Language lang=L_AS_IS, 
                    394:                SQL_Connection* connection=0,
                    395:                const Request_charsets *charsets=0) const {
                    396:                return cstr_to_string_body(lang, connection, charsets).cstr();
                    397:        }
                    398:        /// convert to Modifiable C string. if 'lang' known, forcing 'lang' to it
                    399:        char *cstrm(Language lang=L_AS_IS, 
                    400:                SQL_Connection* connection=0,
                    401:                const Request_charsets *charsets=0) const {
                    402:                return cstr_to_string_body(lang, connection, charsets).cstrm();
1.50      paf       403:        }
1.108     parser    404:        /// puts pieces to buf
1.145     paf       405:        Cm serialize(size_t prolog_size) const;
1.108     parser    406:        /// appends pieces from buf to self
1.145     paf       407:        bool deserialize(size_t prolog_size, void *buf, size_t buf_size);
1.146     paf       408:        /// @see Body::append_know_length
1.145     paf       409:        String& append_know_length(const char* str, size_t known_length, Language lang);
1.146     paf       410:        /// @see Body::append_help_length
1.145     paf       411:        String& append_help_length(const char* str, size_t helper_length, Language lang);
                    412:        String& append_strdup(const char* str, size_t helper_length, Language lang);
                    413: 
1.146     paf       414:        bool operator == (const char* y) const { return body==Body(y); }
                    415:        bool operator != (const char* y) const { return body!=Body(y); }
1.145     paf       416: 
                    417:        /// this starts with y
                    418:        bool starts_with(const char* y) const {
1.146     paf       419:                return body.ncmp(0/*x_begin*/, Body(y), 0/*y_begin*/, strlen(y))==0;
1.145     paf       420:        }
                    421:        /// x starts with this
                    422:        bool this_starts(const char* x) const {
1.146     paf       423:                return Body(x).ncmp(0/*x_begin*/, body, 0/*y_begin*/, length())==0;
1.26      paf       424:        }
                    425: 
1.145     paf       426:        String& append_to(String& dest, Language lang, bool forced) const;
                    427:        String& append(const String& src, Language lang, bool forced=false) { 
                    428:                return src.append_to(*this, lang, forced);
                    429:        }
                    430:        String& operator << (const String& src) { return append(src, L_PASS_APPENDED); }
                    431:        String& operator << (const char* src) { return append_help_length(src, 0, L_AS_IS); }
1.147     paf       432:        String& operator << (const Body src);
1.100     parser    433: 
1.142     paf       434:        /// extracts first char of a string, if any
                    435:        char first_char() const {
1.145     paf       436:                return is_empty()?0:body.fetch(0);
1.142     paf       437:        }
1.54      paf       438: 
1.145     paf       439:        bool operator < (const String& src) const { return body<src.body; }
                    440:        bool operator > (const String& src) const { return body>src.body; }
                    441:        bool operator <= (const String& src) const { return body<=src.body; }
                    442:        bool operator >= (const String& src) const { return body>=src.body; }
                    443:        bool operator != (const String& src) const { return body!=src.body; }
                    444:        bool operator == (const String& src) const { return body==src.body; }
                    445: 
1.54      paf       446:        /// extracts [start, finish) piece of string
1.145     paf       447:        String& mid(size_t substr_begin, size_t substr_end) const;
                    448: 
                    449:        /** 
                    450:                ignore lang if it's L_UNSPECIFIED
                    451:                but when specified: look for substring that lies in ONE fragment in THAT lang
                    452:                @return position of substr in string, -1 means "not found" [const char* version]
                    453:        */
1.146     paf       454:        size_t pos(const Body substr, 
1.145     paf       455:                size_t this_offset=0, Language lang=L_UNSPECIFIED) const;
                    456:        /// String version of @see pos(const char*, int, Language)
                    457:        size_t pos(const String& substr, 
                    458:                size_t this_offset=0, Language lang=L_UNSPECIFIED) const;
                    459:        size_t pos(char c, 
                    460:                size_t this_offset=0) const {
                    461:                return body.pos(c, this_offset);
                    462:        }
1.55      paf       463: 
1.145     paf       464:        void split(ArrayString& result, 
                    465:                size_t& pos_after,
                    466:                const char* delim, 
                    467:                Language lang=L_UNSPECIFIED, int limit=-1) const;
                    468:        void split(ArrayString& result, 
                    469:                size_t& pos_after, 
1.62      paf       470:                const String& delim, 
1.145     paf       471:                Language lang=L_UNSPECIFIED, int limit=-1) const;
1.62      paf       472: 
1.145     paf       473:        typedef void (*Row_action)(Table& table, ArrayString* row, 
1.136     paf       474:                int prestart, int prefinish, 
                    475:                int poststart, int postfinish,
1.68      paf       476:                void *info);
1.87      parser    477:        /**
1.145     paf       478:                @return table of found items, if any.
1.87      parser    479:                table format is defined and fixed[can be used by others]: 
                    480:                @verbatim
                    481:                        prematch/match/postmatch/1/2/3/...
                    482:                @endverbatim
                    483:        */
1.145     paf       484:        Table* match(Charset& source_charset,
1.64      paf       485:                const String& regexp, 
1.145     paf       486:                const String* options,
1.99      parser    487:                Row_action row_action, void *info,
1.145     paf       488:                bool& just_matched) const;
1.87      parser    489:        enum Change_case_kind {
                    490:                CC_UPPER,
                    491:                CC_LOWER
                    492:        };
1.145     paf       493:        String& change_case(Charset& source_charset,
1.87      parser    494:                Change_case_kind kind) const;
1.145     paf       495:        const String& replace(const Dictionary& dict) const;
1.157     paf       496:        const String& trim(Trim_kind kind=TRIM_BOTH, const char* chars=0) const;
1.155     paf       497:        double as_double() const { return pa_atod(cstr(), this); }
                    498:        int as_int() const { return pa_atoi(cstr(), this); }
1.137     paf       499: 
1.7       paf       500: private: //disabled
                    501: 
1.12      paf       502:        String& operator = (const String&) { return *this; }
1.7       paf       503: 
1.1       paf       504: };
1.119     paf       505: 
1.146     paf       506: template<>
                    507: inline size_t get_length<String::Body>(String::Body body) {
                    508:        return body.length();
                    509: }
                    510: 
1.145     paf       511: /// simple hash code of string. used by Hash
1.146     paf       512: inline uint hash_code(const String::Body self) {
1.145     paf       513:        return self.hash_code();
1.119     paf       514: }
1.147     paf       515: 
                    516: 
                    517: /// now that we've declared specialization we can use it
                    518: inline String& String::operator << (const String::Body src) { 
                    519:        langs.append(body, L_AS_IS, src.length());
                    520:        body<<src;
                    521:        return *this;
                    522: }
                    523: 
1.1       paf       524: 
                    525: #endif

E-mail: