Changeset 591 for trunk/src/core
- Timestamp:
- Feb 25, 2007, 8:44:23 PM (18 years ago)
- Location:
- trunk/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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 = "");
Note: See TracChangeset
for help on using the changeset viewer.