|
|
| version 1.226, 2016/07/29 20:24:16 | version 1.227, 2016/09/08 20:41:47 |
|---|---|
| Line 202 static void _pos(Request& r, MethodParam | Line 202 static void _pos(Request& r, MethodParam |
| if(params.count()>1){ | if(params.count()>1){ |
| offset=params.as_int(1, "n must be int", r); | offset=params.as_int(1, "n must be int", r); |
| if(offset<0) | if(offset<0) |
| throw Exception(PARSER_RUNTIME, | throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", offset); |
| 0, | |
| "n(%d) must be >=0", offset); | |
| } | } |
| r.write_no_lang(*new VInt((int)string.pos(r.charsets.source(), substr.as_string(), (size_t)offset))); | r.write_no_lang(*new VInt((int)string.pos(r.charsets.source(), substr.as_string(), (size_t)offset))); |
| } | } |
| static void split_list(MethodParams& params, int paramIndex, | static void split_list(MethodParams& params, int paramIndex, const String& string, ArrayString& result) { |
| const String& string, | |
| ArrayString& result) { | |
| Value& delim_value=params.as_no_junction(paramIndex, "delimiter must not be code"); | Value& delim_value=params.as_no_junction(paramIndex, "delimiter must not be code"); |
| string.split(result, 0, delim_value.as_string()); | |
| size_t pos_after=0; | |
| string.split(result, pos_after, delim_value.as_string()); | |
| } | } |
| #define SPLIT_LEFT 0x0001 | #define SPLIT_LEFT 0x0001 |