|
|
| version 1.66, 2016/11/24 14:59:32 | version 1.68, 2016/11/27 23:08:28 |
|---|---|
| Line 311 static void _method_info(Request& r, Met | Line 311 static void _method_info(Request& r, Met |
| hash->put(method_max_params, new VInt(method->max_numbered_params_count)); | hash->put(method_max_params, new VInt(method->max_numbered_params_count)); |
| } else { | } else { |
| // parser code | // parser code |
| const String* filespec = r.get_method_filename(method); | const String* filespec = r.get_method_filespec(method); |
| if( filespec ) | if( filespec ) |
| hash->put("file", new VString(*filespec)); | hash->put("file", new VString(*filespec)); |
| Line 328 static void _method_info(Request& r, Met | Line 328 static void _method_info(Request& r, Met |
| r.write(result); | r.write(result); |
| } | } |
| static void _filename(Request& r, MethodParams& params) { | |
| if(Junction *j=params[0].get_junction()){ | |
| if(const Method* method=j->method){ | |
| if(!method->native_code) | |
| if(const String* filespec = r.get_method_filespec(method)) | |
| r.write(*new VString(*filespec)); | |
| return; | |
| } | |
| throw Exception(PARSER_RUNTIME, 0, "param must be object, class or method junction"); | |
| } | |
| if(VClass* vclass = dynamic_cast<VClass*>(params[0].get_class())){ | |
| r.write(*new VString(vclass->get_filespec())); | |
| } | |
| } | |
| static void _dynamical(Request& r, MethodParams& params) { | static void _dynamical(Request& r, MethodParams& params) { |
| if(params.count()){ | if(params.count()){ |
| r.write(VBool::get(params[0].get_class() != ¶ms[0])); | r.write(VBool::get(params[0].get_class() != ¶ms[0])); |
| Line 500 MReflection::MReflection(): Methoded("re | Line 516 MReflection::MReflection(): Methoded("re |
| // ^reflection:method_info[junction] | // ^reflection:method_info[junction] |
| add_native_method("method_info", Method::CT_STATIC, _method_info, 1, 2); | add_native_method("method_info", Method::CT_STATIC, _method_info, 1, 2); |
| // ^reflection:filename[object or class] | |
| add_native_method("filename", Method::CT_STATIC, _filename, 1, 1); | |
| // ^reflection:fields[object or class] | // ^reflection:fields[object or class] |
| add_native_method("fields", Method::CT_STATIC, _fields, 1, 1); | add_native_method("fields", Method::CT_STATIC, _fields, 1, 1); |