|
|
| version 1.192, 2009/07/07 12:13:28 | version 1.196, 2009/10/15 01:07:20 |
|---|---|
| Line 142 public: | Line 142 public: |
| CORD make_langs(size_t aoffset, size_t alength) const { | CORD make_langs(size_t aoffset, size_t alength) const { |
| return opt.is_not_just_lang? | return opt.is_not_just_lang? |
| CORD_substr(langs, aoffset, alength) | CORD_substr(langs, aoffset, alength, 0) |
| :CORD_chars((char)opt.lang, alength); | :CORD_chars((char)opt.lang, alength); |
| } | } |
| Line 247 public: | Line 247 public: |
| if(!langs) // to uninitialized? | if(!langs) // to uninitialized? |
| if(src.opt.is_not_just_lang) | if(src.opt.is_not_just_lang) |
| langs=CORD_substr(src.langs, aoffset, alength); // to uninitialized complex | langs=CORD_substr(src.langs, aoffset, alength, 0); // to uninitialized complex |
| else | else |
| opt.lang=src.opt.lang; // to uninitialized simple | opt.lang=src.opt.lang; // to uninitialized simple |
| else | else |
| Line 363 public: | Line 363 public: |
| CORD get_cord() const { return body; } | CORD get_cord() const { return body; } |
| uint get_hash_code() const; | uint get_hash_code() const; |
| const char* cstr() const { return CORD_to_const_char_star(body); } | const char* cstr() const { return CORD_to_const_char_star(body, length()); } |
| char* cstrm() const { return CORD_to_char_star(body); } | char* cstrm() const { return CORD_to_char_star(body, length()); } |
| #ifdef STRING_LENGTH_CACHING | #ifdef STRING_LENGTH_CACHING |
| void set_length(size_t alength){ string_length = alength; } | void set_length(size_t alength){ string_length = alength; } |
| Line 410 public: | Line 410 public: |
| } | } |
| char fetch(size_t index) const { return CORD_fetch(body, index); } | char fetch(size_t index) const { return CORD_fetch(body, index); } |
| Body mid(size_t index, size_t length) const { return CORD_substr(body, index, length); } | Body mid(size_t aindex, size_t alength) const { return CORD_substr(body, aindex, alength, length()); } |
| size_t pos(const char* substr, size_t offset=0) const { return CORD_str(body, offset, substr); } | size_t pos(const char* substr, size_t offset=0) const { return CORD_str(body, offset, substr, length()); } |
| size_t pos(const Body substr, size_t offset=0) const { | size_t pos(const Body substr, size_t offset=0) const { |
| if(substr.is_empty()) | if(substr.is_empty()) |
| return STRING_NOT_FOUND; // in this case CORD_str returns 0 [parser users got used to -1] | return STRING_NOT_FOUND; // in this case CORD_str returns 0 [parser users got used to -1] |
| // CORD_str checks for bad offset [CORD_chr does not] | // CORD_str checks for bad offset [CORD_chr does not] |
| return CORD_str(body, offset, substr.body); | return CORD_str(body, offset, substr.body, length()); |
| } | } |
| size_t pos(char c, | size_t pos(char c, |
| size_t offset=0) const { | size_t offset=0) const { |
| Line 543 public: | Line 543 public: |
| char *untaint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { | char *untaint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { |
| return cstr_to_string_body_untaint(lang, connection, charsets).cstrm(); | return cstr_to_string_body_untaint(lang, connection, charsets).cstrm(); |
| } | } |
| const char* untaint_and_transcode_cstr(Language lang, const Request_charsets *charsets) const; | |
| /// puts pieces to buf | /// puts pieces to buf |
| Cm serialize(size_t prolog_size) const; | Cm serialize(size_t prolog_size) const; |
| /// appends pieces from buf to self | /// appends pieces from buf to self |