|
|
| version 1.78, 2001/10/09 07:06:00 | version 1.79, 2001/10/09 13:23:25 |
|---|---|
| Line 438 static void _replace(Request& r, const S | Line 438 static void _replace(Request& r, const S |
| Dictionary dict(*table); | Dictionary dict(*table); |
| r.write_assign_lang(*new(pool) VString(src.replace(pool, dict))); | r.write_assign_lang(*new(pool) VString(src.replace(pool, dict))); |
| } | } |
| static void _save(Request& r, const String& method_name, MethodParams *params) { | |
| Pool& pool=r.pool(); | |
| Value& vfile_name=params->as_no_junction(0, | |
| "file name must not be code"); | |
| const String& src=*static_cast<VString *>(r.self)->get_string(); | |
| // write | |
| file_write(pool, r.absolute(vfile_name.as_string()), | |
| src.cstr(String::UL_AS_IS), src.size(), true); | |
| } | |
| // constructor | // constructor |
| MString::MString(Pool& apool) : Methoded(apool) { | MString::MString(Pool& apool) : Methoded(apool) { |
| Line 487 MString::MString(Pool& apool) : Methoded | Line 500 MString::MString(Pool& apool) : Methoded |
| // ^string.replace[table] | // ^string.replace[table] |
| add_native_method("replace", Method::CT_DYNAMIC, _replace, 1, 1); | add_native_method("replace", Method::CT_DYNAMIC, _replace, 1, 1); |
| // ^string.save[file] | |
| add_native_method("save", Method::CT_DYNAMIC, _save, 1, 1); | |
| } | } |
| // global variable | // global variable |