Changeset 162 for trunk/src/matlab/rpLibXml.cc
- Timestamp:
- Jan 31, 2006, 9:15:36 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibXml.cc
r154 r162 28 28 int nrhs, const mxArray *prhs[]) 29 29 { 30 const char* output_buf = NULL;31 30 int libIndex = 0; 32 31 int err = 1; 33 32 RpLibrary* lib = NULL; 33 std::string retStr = ""; 34 34 35 35 /* Check for proper number of arguments. */ 36 if (nrhs != 1) 36 if (nrhs != 1) { 37 37 mexErrMsgTxt("One input required."); 38 else if (nlhs > 2) 39 mexErrMsgTxt("Too many output arguments."); 38 } 40 39 41 40 // grab the integer value of the library handle … … 46 45 lib = getObject_Lib(libIndex); 47 46 if (lib) { 48 output_buf = rpXml(lib);49 if ( output_buf) {47 retStr = lib->xml(); 48 if (!retStr.empty()) { 50 49 err = 0; 51 50 } … … 54 53 55 54 /* Set C-style string output_buf to MATLAB mexFunction output*/ 56 plhs[0] = mxCreateString( output_buf);55 plhs[0] = mxCreateString(retStr.c_str()); 57 56 plhs[1] = mxCreateDoubleScalar(err); 58 57
Note: See TracChangeset
for help on using the changeset viewer.