|
|
| version 1.224, 2016/03/31 21:46:20 | version 1.226, 2016/07/29 20:24:16 |
|---|---|
| Line 626 static void _save(Request& r, MethodPara | Line 626 static void _save(Request& r, MethodPara |
| // ^file.save[filespec;$.charset[] $.append(true)] | // ^file.save[filespec;$.charset[] $.append(true)] |
| int valid_options=0; | int valid_options=0; |
| if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ | if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ |
| asked_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); | asked_charset=&::charsets.get(vcharset_name->as_string()); |
| valid_options++; | valid_options++; |
| } | } |
| if(Value* vappend=options->get(MODE_APPEND)){ | if(Value* vappend=options->get(MODE_APPEND)){ |
| Line 769 static void _unescape(Request& r, Method | Line 769 static void _unescape(Request& r, Method |
| if(HashStringValue* options=params.as_hash(2)) { | if(HashStringValue* options=params.as_hash(2)) { |
| int valid_options=0; | int valid_options=0; |
| if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ | if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ |
| from_charset=&::charsets.get(vcharset_name->as_string().change_case(r.charsets.source(), String::CC_UPPER)); | from_charset=&::charsets.get(vcharset_name->as_string()); |
| valid_options++; | valid_options++; |
| } | } |
| if(valid_options!=options->count()) | if(valid_options!=options->count()) |
| Line 792 static void _unescape(Request& r, Method | Line 792 static void _unescape(Request& r, Method |
| } | } |
| } | } |
| static void _contains(Request& r, MethodParams& params) { | |
| // empty or whitespace string is hash compatible | |
| GET_SELF(r, VString).get_element(params.as_string(0, "key must be string")); | |
| // ignoring result as it allways null | |
| r.write_no_lang(VBool::get(false)); | |
| } | |
| // constructor | // constructor |
| MString::MString(): Methoded("string") { | MString::MString(): Methoded("string") { |
| Line 877 MString::MString(): Methoded("string") { | Line 884 MString::MString(): Methoded("string") { |
| // ^string:unescape[js|uri;escaped;$.charset[...]] | // ^string:unescape[js|uri;escaped;$.charset[...]] |
| add_native_method("unescape", Method::CT_STATIC, _unescape, 2, 3); | add_native_method("unescape", Method::CT_STATIC, _unescape, 2, 3); |
| // ^string.contains[key] for hash compatibility | |
| add_native_method("contains", Method::CT_DYNAMIC, _contains, 1, 1); | |
| } | } |