Changeset 1194 for code/branches/console/src/cpptcl
- Timestamp:
- Apr 27, 2008, 4:54:31 PM (17 years ago)
- Location:
- code/branches/console/src/cpptcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/console/src/cpptcl/CppTcl.cc
r1151 r1194 859 859 } 860 860 861 interpreter::interpreter(string const &libpath) 862 { 863 interp_ = Tcl_CreateInterp(); 864 owner_ = true; 865 866 try 867 { 868 this->eval("set tcl_library " + libpath); 869 Tcl_Init(this->interp_); 870 } catch (...) {} 871 } 872 861 873 interpreter::interpreter(Tcl_Interp *interp, bool owner) 862 874 { -
code/branches/console/src/cpptcl/CppTcl.h
r1151 r1194 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 … … 468 468 public: 469 469 interpreter(); 470 interpreter(std::string const &libpath); 470 471 interpreter(Tcl_Interp *, bool owner = true); 471 472 ~interpreter(); 472 473 473 474 void make_safe(); 474 475 475 476 Tcl_Interp * get() const { return interp_; } 476 477 477 // free function definitions 478 478 // free function definitions 479 479 480 template <typename R> 480 481 void def(std::string const &name, R (*f)(), … … 633 634 } 634 635 635 // free script evaluation 636 // free script evaluation 636 637 details::result eval(std::string const &script); 637 638 details::result eval(std::istream &s); … … 837 838 throw tcl_error(interp_); 838 839 } 839 840 840 841 return details::result(interp_); 841 842 }
Note: See TracChangeset
for help on using the changeset viewer.