Changeset 591
- Timestamp:
- Feb 25, 2007 8:44:23 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/perl/Rappture.xs
r517 r591 56 56 CODE: 57 57 THIS->put(path,value,"",append); 58 58 59 void 60 RpLibrary::putFile( path, fileName, fileType, append ) 61 char *path 62 char *fileName 63 int fileType 64 int append 65 CODE: 66 THIS->putFile(path,fileName,fileType,append); 67 59 68 void 60 69 RpLibrary::result() -
trunk/src/core/RpLibrary.cc
r589 r591 1387 1387 std::string value, 1388 1388 std::string id, 1389 int append,1390 int translateFlag)1389 unsigned int append, 1390 unsigned int translateFlag) 1391 1391 { 1392 1392 scew_element* retNode = NULL; … … 1430 1430 1431 1431 RpLibrary& 1432 RpLibrary::put ( std::string path, double value, std::string id, int append ) 1432 RpLibrary::put ( std::string path, 1433 double value, 1434 std::string id, 1435 unsigned int append ) 1433 1436 { 1434 1437 std::stringstream valStr; … … 1453 1456 1454 1457 RpLibrary& 1455 RpLibrary::put ( std::string path, RpLibrary* value, std::string id, int append ) 1458 RpLibrary::put ( std::string path, 1459 RpLibrary* value, 1460 std::string id, 1461 unsigned int append ) 1456 1462 { 1457 1463 scew_element* retNode = NULL; … … 1527 1533 const char* bytes, 1528 1534 int nbytes, 1529 int append )1535 unsigned int append ) 1530 1536 { 1531 1537 scew_element* retNode = NULL; … … 1564 1570 1565 1571 /**********************************************************************/ 1566 // METHOD: put Data()1572 // METHOD: putFile() 1567 1573 /// Put data from a file into the xml. 1568 1574 /** … … 1574 1580 RpLibrary::putFile (std::string path, 1575 1581 std::string fileName, 1576 bool binary,1577 int append )1582 unsigned int fileType, 1583 unsigned int append ) 1578 1584 { 1579 1585 scew_element* retNode = NULL; … … 1595 1601 if ( (contents = scew_element_contents(retNode)) ) { 1596 1602 buf.append(contents); 1597 if ( binary == true) {1603 if (fileType == RPLIB_BINARY) { 1598 1604 // base64 decode and un-gzip the data 1599 1605 buf.decode(); … … 1605 1611 buf += fileBuf; 1606 1612 1607 if ( binary == true) {1613 if (fileType == RPLIB_BINARY) { 1608 1614 // gzip and base64 encode the data 1609 1615 buf.encode(); 1610 1616 } 1611 1617 1612 bytesWritten = (unsigned int)buf.size();1618 bytesWritten = buf.size(); 1613 1619 scew_element_set_contents_binary(retNode,buf.bytes(),&bytesWritten); 1620 1621 if (bytesWritten == buf.size()) { 1622 // error writing data to xml 1623 } 1614 1624 1615 1625 } -
trunk/src/core/RpLibrary.h
r589 r591 20 20 RPLIB_NO_TRANSLATE = 0, 21 21 RPLIB_TRANSLATE = 1, 22 RPLIB_TEXT = 0, 23 RPLIB_BINARY = 1, 22 24 }; 23 25 … … 112 114 std::string value, 113 115 std::string id = "", 114 int append = RPLIB_OVERWRITE,115 int translateFlag = RPLIB_TRANSLATE );116 unsigned int append = RPLIB_OVERWRITE, 117 unsigned int translateFlag = RPLIB_TRANSLATE ); 116 118 117 119 RpLibrary& put ( std::string path, 118 120 double value, 119 121 std::string id = "", 120 int append = RPLIB_OVERWRITE );122 unsigned int append = RPLIB_OVERWRITE ); 121 123 122 124 RpLibrary& put ( std::string path, 123 125 RpLibrary* value, 124 126 std::string id = "", 125 int append = RPLIB_OVERWRITE );127 unsigned int append = RPLIB_OVERWRITE ); 126 128 127 129 RpLibrary& putData( std::string path, 128 130 const char* bytes, 129 131 int nbytes, 130 int append = RPLIB_OVERWRITE );132 unsigned int append = RPLIB_OVERWRITE ); 131 133 132 134 RpLibrary& putFile( std::string path, 133 135 std::string fileName, 134 bool binary,135 int append = RPLIB_OVERWRITE );136 unsigned int fileType = RPLIB_BINARY, 137 unsigned int append = RPLIB_OVERWRITE ); 136 138 137 139 RpLibrary* remove (std::string path = ""); -
trunk/src/fortran/RpLibraryFInterface.cc
r496 r591 5 5 * ====================================================================== 6 6 * AUTHOR: Derrick Kearney, Purdue University 7 * Copyright (c) 2004-200 5Purdue Research Foundation7 * Copyright (c) 2004-2007 Purdue Research Foundation 8 8 * 9 9 * See the file "license.terms" for information on usage and … … 670 670 671 671 } 672 673 674 /**********************************************************************/ 675 // FUNCTION: rp_lib_put_data() 676 /// Put string into Rappture Library Object at location 'path'. 677 /** 678 */ 679 void rp_lib_put_data( int* handle, 680 char* path, 681 char* bytes, 682 int* nbytes, 683 int* append, 684 int path_len, 685 int bytes_len 686 ) 687 { 688 std::string inPath = ""; 689 RpLibrary* lib = NULL; 690 691 inPath = null_terminate_str(path,path_len); 692 693 if ((handle) && (*handle != 0)) { 694 lib = getObject_Lib(*handle); 695 696 if (lib) { 697 lib->putData(inPath,bytes,*nbytes,*append); 698 } 699 } 700 701 return; 702 703 } 704 705 706 /**********************************************************************/ 707 // FUNCTION: rp_lib_put_file() 708 /// Put string into Rappture Library Object at location 'path'. 709 /** 710 */ 711 void rp_lib_put_file( int* handle, 712 char* path, 713 char* fileName, 714 int* fileType, 715 int* append, 716 int path_len, 717 int fileName_len 718 ) 719 { 720 std::string inPath = ""; 721 std::string inFileName = ""; 722 RpLibrary* lib = NULL; 723 724 inPath = null_terminate_str(path,path_len); 725 inFileName = null_terminate_str(fileName,fileName_len); 726 727 if ((handle) && (*handle != 0)) { 728 lib = getObject_Lib(*handle); 729 730 if (lib) { 731 lib->putFile(inPath,inFileName,*fileType,*append); 732 } 733 } 734 735 return; 736 737 } 738 672 739 673 740 //void rp_lib_put_obj( int* handle, -
trunk/src/fortran/RpLibraryFInterface.h
r554 r591 5 5 * ====================================================================== 6 6 * AUTHOR: Derrick S. Kearney, Purdue University 7 * Copyright (c) 2004-200 5Purdue Research Foundation7 * Copyright (c) 2004-2007 Purdue Research Foundation 8 8 * 9 9 * See the file "license.terms" for information on usage and … … 95 95 int id_len ); 96 96 97 void rp_lib_put_data ( int* handle, 98 char* path, 99 char* bytes, 100 int* nbytes, 101 int* append, 102 int path_len, 103 int bytes_len ); 104 105 void rp_lib_put_file ( int* handle, 106 char* path, 107 char* fileName, 108 int* fileType, 109 int* append, 110 int path_len, 111 int fileName_len ); 112 97 113 /* 98 114 * rp_lib_put_obj still needs to be written -
trunk/src/fortran/RpLibraryFStubs.c
r496 r591 5 5 * ====================================================================== 6 6 * AUTHOR: Derrick Kearney, Purdue University 7 * Copyright (c) 2004-200 5Purdue Research Foundation7 * Copyright (c) 2004-2007 Purdue Research Foundation 8 8 * 9 9 * See the file "license.terms" for information on usage and … … 348 348 int value_len ) { 349 349 350 return rp_lib_put_str(handle,path,value,append,path_len,value_len); 350 rp_lib_put_str(handle,path,value,append,path_len,value_len); 351 return; 351 352 } 352 353 … … 359 360 int value_len ) { 360 361 361 return rp_lib_put_str(handle,path,value,append,path_len,value_len); 362 rp_lib_put_str(handle,path,value,append,path_len,value_len); 363 return; 362 364 } 363 365 … … 370 372 int value_len ) { 371 373 372 return rp_lib_put_str(handle,path,value,append,path_len,value_len); 374 rp_lib_put_str(handle,path,value,append,path_len,value_len); 375 return; 373 376 } 374 377 … … 383 386 int id_len ) { 384 387 385 r eturn rp_lib_put_id_str( handle, path, value,id,append,386 path_len,value_len,id_len);388 rp_lib_put_id_str(handle,path,value,id,append,path_len,value_len,id_len); 389 return; 387 390 } 388 391 … … 397 400 int id_len ) { 398 401 399 r eturn rp_lib_put_id_str( handle, path, value,id,append,400 path_len,value_len,id_len);402 rp_lib_put_id_str(handle,path,value,id,append,path_len,value_len,id_len); 403 return; 401 404 } 402 405 … … 411 414 int id_len ) { 412 415 413 return rp_lib_put_id_str( handle, path, value,id,append, 414 path_len,value_len,id_len); 416 rp_lib_put_id_str(handle,path,value,id,append,path_len,value_len,id_len); 417 return; 418 } 419 420 void 421 rp_lib_put_data_ ( int* handle, 422 char* path, 423 char* bytes, 424 int* nbytes, 425 int* append, 426 int path_len, 427 int bytes_len ) { 428 429 rp_lib_put_data(handle,path,bytes,nbytes,append,path_len,bytes_len); 430 return; 431 } 432 433 void 434 rp_lib_put_data__ ( int* handle, 435 char* path, 436 char* bytes, 437 int* nbytes, 438 int* append, 439 int path_len, 440 int bytes_len ) { 441 442 rp_lib_put_data(handle,path,bytes,nbytes,append,path_len,bytes_len); 443 return; 444 } 445 446 void 447 RP_LIB_PUT_DATA ( int* handle, 448 char* path, 449 char* bytes, 450 int* nbytes, 451 int* append, 452 int path_len, 453 int bytes_len ) { 454 455 rp_lib_put_data(handle,path,bytes,nbytes,append,path_len,bytes_len); 456 return; 457 } 458 459 void 460 rp_lib_put_file_ ( int* handle, 461 char* path, 462 char* fileName, 463 int* fileType, 464 int* append, 465 int path_len, 466 int fileName_len ) { 467 468 rp_lib_put_file(handle,path,fileName,fileType,append,path_len,fileName_len); 469 return; 470 } 471 472 void 473 rp_lib_put_file__ ( int* handle, 474 char* path, 475 char* fileName, 476 int* fileType, 477 int* append, 478 int path_len, 479 int fileName_len ) { 480 481 rp_lib_put_file(handle,path,fileName,fileType,append,path_len,fileName_len); 482 return; 483 } 484 485 void 486 RP_LIB_PUT_FILE ( int* handle, 487 char* path, 488 char* fileName, 489 int* fileType, 490 int* append, 491 int path_len, 492 int fileName_len ) { 493 494 rp_lib_put_file(handle,path,fileName,fileType,append,path_len,fileName_len); 495 return; 415 496 } 416 497 -
trunk/src/fortran/RpLibraryFStubs.h
r511 r591 5 5 * ====================================================================== 6 6 * AUTHOR: Derrick Kearney, Purdue University 7 * Copyright (c) 2004-200 5Purdue Research Foundation7 * Copyright (c) 2004-2007 Purdue Research Foundation 8 8 * 9 9 * See the file "license.terms" for information on usage and … … 98 98 int id_len ); 99 99 100 void rp_lib_put_data_ ( int* handle, 101 char* path, 102 char* bytes, 103 int* nbytes, 104 int* append, 105 int path_len, 106 int bytes_len ); 107 108 void rp_lib_put_file_ ( int* handle, 109 char* path, 110 char* fileName, 111 int* fileType, 112 int* append, 113 int path_len, 114 int fileName_len ); 115 116 /* 100 117 void rp_lib_put_obj_ ( int* handle, 101 118 char* path, … … 111 128 int path_len, 112 129 int id_len ); 130 */ 113 131 114 132 int rp_lib_remove_ ( int* handle, … … 221 239 int id_len ); 222 240 241 void rp_lib_put_data__ ( int* handle, 242 char* path, 243 char* bytes, 244 int* nbytes, 245 int* append, 246 int path_len, 247 int bytes_len ); 248 249 void rp_lib_put_file__ ( int* handle, 250 char* path, 251 char* fileName, 252 int* fileType, 253 int* append, 254 int path_len, 255 int fileName_len ); 256 257 /* 223 258 void rp_lib_put_obj__ ( int* handle, 224 259 char* path, … … 234 269 int path_len, 235 270 int id_len ); 271 */ 236 272 237 273 int rp_lib_remove__ ( int* handle, … … 345 381 int id_len ); 346 382 383 void RP_LIB_PUT_DATA ( int* handle, 384 char* path, 385 char* bytes, 386 int* nbytes, 387 int* append, 388 int path_len, 389 int bytes_len ); 390 391 void RP_LIB_PUT_FILE ( int* handle, 392 char* path, 393 char* fileName, 394 int* fileType, 395 int* append, 396 int path_len, 397 int fileName_len ); 398 /* 347 399 void RP_LIB_PUT_OBJ ( int* handle, 348 400 char* path, … … 358 410 int path_len, 359 411 int id_len ); 412 */ 360 413 361 414 int RP_LIB_REMOVE ( int* handle, … … 391 444 /**********************************************************/ 392 445 393 #ifdef __cplusplus 446 #ifdef __cplusplus 394 447 } 395 448 #endif -
trunk/src/matlab/Makefile.in
r569 r591 59 59 rpLibPutString.mexglx \ 60 60 rpLibPutDouble.mexglx \ 61 rpLibPutFile.mexglx \ 61 62 rpLibNodeComp.mexglx \ 62 63 rpLibNodeType.mexglx \ … … 118 119 rpLibPutDouble.mexglx: 119 120 $(MEX) rpLibPutDouble.cc $(MATLAB_COMP_ARGS) 121 rpLibPutFile.mexglx: 122 $(MEX) rpLibPutFile.cc $(MATLAB_COMP_ARGS) 120 123 rpLibNodeComp.mexglx: 121 124 $(MEX) rpLibNodeComp.cc $(MATLAB_COMP_ARGS) -
trunk/src/octave/Makefile.in
r569 r591 56 56 rpLibPutDouble.oct \ 57 57 rpLibPutSingle.oct \ 58 rpLibPutFile.oct \ 58 59 rpLibResult.oct \ 59 60 rpLibXml.oct \ … … 106 107 rpLibPutSingle.oct: 107 108 $(OCT) rpLibPutString.cc $(OCTAVE_COMP_ARGS) 109 rpLibPutFile.oct: 110 $(OCT) rpLibPutFile.cc $(OCTAVE_COMP_ARGS) 108 111 rpLibResult.oct: 109 112 $(OCT) rpLibResult.cc $(OCTAVE_COMP_ARGS)
Note: See TracChangeset
for help on using the changeset viewer.