- Timestamp:
- Jan 29, 2009, 7:04:03 PM (16 years ago)
- Location:
- code/branches/buildsystem2/src/cpptcl
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2/src/cpptcl/CppTcl.cc
r1505 r2600 25 25 { 26 26 Tcl_Obj *obj = Tcl_GetObjResult(interp_); 27 27 28 28 int val, cc; 29 29 cc = Tcl_GetBooleanFromObj(interp_, obj, &val); … … 32 32 throw tcl_error(interp_); 33 33 } 34 34 35 35 return static_cast<bool>(val); 36 36 } … … 39 39 { 40 40 Tcl_Obj *obj = Tcl_GetObjResult(interp_); 41 41 42 42 double val; 43 43 int cc = Tcl_GetDoubleFromObj(interp_, obj, &val); … … 46 46 throw tcl_error(interp_); 47 47 } 48 48 49 49 return val; 50 50 } … … 53 53 { 54 54 Tcl_Obj *obj = Tcl_GetObjResult(interp_); 55 55 56 56 int val, cc; 57 57 cc = Tcl_GetIntFromObj(interp_, obj, &val); … … 60 60 throw tcl_error(interp_); 61 61 } 62 62 63 63 return val; 64 64 } … … 67 67 { 68 68 Tcl_Obj *obj = Tcl_GetObjResult(interp_); 69 69 70 70 long val; 71 71 int cc; … … 75 75 throw tcl_error(interp_); 76 76 } 77 77 78 78 return val; 79 79 } … … 195 195 return false; 196 196 } 197 197 198 198 piti = pit->second.find(cmdName); 199 199 return piti != pit->second.end(); … … 284 284 return TCL_ERROR; 285 285 } 286 286 287 287 string cmdName(Tcl_GetString(objv[0])); 288 288 callback_interp_map::iterator iti = it->second.find(cmdName); … … 294 294 return TCL_ERROR; 295 295 } 296 296 297 297 policies_map::iterator pit = call_policies.find(interp); 298 298 if (pit == call_policies.end()) … … 303 303 return TCL_ERROR; 304 304 } 305 305 306 306 policies_interp_map::iterator piti; 307 307 if (find_policies(interp, cmdName, piti) == false) … … 314 314 315 315 policies &pol = piti->second; 316 316 317 317 try 318 318 { … … 331 331 return TCL_ERROR; 332 332 } 333 333 334 334 return TCL_OK; 335 335 } … … 397 397 return TCL_ERROR; 398 398 } 399 399 400 400 string className(Tcl_GetString(objv[0])); 401 401 callback_interp_map::iterator iti = it->second.find(className); … … 407 407 return TCL_ERROR; 408 408 } 409 409 410 410 policies_interp_map::iterator piti; 411 411 if (find_policies(interp, className, piti) == false) … … 904 904 throw tcl_error(interp_); 905 905 } 906 906 907 907 return result(interp_); 908 908 } … … 924 924 throw tcl_error(interp_); 925 925 } 926 926 927 927 return result(interp_); 928 928 } … … 1010 1010 Tcl_CreateObjCommand(interp_, name.c_str(), 1011 1011 callback_handler, 0, 0); 1012 1012 1013 1013 callbacks[interp_][name] = cb; 1014 1014 call_policies[interp_][name] = p; … … 1041 1041 throw tcl_error(interp); 1042 1042 } 1043 1043 1044 1044 return res; 1045 1045 } … … 1053 1053 throw tcl_error(interp); 1054 1054 } 1055 1055 1056 1056 return res; 1057 1057 } … … 1065 1065 throw tcl_error(interp); 1066 1066 } 1067 1067 1068 1068 return res != 0; 1069 1069 } … … 1077 1077 throw tcl_error(interp); 1078 1078 } 1079 1079 1080 1080 return res; 1081 1081 } -
code/branches/buildsystem2/src/cpptcl/CppTcl.h
r1505 r2600 70 70 public: 71 71 result(Tcl_Interp *interp); 72 72 73 73 operator bool() const; 74 74 operator double() const; … … 171 171 throw tcl_error("Too few arguments."); 172 172 } 173 173 174 174 std::string methodName(Tcl_GetString(objv[1])); 175 175 … … 471 471 interpreter(Tcl_Interp *, bool owner = true); 472 472 ~interpreter(); 473 473 474 474 void make_safe(); 475 475 476 476 Tcl_Interp * get() const { return interp_; } 477 477 478 // free function definitions 479 478 // free function definitions 479 480 480 template <typename R> 481 481 void def(std::string const &name, R (*f)(), … … 634 634 } 635 635 636 // free script evaluation 636 // free script evaluation 637 637 details::result eval(std::string const &script); 638 638 details::result eval(std::istream &s); … … 838 838 throw tcl_error(interp_); 839 839 } 840 840 841 841 return details::result(interp_); 842 842 }
Note: See TracChangeset
for help on using the changeset viewer.