352 #if defined(OTDB_MESSAGE_PACK) || defined(OTDB_PROTOCOL_BUFFERS)
360 #if defined(OTDB_MESSAGE_PACK)
362 &StringMsgpack::Instantiate;
364 &BlobMsgpack::Instantiate;
366 &StringMapMsgpack::Instantiate;
368 &WalletDataMsgpack::Instantiate;
370 &BitcoinAcctMsgpack::Instantiate;
372 &BitcoinServerMsgpack::Instantiate;
374 &RippleServerMsgpack::Instantiate;
376 &LoomServerMsgpack::Instantiate;
378 &ServerInfoMsgpack::Instantiate;
380 &ContactAcctMsgpack::Instantiate;
382 &ContactNymMsgpack::Instantiate;
384 &ContactMsgpack::Instantiate;
386 &AddressBookMsgpack::Instantiate;
388 &MarketDataMsgpack::Instantiate;
390 &MarketListMsgpack::Instantiate;
392 &BidDataMsgpack::Instantiate;
394 &AskDataMsgpack::Instantiate;
396 &OfferListMarketMsgpack::Instantiate;
398 &TradeDataMarketMsgpack::Instantiate;
400 &TradeListMarketMsgpack::Instantiate;
402 &OfferDataNymMsgpack::Instantiate;
404 &OfferListNymMsgpack::Instantiate;
406 &TradeDataNymMsgpack::Instantiate;
408 &TradeListNymMsgpack::Instantiate;
411 #if defined(OTDB_PROTOCOL_BUFFERS)
412 GOOGLE_PROTOBUF_VERIFY_VERSION;
414 &StringPB::Instantiate;
416 &BlobPB::Instantiate;
418 &StringMapPB::Instantiate;
420 &WalletDataPB::Instantiate;
422 &BitcoinAcctPB::Instantiate;
424 &BitcoinServerPB::Instantiate;
426 &RippleServerPB::Instantiate;
428 &LoomServerPB::Instantiate;
430 &ServerInfoPB::Instantiate;
432 &ContactAcctPB::Instantiate;
434 &ContactNymPB::Instantiate;
436 &ContactPB::Instantiate;
438 &AddressBookPB::Instantiate;
440 &MarketDataPB::Instantiate;
442 &MarketListPB::Instantiate;
444 &BidDataPB::Instantiate;
446 &AskDataPB::Instantiate;
449 &OfferListMarketPB::Instantiate;
452 &TradeDataMarketPB::Instantiate;
455 &TradeListMarketPB::Instantiate;
457 &OfferDataNymPB::Instantiate;
459 &OfferListNymPB::Instantiate;
461 &TradeDataNymPB::Instantiate;
463 &TradeListNymPB::Instantiate;
473 #if defined(OTDB_PROTOCOL_BUFFERS)
474 google::protobuf::ShutdownProtobufLibrary();
506 otInfo <<
"OTDB::InitDefaultStorage: Existing storage context doesn't "
507 "already exist. (Creating it.)\n";
513 otErr <<
"OTDB::InitDefaultStorage: Failed while calling "
514 "OTDB::Storage::Create()\n";
534 if (
nullptr == pStorage) {
550 std::string& twoStr, std::string& threeStr,
551 const char* szFuncName)
553 if (
nullptr == szFuncName) szFuncName = __FUNCTION__;
555 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
556 ot_threeStr(threeStr);
558 if (ot_strFolder.Exists()) {
559 if (!ot_oneStr.Exists()) {
560 if ((!ot_twoStr.Exists()) && (!ot_threeStr.
Exists())) {
565 otErr << szFuncName <<
": ot_twoStr or ot_threeStr exist, when "
566 "ot_oneStr doesn't exist! \n";
570 else if ((!ot_twoStr.Exists()) && (ot_threeStr.
Exists())) {
571 otErr << szFuncName <<
": ot_twoStr or ot_threeStr exist, when "
572 "ot_oneStr doesn't exist! \n";
577 otErr << szFuncName <<
": ot_strFolder must always exist!\n";
584 bool Exists(std::string strFolder, std::string oneStr, std::string twoStr,
585 std::string threeStr)
588 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
589 ot_threeStr(threeStr);
591 "OTDB::Exists: strFolder is empty.");
593 if (!ot_oneStr.Exists()) {
595 "Exists: bad options");
603 if (
nullptr == pStorage) {
604 otOut <<
"OTDB::" << __FUNCTION__
605 <<
": details::s_pStorage is null. (Returning false.)\n";
609 return pStorage->
Exists(strFolder, oneStr, twoStr, threeStr);
613 std::string oneStr, std::string twoStr,
614 std::string threeStr)
617 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
618 ot_threeStr(threeStr);
620 "OTDB::FormPathString: strFolder is empty.");
622 if (!ot_oneStr.Exists()) {
624 "FormPathString: bad options");
632 if (
nullptr == pStorage) {
633 otOut <<
"OTDB::" << __FUNCTION__
634 <<
": details::s_pStorage is null. (Returning -1.)\n";
638 return pStorage->
FormPathString(strOutput, strFolder, oneStr, twoStr,
645 std::string oneStr, std::string twoStr, std::string threeStr)
648 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
649 ot_threeStr(threeStr);
651 "OTDB::StoreString: strFolder is null");
653 if (!ot_oneStr.Exists()) {
655 "OTDB::StoreString: bad options");
663 if (
nullptr == pStorage) {
667 return pStorage->
StoreString(strContents, strFolder, oneStr, twoStr,
671 std::string
QueryString(std::string strFolder, std::string oneStr,
672 std::string twoStr, std::string threeStr)
675 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
676 ot_threeStr(threeStr);
680 return std::string(
"");
682 if (!ot_oneStr.Exists()) {
684 "Storage::StoreString: bad options");
691 if (
nullptr == pStorage)
return std::string(
"");
693 return pStorage->
QueryString(strFolder, oneStr, twoStr, threeStr);
699 std::string oneStr, std::string twoStr,
700 std::string threeStr)
703 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
704 ot_threeStr(threeStr);
706 "OTDB::StorePlainString: strFolder is null");
708 if (!ot_oneStr.Exists()) {
710 "OTDB::StorePlainString: bad options");
717 OT_ASSERT((strFolder.length() > 3) || (0 == strFolder.compare(0, 1,
".")));
718 OT_ASSERT((oneStr.length() < 1) || (oneStr.length() > 3));
720 if (
nullptr == pStorage) {
729 std::string twoStr, std::string threeStr)
732 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
733 ot_threeStr(threeStr);
735 "OTDB::QueryPlainString: strFolder is null");
737 if (!ot_oneStr.Exists()) {
739 "OTDB::QueryPlainString: bad options");
747 OT_ASSERT((strFolder.length() > 3) || (0 == strFolder.compare(0, 1,
".")));
748 OT_ASSERT((oneStr.length() < 1) || (oneStr.length() > 3));
750 if (
nullptr == pStorage) {
751 return std::string(
"");
760 std::string oneStr, std::string twoStr, std::string threeStr)
763 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
764 ot_threeStr(threeStr);
766 "OTDB:StoreObject: strFolder is null");
768 if (!ot_oneStr.Exists()) {
770 "OTDB:StoreObject: bad options");
778 if (
nullptr == pStorage) {
779 otErr <<
"OTDB::StoreObject: No default storage object allocated.\n";
783 return pStorage->
StoreObject(theContents, strFolder, oneStr, twoStr,
789 std::string oneStr, std::string twoStr,
790 std::string threeStr)
793 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
794 ot_threeStr(threeStr);
796 "OTDB::QueryObject: strFolder is null");
798 if (!ot_oneStr.Exists()) {
800 "OTDB::QueryObject: bad options");
808 if (
nullptr == pStorage) {
812 return pStorage->
QueryObject(theObjectType, strFolder, oneStr, twoStr,
822 if (
nullptr == pStorage) {
823 otErr <<
"OTDB::EncodeObject: No Default Storage object allocated.\n";
834 if (
nullptr == pStorage) {
844 std::string twoStr, std::string threeStr)
848 if (
nullptr == pStorage) {
850 <<
"OTDB::EraseValueByKey: No Default Storage object allocated.\n";
880 if (
nullptr != pFunc) {
881 pStorable = (*pFunc)();
894 #if defined(OTDB_MESSAGE_PACK)
896 pPacker =
new PackerMsgpack;
900 #if defined(OTDB_PROTOCOL_BUFFERS)
902 pPacker =
new PackerPB;
916 #if defined(OTDB_MESSAGE_PACK)
919 #if defined(OTDB_PROTOCOL_BUFFERS)
932 IStorable* pStorable =
dynamic_cast<IStorable*
>(&
inObj);
938 otErr <<
"OTPacker::Pack: Error: IStorable dynamic_cast failed.\n";
949 pStorable->hookBeforePack();
957 if (!pStorable->onPack(*pBuffer, inObj)) {
974 IStorable* pStorable =
dynamic_cast<IStorable*
>(&outObj);
976 if (
nullptr == pStorable)
return false;
982 if (!pStorable->onUnpack(inBuf, outObj)) {
986 pStorable->hookAfterUnpack();
1025 #define IMPLEMENT_GET_ADD_REMOVE(scope, name) \
1027 typedef stlplus::simple_ptr_clone<name> PointerTo##name; \
1029 typedef std::deque<PointerTo##name> listOf##name##s; \
1031 size_t scope Get##name##Count() \
1033 return list_##name##s.size(); \
1036 name* scope Get##name(size_t nIndex) \
1038 if (nIndex < list_##name##s.size()) { \
1039 PointerTo##name theP = list_##name##s.at(nIndex); \
1040 return theP.pointer(); \
1045 bool scope Remove##name(size_t nIndex##name) \
1047 if (nIndex##name < list_##name##s.size()) { \
1048 list_##name##s.erase(list_##name##s.begin() + nIndex##name); \
1054 bool scope Add##name(name& disownObject) \
1056 PointerTo##name theP(disownObject.clone()); \
1057 list_##name##s.push_back(theP); \
1103 ContactNym::~ContactNym()
1129 #if defined(OTDB_MESSAGE_PACK)
1133 #endif // defined (OTDB_MESSAGE_PACK)
1345 #if defined(OTDB_PROTOCOL_BUFFERS)
1347 ::google::protobuf::MessageLite* IStorablePB::getPBMessage()
1358 template <
class theBaseType,
class theInternalType,
1360 ::google::protobuf::MessageLite* ProtobufSubclass<theBaseType, theInternalType,
1361 theObjectType>::getPBMessage()
1372 bool IStorablePB::onPack(PackedBuffer& theBuffer,
1376 BufferPB* pBuffer =
dynamic_cast<BufferPB*
>(&theBuffer);
1378 if (
nullptr == pBuffer)
1381 ::google::protobuf::MessageLite* pMessage = getPBMessage();
1383 if (
nullptr == pMessage)
return false;
1385 if (!pMessage->SerializeToString(&(pBuffer->m_buffer)))
return false;
1394 BufferPB* pBuffer =
dynamic_cast<BufferPB*
>(&theBuffer);
1396 if (
nullptr == pBuffer)
1399 ::google::protobuf::MessageLite* pMessage = getPBMessage();
1401 if (
nullptr == pMessage)
return false;
1403 if (!pMessage->ParseFromString(pBuffer->m_buffer))
return false;
1417 bool BufferPB::PackString(std::string& theString)
1419 StringPB theWrapper;
1421 ::google::protobuf::MessageLite* pMessage = theWrapper.getPBMessage();
1423 if (
nullptr == pMessage)
return false;
1425 String_InternalPB* pBuffer =
dynamic_cast<String_InternalPB*
>(pMessage);
1427 if (
nullptr == pBuffer)
1430 pBuffer->set_value(theString);
1432 if (!pBuffer->SerializeToString(&m_buffer))
return false;
1437 bool BufferPB::UnpackString(std::string& theString)
1439 StringPB theWrapper;
1441 ::google::protobuf::MessageLite* pMessage = theWrapper.getPBMessage();
1443 if (
nullptr == pMessage)
return false;
1445 String_InternalPB* pBuffer =
dynamic_cast<String_InternalPB*
>(pMessage);
1447 if (
nullptr == pBuffer)
1450 if (!pBuffer->ParseFromString(m_buffer))
return false;
1452 theString = pBuffer->value();
1457 bool BufferPB::ReadFromIStream(std::istream& inStream, int64_t lFilesize)
1459 unsigned long size =
static_cast<unsigned long>(lFilesize);
1461 char* buf =
new char[size];
1464 inStream.read(buf, size);
1466 if (inStream.good()) {
1467 m_buffer.assign(buf, size);
1480 bool BufferPB::WriteToOStream(std::ostream& outStream)
1483 if (m_buffer.length() > 0) {
1484 outStream.write(m_buffer.c_str(), m_buffer.length());
1485 return outStream.good() ?
true :
false;
1488 otErr <<
"Buffer had zero length in BufferPB::WriteToOStream\n";
1495 const uint8_t* BufferPB::GetData()
1497 return reinterpret_cast<const uint8_t*
>(m_buffer.c_str());
1500 size_t BufferPB::GetSize()
1502 return m_buffer.size();
1505 void BufferPB::SetData(
const uint8_t* pData,
size_t theSize)
1507 m_buffer.assign(reinterpret_cast<const char*>(pData), theSize);
1525 #define OT_IMPLEMENT_PB_LIST_PACK(pb_name, element_type) \
1526 __pb_obj.clear_##pb_name(); \
1527 for (auto it = list_##element_type##s.begin(); \
1528 it != list_##element_type##s.end(); ++it) { \
1529 PointerTo##element_type thePtr = (*it); \
1530 element_type##PB* pObject = \
1531 dynamic_cast<element_type##PB*>(thePtr.pointer()); \
1532 OT_ASSERT(nullptr != pObject); \
1533 ::google::protobuf::MessageLite* pMessage = pObject->getPBMessage(); \
1534 OT_ASSERT(nullptr != pMessage); \
1535 element_type##_InternalPB* pInternal = \
1536 dynamic_cast<element_type##_InternalPB*>(pMessage); \
1537 OT_ASSERT(nullptr != pInternal); \
1538 element_type##_InternalPB* pNewInternal = __pb_obj.add_##pb_name(); \
1539 OT_ASSERT(nullptr != pNewInternal); \
1540 pObject->hookBeforePack(); \
1541 pNewInternal->CopyFrom(*pInternal); \
1544 #define OT_IMPLEMENT_PB_LIST_UNPACK(pb_name, element_type, ELEMENT_ENUM) \
1545 while (Get##element_type##Count() > 0) Remove##element_type(0); \
1546 for (int32_t i = 0; i < __pb_obj.pb_name##_size(); i++) { \
1547 const element_type##_InternalPB& theInternal = __pb_obj.pb_name(i); \
1548 element_type##PB* pNewWrapper = dynamic_cast<element_type##PB*>( \
1549 Storable::Create(ELEMENT_ENUM, PACK_PROTOCOL_BUFFERS)); \
1550 OT_ASSERT(nullptr != pNewWrapper); \
1551 ::google::protobuf::MessageLite* pMessage = \
1552 pNewWrapper->getPBMessage(); \
1553 OT_ASSERT(nullptr != pMessage); \
1554 element_type##_InternalPB* pInternal = \
1555 dynamic_cast<element_type##_InternalPB*>(pMessage); \
1556 OT_ASSERT(nullptr != pInternal); \
1557 pInternal->CopyFrom(theInternal); \
1558 pNewWrapper->hookAfterUnpack(); \
1559 PointerTo##element_type thePtr( \
1560 dynamic_cast<element_type*>(pNewWrapper)); \
1561 list_##element_type##s.push_back(thePtr); \
1567 OT_IMPLEMENT_PB_LIST_PACK(bitcoin_server, BitcoinServer)
1568 OT_IMPLEMENT_PB_LIST_PACK(bitcoin_acct, BitcoinAcct)
1569 OT_IMPLEMENT_PB_LIST_PACK(ripple_server, RippleServer)
1570 OT_IMPLEMENT_PB_LIST_PACK(loom_server, LoomServer)
1576 OT_IMPLEMENT_PB_LIST_UNPACK(bitcoin_server, BitcoinServer,
1578 OT_IMPLEMENT_PB_LIST_UNPACK(bitcoin_acct, BitcoinAcct,
1580 OT_IMPLEMENT_PB_LIST_UNPACK(ripple_server, RippleServer,
1588 __pb_obj.clear_node();
1593 for (
auto it = the_map.begin(); it != the_map.end(); ++it) {
1594 KeyValue_InternalPB* pNode = __pb_obj.add_node();
1595 pNode->set_key(it->first);
1596 pNode->set_value(it->second);
1607 for (int32_t i = 0; i < __pb_obj.node_size(); i++) {
1608 const KeyValue_InternalPB& theNode = __pb_obj.node(i);
1610 the_map.insert(std::pair<std::string, std::string>(theNode.key(),
1618 __pb_obj.set_value(m_string);
1626 m_string = __pb_obj.value();
1635 if (m_memBuffer.size() > 0)
1636 __pb_obj.set_value(m_memBuffer.data(), m_memBuffer.size());
1641 if (__pb_obj.has_value()) {
1642 std::string strTemp = __pb_obj.value();
1643 m_memBuffer.assign(strTemp.begin(), strTemp.end());
1650 __pb_obj.set_gui_label(gui_label);
1651 __pb_obj.set_contact_id(contact_id);
1652 __pb_obj.set_email(email);
1653 __pb_obj.set_public_key(public_key);
1654 __pb_obj.set_memo(memo);
1656 OT_IMPLEMENT_PB_LIST_PACK(nyms, ContactNym)
1657 OT_IMPLEMENT_PB_LIST_PACK(accounts, ContactAcct)
1661 void ContactPB::hookAfterUnpack()
1663 gui_label = __pb_obj.gui_label();
1664 contact_id = __pb_obj.contact_id();
1665 email = __pb_obj.email();
1666 public_key = __pb_obj.public_key();
1667 memo = __pb_obj.memo();
1674 void ContactNymPB::hookBeforePack()
1676 __pb_obj.set_gui_label(gui_label);
1677 __pb_obj.set_nym_id(nym_id);
1678 __pb_obj.set_nym_type(nym_type);
1679 __pb_obj.set_public_key(public_key);
1680 __pb_obj.set_memo(memo);
1682 OT_IMPLEMENT_PB_LIST_PACK(servers, ServerInfo)
1688 gui_label = __pb_obj.gui_label();
1689 nym_id = __pb_obj.nym_id();
1690 nym_type = __pb_obj.nym_type();
1691 public_key = __pb_obj.public_key();
1692 memo = __pb_obj.memo();
1700 OT_IMPLEMENT_PB_LIST_PACK(contacts, Contact)
1712 __pb_obj.set_gui_label(gui_label);
1713 __pb_obj.set_server_id(server_id);
1714 __pb_obj.set_server_type(server_type);
1715 __pb_obj.set_asset_type_id(asset_type_id);
1716 __pb_obj.set_acct_id(acct_id);
1717 __pb_obj.set_nym_id(nym_id);
1718 __pb_obj.set_memo(memo);
1719 __pb_obj.set_public_key(public_key);
1724 gui_label = __pb_obj.gui_label();
1725 server_id = __pb_obj.server_id();
1726 server_type = __pb_obj.server_type();
1727 asset_type_id = __pb_obj.asset_type_id();
1728 acct_id = __pb_obj.acct_id();
1729 nym_id = __pb_obj.nym_id();
1730 memo = __pb_obj.memo();
1731 public_key = __pb_obj.public_key();
1737 __pb_obj.set_server_id(server_id);
1738 __pb_obj.set_server_type(server_type);
1743 server_id = __pb_obj.server_id();
1744 server_type = __pb_obj.server_type();
1750 __pb_obj.set_gui_label(gui_label);
1751 __pb_obj.set_acct_id(acct_id);
1752 __pb_obj.set_server_id(server_id);
1753 __pb_obj.set_bitcoin_acct_name(bitcoin_acct_name);
1758 gui_label = __pb_obj.gui_label();
1759 acct_id = __pb_obj.acct_id();
1760 server_id = __pb_obj.server_id();
1761 bitcoin_acct_name = __pb_obj.bitcoin_acct_name();
1767 __pb_obj.set_gui_label(gui_label);
1768 __pb_obj.set_server_id(server_id);
1769 __pb_obj.set_server_type(server_type);
1770 __pb_obj.set_server_host(server_host);
1771 __pb_obj.set_server_port(server_port);
1772 __pb_obj.set_bitcoin_username(bitcoin_username);
1773 __pb_obj.set_bitcoin_password(bitcoin_password);
1778 gui_label = __pb_obj.gui_label();
1779 server_id = __pb_obj.server_id();
1780 server_type = __pb_obj.server_type();
1781 server_host = __pb_obj.server_host();
1782 server_port = __pb_obj.server_port();
1783 bitcoin_username = __pb_obj.bitcoin_username();
1784 bitcoin_password = __pb_obj.bitcoin_password();
1790 __pb_obj.set_gui_label(gui_label);
1791 __pb_obj.set_server_id(server_id);
1792 __pb_obj.set_server_type(server_type);
1793 __pb_obj.set_server_host(server_host);
1794 __pb_obj.set_server_port(server_port);
1795 __pb_obj.set_ripple_username(ripple_username);
1796 __pb_obj.set_ripple_password(ripple_password);
1797 __pb_obj.set_namefield_id(namefield_id);
1798 __pb_obj.set_passfield_id(passfield_id);
1803 gui_label = __pb_obj.gui_label();
1804 server_id = __pb_obj.server_id();
1805 server_type = __pb_obj.server_type();
1806 server_host = __pb_obj.server_host();
1807 server_port = __pb_obj.server_port();
1808 ripple_username = __pb_obj.ripple_username();
1809 ripple_password = __pb_obj.ripple_password();
1810 namefield_id = __pb_obj.namefield_id();
1811 passfield_id = __pb_obj.passfield_id();
1817 __pb_obj.set_gui_label(gui_label);
1818 __pb_obj.set_server_id(server_id);
1819 __pb_obj.set_server_type(server_type);
1820 __pb_obj.set_server_host(server_host);
1821 __pb_obj.set_server_port(server_port);
1822 __pb_obj.set_loom_username(loom_username);
1823 __pb_obj.set_namefield_id(namefield_id);
1828 gui_label = __pb_obj.gui_label();
1829 server_id = __pb_obj.server_id();
1830 server_type = __pb_obj.server_type();
1831 server_host = __pb_obj.server_host();
1832 server_port = __pb_obj.server_port();
1833 loom_username = __pb_obj.loom_username();
1834 namefield_id = __pb_obj.namefield_id();
1840 __pb_obj.set_gui_label(gui_label);
1841 __pb_obj.set_server_id(server_id);
1842 __pb_obj.set_market_id(market_id);
1843 __pb_obj.set_asset_type_id(asset_type_id);
1844 __pb_obj.set_currency_type_id(currency_type_id);
1845 __pb_obj.set_scale(scale);
1846 __pb_obj.set_total_assets(total_assets);
1847 __pb_obj.set_number_bids(number_bids);
1848 __pb_obj.set_number_asks(number_asks);
1849 __pb_obj.set_last_sale_price(last_sale_price);
1850 __pb_obj.set_last_sale_date(last_sale_date);
1851 __pb_obj.set_current_bid(current_bid);
1852 __pb_obj.set_current_ask(current_ask);
1853 __pb_obj.set_volume_trades(volume_trades);
1854 __pb_obj.set_volume_assets(volume_assets);
1855 __pb_obj.set_volume_currency(volume_currency);
1856 __pb_obj.set_recent_highest_bid(recent_highest_bid);
1857 __pb_obj.set_recent_lowest_ask(recent_lowest_ask);
1863 gui_label = __pb_obj.gui_label();
1864 server_id = __pb_obj.server_id();
1865 market_id = __pb_obj.market_id();
1866 asset_type_id = __pb_obj.asset_type_id();
1867 currency_type_id = __pb_obj.currency_type_id();
1868 scale = __pb_obj.scale();
1869 total_assets = __pb_obj.total_assets();
1870 number_bids = __pb_obj.number_bids();
1871 number_asks = __pb_obj.number_asks();
1872 last_sale_price = __pb_obj.last_sale_price();
1873 last_sale_date = __pb_obj.last_sale_date();
1874 current_bid = __pb_obj.current_bid();
1875 current_ask = __pb_obj.current_ask();
1876 volume_trades = __pb_obj.volume_trades();
1877 volume_assets = __pb_obj.volume_assets();
1878 volume_currency = __pb_obj.volume_currency();
1879 recent_highest_bid = __pb_obj.recent_highest_bid();
1880 recent_lowest_ask = __pb_obj.recent_lowest_ask();
1886 OT_IMPLEMENT_PB_LIST_PACK(market_data, MarketData)
1898 __pb_obj.set_gui_label(gui_label);
1899 __pb_obj.set_transaction_id(transaction_id);
1900 __pb_obj.set_price_per_scale(price_per_scale);
1901 __pb_obj.set_available_assets(available_assets);
1902 __pb_obj.set_minimum_increment(minimum_increment);
1903 __pb_obj.set_date(date);
1909 gui_label = __pb_obj.gui_label();
1910 transaction_id = __pb_obj.transaction_id();
1911 price_per_scale = __pb_obj.price_per_scale();
1912 available_assets = __pb_obj.available_assets();
1913 minimum_increment = __pb_obj.minimum_increment();
1914 date = __pb_obj.date();
1920 __pb_obj.set_gui_label(gui_label);
1921 __pb_obj.set_transaction_id(transaction_id);
1922 __pb_obj.set_price_per_scale(price_per_scale);
1923 __pb_obj.set_available_assets(available_assets);
1924 __pb_obj.set_minimum_increment(minimum_increment);
1925 __pb_obj.set_date(date);
1931 gui_label = __pb_obj.gui_label();
1932 transaction_id = __pb_obj.transaction_id();
1933 price_per_scale = __pb_obj.price_per_scale();
1934 available_assets = __pb_obj.available_assets();
1935 minimum_increment = __pb_obj.minimum_increment();
1936 date = __pb_obj.date();
1942 OT_IMPLEMENT_PB_LIST_PACK(bids, BidData)
1943 OT_IMPLEMENT_PB_LIST_PACK(asks, AskData)
1947 void OfferListMarketPB::hookAfterUnpack()
1954 void TradeDataMarketPB::hookBeforePack()
1956 __pb_obj.set_gui_label(gui_label);
1957 __pb_obj.set_transaction_id(transaction_id);
1958 __pb_obj.set_date(date);
1959 __pb_obj.set_price(price);
1960 __pb_obj.set_amount_sold(amount_sold);
1966 gui_label = __pb_obj.gui_label();
1967 transaction_id = __pb_obj.transaction_id();
1968 date = __pb_obj.date();
1969 price = __pb_obj.price();
1970 amount_sold = __pb_obj.amount_sold();
1976 OT_IMPLEMENT_PB_LIST_PACK(trades, TradeDataMarket)
1982 OT_IMPLEMENT_PB_LIST_UNPACK(trades, TradeDataMarket,
1989 __pb_obj.set_gui_label(gui_label);
1990 __pb_obj.set_valid_from(valid_from);
1991 __pb_obj.set_valid_to(valid_to);
1992 __pb_obj.set_server_id(server_id);
1993 __pb_obj.set_asset_type_id(asset_type_id);
1994 __pb_obj.set_asset_acct_id(asset_acct_id);
1995 __pb_obj.set_currency_type_id(currency_type_id);
1996 __pb_obj.set_currency_acct_id(currency_acct_id);
1997 __pb_obj.set_selling(selling);
1998 __pb_obj.set_scale(scale);
1999 __pb_obj.set_price_per_scale(price_per_scale);
2000 __pb_obj.set_transaction_id(transaction_id);
2001 __pb_obj.set_total_assets(total_assets);
2002 __pb_obj.set_finished_so_far(finished_so_far);
2003 __pb_obj.set_minimum_increment(minimum_increment);
2004 __pb_obj.set_stop_sign(stop_sign);
2005 __pb_obj.set_stop_price(stop_price);
2006 __pb_obj.set_date(date);
2012 gui_label = __pb_obj.gui_label();
2013 valid_from = __pb_obj.valid_from();
2014 valid_to = __pb_obj.valid_to();
2015 server_id = __pb_obj.server_id();
2016 asset_type_id = __pb_obj.asset_type_id();
2017 asset_acct_id = __pb_obj.asset_acct_id();
2018 currency_type_id = __pb_obj.currency_type_id();
2019 currency_acct_id = __pb_obj.currency_acct_id();
2020 selling = __pb_obj.selling();
2021 scale = __pb_obj.scale();
2022 price_per_scale = __pb_obj.price_per_scale();
2023 transaction_id = __pb_obj.transaction_id();
2024 total_assets = __pb_obj.total_assets();
2025 finished_so_far = __pb_obj.finished_so_far();
2026 minimum_increment = __pb_obj.minimum_increment();
2027 stop_sign = __pb_obj.stop_sign();
2028 stop_price = __pb_obj.stop_price();
2029 date = __pb_obj.date();
2035 OT_IMPLEMENT_PB_LIST_PACK(offers, OfferDataNym)
2047 __pb_obj.set_gui_label(gui_label);
2048 __pb_obj.set_transaction_id(transaction_id);
2049 __pb_obj.set_completed_count(completed_count);
2050 __pb_obj.set_date(date);
2051 __pb_obj.set_price(price);
2052 __pb_obj.set_amount_sold(amount_sold);
2053 __pb_obj.set_updated_id(updated_id);
2054 __pb_obj.set_offer_price(offer_price);
2055 __pb_obj.set_finished_so_far(finished_so_far);
2056 __pb_obj.set_asset_id(asset_id);
2057 __pb_obj.set_currency_id(currency_id);
2058 __pb_obj.set_currency_paid(currency_paid);
2064 gui_label = __pb_obj.gui_label();
2065 transaction_id = __pb_obj.transaction_id();
2066 completed_count = __pb_obj.completed_count();
2067 date = __pb_obj.date();
2068 price = __pb_obj.price();
2069 amount_sold = __pb_obj.amount_sold();
2070 updated_id = __pb_obj.updated_id();
2071 offer_price = __pb_obj.offer_price();
2072 finished_so_far = __pb_obj.finished_so_far();
2073 asset_id = __pb_obj.asset_id();
2074 currency_id = __pb_obj.currency_id();
2075 currency_paid = __pb_obj.currency_paid();
2081 OT_IMPLEMENT_PB_LIST_PACK(trades, TradeDataNym)
2090 #endif // defined (OTDB_PROTOCOL_BUFFERS)
2112 if (
nullptr == m_pPacker) {
2132 if (
nullptr == pPacker) {
2133 otErr <<
"OTDB::Storage::CreateObject: Failed, since GetPacker() "
2134 "returned nullptr.\n";
2149 switch (eStorageType) {
2158 otErr <<
"OTDB::Storage::Create: Failed: Unknown storage type.\n";
2166 if (
nullptr != pStore) {
2169 if (
nullptr == pPacker) {
2170 otErr <<
"OTDB::Storage::Create: Failed while creating packer.\n";
2182 otErr <<
"OTDB::Storage::Create: Failed, since pStore is nullptr.\n";
2204 std::string oneStr, std::string twoStr,
2205 std::string threeStr)
2207 OTString ot_strFolder(strFolder), ot_oneStr(oneStr), ot_twoStr(twoStr),
2208 ot_threeStr(threeStr);
2210 "Storage::StoreString: strFolder is null");
2212 if (!ot_oneStr.Exists()) {
2214 "Storage::StoreString: bad options");
2221 if (
nullptr == pPacker)
return false;
2225 if (
nullptr == pBuffer)
return false;
2238 std::string twoStr, std::string threeStr)
2240 std::string theString(
"");
2244 if (
nullptr == pPacker)
return theString;
2248 if (
nullptr == pBuffer)
return theString;
2264 bool bUnpacked = pPacker->
Unpack(*pBuffer, theString);
2284 std::string oneStr, std::string twoStr,
2285 std::string threeStr)
2291 std::string twoStr, std::string threeStr)
2293 std::string theString(
"");
2302 std::string oneStr, std::string twoStr,
2303 std::string threeStr)
2307 if (
nullptr == pPacker) {
2308 otErr <<
"No packer allocated in Storage::StoreObject\n";
2314 if (
nullptr == pBuffer) {
2315 otErr <<
"Packing failed in Storage::StoreObject\n";
2323 otErr <<
"Storing failed in Storage::StoreObject (calling "
2324 "onStorePackedBuffer) \n";
2337 std::string strFolder, std::string oneStr,
2338 std::string twoStr, std::string threeStr)
2342 if (
nullptr == pPacker)
return nullptr;
2346 if (
nullptr == pBuffer)
return nullptr;
2352 if (
nullptr == pStorable) {
2372 bool bUnpacked = pPacker->
Unpack(*pBuffer, *pStorable);
2391 std::string strReturnValue(
"");
2395 if (
nullptr == pPacker) {
2396 otErr <<
"Storage::EncodeObject: No packer allocated.\n";
2397 return strReturnValue;
2402 if (
nullptr == pBuffer) {
2403 otErr <<
"Storage::EncodeObject: Packing failed.\n";
2404 return strReturnValue;
2411 const uint32_t nNewSize =
static_cast<const uint32_t
>(pBuffer->
GetSize());
2412 const void* pNewData =
static_cast<const void*
>(pBuffer->
GetData());
2414 if ((nNewSize < 1) || (
nullptr == pNewData)) {
2418 otErr <<
"Storage::EncodeObject: Packing failed (2).\n";
2419 return strReturnValue;
2422 const OTData theData(pNewData, nNewSize);
2425 strReturnValue.assign(theArmor.
Get(), theArmor.
GetLength());
2430 return strReturnValue;
2436 std::string strInput)
2438 if (strInput.size() < 1)
return nullptr;
2442 if (
nullptr == pPacker)
return nullptr;
2446 if (
nullptr == pBuffer)
return nullptr;
2452 if (
nullptr == pStorable) {
2460 theArmor.
Set(strInput.c_str(),
static_cast<uint32_t
>(strInput.size()));
2471 const bool bUnpacked = pPacker->
Unpack(*pBuffer, *pStorable);
2489 std::string twoStr, std::string threeStr)
2494 otErr <<
"Storage::EraseValueByKey: Failed trying to erase a value "
2495 "(while calling onEraseValueByKey) \n";
2518 bool bConfirmOrCreateSuccess =
false, bFolderAlreadyExist =
false;
2519 OTString strFolderName(szFolderName);
2521 bFolderAlreadyExist)) {
2524 return bConfirmOrCreateSuccess;
2553 std::string strFolder,
2556 std::string threeStr)
2558 return ConstructAndConfirmPathImp(
true, strOutput, strFolder, oneStr,
2563 std::string strFolder,
2566 std::string threeStr)
2568 return ConstructAndConfirmPathImp(
false, strOutput, strFolder, oneStr,
2572 int64_t StorageFS::ConstructAndConfirmPathImp(
2573 bool bMakePath, std::string& strOutput, std::string zeroStr,
2574 std::string oneStr, std::string twoStr, std::string threeStr)
2576 const std::string strRoot(m_strDataPath.c_str());
2578 const std::string strZero(3 > zeroStr.length() ?
"" : zeroStr);
2579 const std::string strOne(3 > oneStr.length() ?
"" : oneStr);
2580 const std::string strTwo(3 > twoStr.length() ?
"" : twoStr);
2581 const std::string strThree(3 > threeStr.length() ?
"" : threeStr);
2584 if (strZero.empty() && (0 != zeroStr.compare(
"."))) {
2585 otErr << __FUNCTION__ <<
": Empty: "
2587 <<
" is too short (and not \".\").!\n"
2588 "zeroStr was: \"" << zeroStr <<
"\"\n";
2593 if (strOne.empty()) {
2594 otErr << __FUNCTION__ <<
": Empty: "
2601 if (strTwo.empty() && !strThree.empty()) {
2602 otErr << __FUNCTION__ <<
": Error: strThree passed in: " << strThree
2603 <<
" while strTwo is empty!\n";
2607 const bool bHaveZero = !strZero.empty();
2608 const bool bOneIsLast = strTwo.empty();
2609 const bool bTwoIsLast = !bOneIsLast && strThree.empty();
2610 const bool bThreeIsLast = !bOneIsLast && !bTwoIsLast;
2613 std::string strBufFolder(
"");
2614 std::string strBufPath(
"");
2619 strBufFolder += strRoot;
2623 strBufFolder += strZero;
2624 strBufFolder +=
"/";
2629 strBufPath = strBufFolder;
2630 strBufPath += strOne;
2634 strBufFolder += strOne;
2635 strBufFolder +=
"/";
2639 strBufPath = strBufFolder;
2640 strBufPath += strTwo;
2644 strBufFolder += strTwo;
2645 strBufFolder +=
"/";
2649 strBufPath = strBufFolder;
2650 strBufPath += threeStr;
2659 const std::string strFolder(strBufFolder);
2660 const std::string strPath(strBufPath);
2661 strOutput = strPath;
2664 bool bFolderCreated =
false;
2671 if (bMakePath && !bFolderExists) {
2672 otErr << __FUNCTION__ <<
": Error: was told to make path, however "
2673 "cannot confirm the path!\n";
2676 if (!bMakePath && !bFolderExists) {
2678 <<
": Debug: Cannot find Folder: " << strFolder <<
" \n";
2683 int64_t lFileLength = 0;
2684 const bool bFileExists =
2697 std::string strFolder, std::string oneStr,
2698 std::string twoStr, std::string threeStr)
2700 std::string strOutput;
2704 otErr << __FUNCTION__ <<
": Error writing to " << strOutput <<
".\n";
2714 std::ofstream ofs(strOutput.c_str(), std::ios::out | std::ios::binary);
2717 otErr << __FUNCTION__ <<
": Error opening file: " << strOutput <<
"\n";
2731 std::string strFolder, std::string oneStr,
2732 std::string twoStr, std::string threeStr)
2734 std::string strOutput;
2740 otErr <<
"StorageFS::" << __FUNCTION__ <<
": Error with " << strOutput
2744 else if (0 == lRet) {
2745 otErr <<
"StorageFS::" << __FUNCTION__ <<
": Failure reading from "
2746 << strOutput <<
": file does not exist.\n";
2752 std::ifstream fin(strOutput.c_str(), std::ios::in | std::ios::binary);
2754 if (!fin.is_open()) {
2755 otErr << __FUNCTION__ <<
": Error opening file: " << strOutput <<
"\n";
2769 std::string strFolder, std::string oneStr,
2770 std::string twoStr, std::string threeStr)
2772 std::string strOutput;
2776 otErr <<
"StorageFS::" << __FUNCTION__ <<
": Error writing to "
2777 << strOutput <<
".\n";
2793 std::ofstream ofs(strOutput.c_str(), std::ios::out | std::ios::binary);
2796 otErr << __FUNCTION__ <<
": Error opening file: " << strOutput <<
"\n";
2802 bool bSuccess = ofs.good();
2811 std::string strFolder, std::string oneStr,
2812 std::string twoStr, std::string threeStr)
2814 std::string strOutput;
2820 otErr <<
"StorageFS::" << __FUNCTION__ <<
": Error with " << strOutput
2824 else if (0 == lRet) {
2825 otErr <<
"StorageFS::" << __FUNCTION__ <<
": Failure reading from "
2826 << strOutput <<
": file does not exist.\n";
2832 std::ifstream fin(strOutput.c_str(), std::ios::in | std::ios::binary);
2834 if (!fin.is_open()) {
2835 otErr << __FUNCTION__ <<
": Error opening file: " << strOutput <<
"\n";
2841 std::stringstream buffer;
2842 buffer << fin.rdbuf();
2844 bool bSuccess = fin.good();
2847 theBuffer = buffer.str();
2853 bSuccess = (theBuffer.length() > 0);
2863 std::string twoStr, std::string threeStr)
2865 std::string strOutput;
2869 otErr <<
"Error: " << __FUNCTION__
2870 <<
": Failed calling ConstructAndConfirmPath with:\n"
2871 "strOutput: " << strOutput <<
" | strFolder: " << strFolder
2872 <<
" | oneStr: " << oneStr <<
" | twoStr: " << twoStr
2873 <<
" | threeStr: " << threeStr <<
" \n";
2890 std::ofstream ofs(strOutput.c_str(), std::ios::out | std::ios::binary);
2893 otErr <<
"Error opening file in StorageFS::onEraseValueByKey: "
2894 << strOutput <<
"\n";
2899 ofs <<
"(This space intentionally left blank.)\n";
2900 bool bSuccess = ofs.good() ?
true :
false;
2907 if (
remove(strOutput.c_str()) != 0) {
2909 otErr <<
"** Failed trying to delete file: " << strOutput <<
" \n";
2913 otInfo <<
"** Success deleting file: " << strOutput <<
" \n";
2928 m_strDataPath = strDataPath.
Get();
2938 std::string twoStr, std::string threeStr)
2940 std::string strOutput;
2949 std::string oneStr, std::string twoStr,
2950 std::string threeStr)
static EXPORT bool FileExists(const OTString &strFilePath, int64_t &nFileLength)
EXPORT bool StorePlainString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT Storage * GetDefaultStorage()
Storable *( InstantiateFunc)()
EXPORT Storable * CreateObject(StoredObjectType eType)
std::map< InstantiateFuncKey, InstantiateFunc * > mapOfFunctions
EXPORT bool Unpack(PackedBuffer &inBuf, Storable &outObj)
static StorageFS * Instantiate()
virtual void hookAfterUnpack()
EXPORT std::string QueryString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT std::string EncodeObject(Storable &theContents)
void SetPacker(OTPacker &thePacker)
virtual bool onStorePackedBuffer(PackedBuffer &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
PackedBuffer * Pack(Storable &inObj)
EXPORT bool StorePlainString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool StoreString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
InitOTDBDetails theOTDBConstructor
virtual bool PackString(std::string &theString)=0
virtual bool ReadFromIStream(std::istream &inStream, int64_t lFilesize)=0
IMPLEMENT_GET_ADD_REMOVE(WalletData::, BitcoinServer) IMPLEMENT_GET_ADD_REMOVE(WalletData
virtual int64_t FormPathString(std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT std::string QueryString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool InitDefaultStorage(StorageType eStoreType, PackType ePackType)
virtual void hookBeforePack()
OTLOG_IMPORT OTLogStream otOut
virtual bool onEraseValueByKey(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
static EXPORT Storage * Create(StorageType eStorageType, PackType ePackType)
EXPORT bool CheckStringsExistInOrder(std::string &strFolder, std::string &oneStr, std::string &twoStr, std::string &threeStr, const char *szFuncName=nullptr)
static EXPORT bool BuildFolderPath(const OTString &strFolderPath, bool &out_bFolderCreated)
EXPORT uint32_t GetLength() const
virtual bool onQueryPlainString(std::string &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
bool ConfirmOrCreateFolder(const char *szFolderName, struct stat *pst=nullptr)
EXPORT Storable * QueryObject(StoredObjectType theObjectType, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool Exists() const
EXPORT std::string EncodeObject(Storable &theContents)
EXPORT Storable * DecodeObject(StoredObjectType theObjectType, std::string strInput)
virtual bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
EXPORT Storable * CreateObject(StoredObjectType eType)
virtual bool onQueryPlainString(std::string &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
virtual bool onQueryPackedBuffer(PackedBuffer &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
std::pair< PackType, StoredObjectType > InstantiateFuncKey
virtual void SetData(const uint8_t *pData, size_t theSize)=0
virtual bool WriteToOStream(std::ostream &outStream)=0
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
EXPORT Storage * CreateStorageContext(StorageType eStoreType, PackType ePackType=OTDB_DEFAULT_PACKER)
const char * StoredObjectTypeStrings[]
EXPORT std::string QueryPlainString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
virtual bool onQueryPackedBuffer(PackedBuffer &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
int64_t ConstructAndConfirmPath(std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
static OTPacker * Create(PackType ePackType)
virtual bool onStorePlainString(std::string &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
OTDB::Storage * s_pStorage
EXPORT std::string QueryPlainString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool EraseValueByKey(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
#define OT_ASSERT_MSG(x, s)
virtual bool UnpackString(std::string &theString)=0
OTLOG_IMPORT OTLogStream otInfo
virtual bool onStorePackedBuffer(PackedBuffer &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
EXPORT StorageType GetType() const
EXPORT bool StoreString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
virtual size_t GetSize()=0
bool ConfirmFile(const char *szFileName, struct stat *pst=nullptr)
static EXPORT bool ConfirmCreateFolder(const OTString &strExactPath, bool &out_Exists, bool &out_IsNew)
OTLOG_IMPORT OTLogStream otWarn
EXPORT const char * Get() const
EXPORT bool EraseValueByKey(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT const void * GetPayloadPointer() const
OTLOG_IMPORT OTLogStream otErr
EXPORT OTPacker * GetPacker(PackType ePackType=OTDB_DEFAULT_PACKER)
OTDB::mapOfFunctions * pFunctionMap
virtual PackedBuffer * CreateBuffer()=0
EXPORT Storable * QueryObject(StoredObjectType theObjectType, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
virtual int64_t FormPathString(std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")=0
EXPORT int64_t FormPathString(std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
static EXPORT Storable * Create(StoredObjectType eType, PackType thePackType)
EXPORT Storable * DecodeObject(StoredObjectType theObjectType, std::string strInput)
virtual const uint8_t * GetData()=0
virtual bool onEraseValueByKey(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool StoreObject(Storable &theContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
static EXPORT bool AppendFile(OTString &out_strPath, const OTString &strBasePath, const OTString &strFileName)
virtual bool onUnpack(PackedBuffer &theBuffer, Storable &outObj)=0
static EXPORT bool PathExists(const OTString &strPath)
static EXPORT OTString Get()
virtual bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
int64_t ConstructAndCreatePath(std::string &strOutput, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
virtual bool onStorePlainString(std::string &theBuffer, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT bool StoreObject(Storable &theContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")