Changeset 162 for trunk/src/matlab/rpLibGet.cc
- Timestamp:
- Jan 31, 2006 9:15:36 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibGet.cc
r154 r162 35 35 int err = 1; 36 36 RpLibrary* lib = NULL; 37 char* path = NULL;38 const char* retString = NULL;37 std::string path = ""; 38 std::string retStr = ""; 39 39 40 40 /* Check for proper number of arguments. */ 41 if (nrhs != 2) 41 if (nrhs != 2) { 42 42 mexErrMsgTxt("Two input required."); 43 else if (nlhs > 2) 44 mexErrMsgTxt("Too many output arguments."); 43 } 45 44 46 45 libIndex = getIntInput(prhs[0]); … … 48 47 49 48 /* Call the C subroutine. */ 50 if ( (libIndex > 0) && ( path) ) {49 if ( (libIndex > 0) && (!path.empty()) ) { 51 50 lib = getObject_Lib(libIndex); 52 51 53 52 if (lib) { 54 retString = rpGet(lib,path); 55 if (retString) { 56 err = 0; 57 } 53 retStr = lib->get(path); 54 err = 0; 58 55 } 59 56 } 60 57 61 58 /* Set C-style string output_buf to MATLAB mexFunction output*/ 62 plhs[0] = mxCreateString(retStr ing);59 plhs[0] = mxCreateString(retStr.c_str()); 63 60 plhs[1] = mxCreateDoubleScalar(err); 64 61
Note: See TracChangeset
for help on using the changeset viewer.