|
|
| version 1.172.2.21.2.25, 2003/03/24 15:56:59 | version 1.172.2.21.2.30, 2003/03/26 07:45:24 |
|---|---|
| Line 52 void String::ArrayFragment::append_posit | Line 52 void String::ArrayFragment::append_posit |
| if(substr_begin<fragment_begin) // not reached fragments which may include 'substr'? | if(substr_begin<fragment_begin) // not reached fragments which may include 'substr'? |
| continue; | continue; |
| if(substr_begin>fragment_end) // not reached fragments which may include 'substr'? | |
| continue; | |
| // found first fragment including piece of 'substr' | // found first fragment including piece of 'substr' |
| size_t piece_end=min(substr_end, fragment_end); | size_t piece_end=min(substr_end, fragment_end); |
| *this+=Fragment(fragment.lang, piece_end-substr_begin); | *this+=Fragment(fragment.lang, piece_end-substr_begin); |
| Line 73 void String::ArrayFragment::append_posit | Line 76 void String::ArrayFragment::append_posit |
| break; | break; |
| } | } |
| } | } |
| /* | |
| void String::ArrayFragment::mid(ArrayFragment& result, size_t substr_begin, size_t substr_end) { | |
| } | |
| */ | |
| // StringSimple methods | // StringBody methods |
| StringBody StringBody::Format(int value) { | |
| char local[MAX_NUMBER]; | |
| size_t length=snprintf(local, MAX_NUMBER, "%d", value); | |
| return StringBody(pa_strdup(local, length), length); | |
| } | |
| static int CORD_batched_iter_fn_generic_hash_code(char c, void * client_data) { | static int CORD_batched_iter_fn_generic_hash_code(char c, void * client_data) { |
| uint& result=*static_cast<uint*>(client_data); | uint& result=*static_cast<uint*>(client_data); |
| Line 105 String::String(const char* cstr, size_t | Line 109 String::String(const char* cstr, size_t |
| append(cstr, helper_length, tainted?L_TAINTED:L_CLEAN); | append(cstr, helper_length, tainted?L_TAINTED:L_CLEAN); |
| } | } |
| String::String(const String& src): body(src.body), fragments(src.fragments) {} | String::String(const String& src): body(src.body) { |
| fragments.append(src.fragments); | |
| } | |
| String& String::append(const char* str, size_t length, Language lang) { | String& String::append(const char* str, size_t length, Language lang) { |
| if(!str) | if(!str) |
| Line 284 Table* String::match(Charset& source_cha | Line 290 Table* String::match(Charset& source_cha |
| const char* errptr; | const char* errptr; |
| int erroffset; | int erroffset; |
| bool need_pre_post_match=false; | bool need_pre_post_match=false; |
| int option_bits[2]; regex_options(options, option_bits, need_pre_post_match); | int option_bits[2]={0}; regex_options(options, option_bits, need_pre_post_match); |
| bool global=option_bits[1]!=0; | bool global=option_bits[1]!=0; |
| pcre *code=pcre_compile(pattern, option_bits[0], | pcre *code=pcre_compile(pattern, option_bits[0], |
| &errptr, &erroffset, | &errptr, &erroffset, |
| Line 375 Table* String::match(Charset& source_cha | Line 381 Table* String::match(Charset& source_cha |
| String& String::change_case(Charset& source_charset, Change_case_kind kind) const { | String& String::change_case(Charset& source_charset, Change_case_kind kind) const { |
| String& result=*new String(); | String& result=*new String(); |
| if(is_empty()) | |
| return result; | |
| const unsigned char *tables=source_charset.pcre_tables; | const unsigned char *tables=source_charset.pcre_tables; |