|
|
| version 1.12, 2009/08/26 13:46:12 | version 1.16, 2010/05/22 07:37:05 |
|---|---|
| Line 201 static void _methods(Request& r, MethodP | Line 201 static void _methods(Request& r, MethodP |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| static void _fields(Request& r, MethodParams& params) { | |
| if(HashStringValue* fields=params[0].get_fields()){ | |
| VHash& result=*new VHash(*fields); | |
| r.write_no_lang(result); | |
| } else | |
| r.write_no_lang(*new VHash()); | |
| } | |
| static void _method_info(Request& r, MethodParams& params) { | static void _method_info(Request& r, MethodParams& params) { |
| const String& class_name=params.as_string(0, "class_name must be string"); | const String& class_name=params.as_string(0, "class_name must be string"); |
| Line 251 static void _method_info(Request& r, Met | Line 258 static void _method_info(Request& r, Met |
| hash->put(method_call_type, call_type); | hash->put(method_call_type, call_type); |
| } else { | } else { |
| // parser code | // parser code |
| const String* filespec = r.get_method_filename(method); | |
| if( filespec ) | |
| hash->put("file", new VString(*filespec)); | |
| if(method->params_names) | if(method->params_names) |
| for(size_t i=0; i<method->params_names->count(); i++) | for(size_t i=0; i<method->params_names->count(); i++) |
| hash->put(String::Body::Format(i), new VString(*method->params_names->get(i))); | hash->put(String::Body::Format(i), new VString(*method->params_names->get(i))); |
| Line 291 MReflection::MReflection(): Methoded("re | Line 301 MReflection::MReflection(): Methoded("re |
| // ^reflection:methods[class_name] | // ^reflection:methods[class_name] |
| add_native_method("methods", Method::CT_STATIC, _methods, 1, 1); | add_native_method("methods", Method::CT_STATIC, _methods, 1, 1); |
| // ^reflection:method_params[class_name;method_name] | // ^reflection:fields[object or class] |
| add_native_method("fields", Method::CT_STATIC, _fields, 1, 1); | |
| // ^reflection:method_info[class_name;method_name] | |
| add_native_method("method_info", Method::CT_STATIC, _method_info, 2, 2); | add_native_method("method_info", Method::CT_STATIC, _method_info, 2, 2); |
| // ^reflection:dynamical[[object or class, caller if absent]] | // ^reflection:dynamical[[object or class, caller if absent]] |