bool OTFolders::GetSetAll() { std::unique_ptr<api::Settings> config{ Factory::Settings(OTPaths::GlobalConfigFile())}; config->Reset(); if (!config->Load()) return false; if (!GetSetFolderName(*config, KEY_ACCOUNT, DEFAULT_ACCOUNT, s_strAccount)) return false; if (!GetSetFolderName(*config, KEY_CERT, DEFAULT_CERT, s_strCert)) return false; if (!GetSetFolderName(*config, KEY_COMMON, DEFAULT_COMMON, s_strCommon)) return false; if (!GetSetFolderName( *config, KEY_CONTRACT, DEFAULT_CONTRACT, s_strContract)) return false; if (!GetSetFolderName(*config, KEY_CRON, DEFAULT_CRON, s_strCron)) return false; if (!GetSetFolderName(*config, KEY_INBOX, DEFAULT_INBOX, s_strInbox)) return false; if (!GetSetFolderName(*config, KEY_MARKET, DEFAULT_MARKET, s_strMarket)) return false; if (!GetSetFolderName(*config, KEY_MINT, DEFAULT_MINT, s_strMint)) return false; if (!GetSetFolderName(*config, KEY_NYM, DEFAULT_NYM, s_strNym)) return false; if (!GetSetFolderName(*config, KEY_NYMBOX, DEFAULT_NYMBOX, s_strNymbox)) return false; if (!GetSetFolderName(*config, KEY_OUTBOX, DEFAULT_OUTBOX, s_strOutbox)) return false; if (!GetSetFolderName( *config, KEY_PAYMENTINBOX, DEFAULT_PAYMENTINBOX, s_strPaymentInbox)) return false; if (!GetSetFolderName(*config, KEY_PURSE, DEFAULT_PURSE, s_strPurse)) return false; if (!GetSetFolderName(*config, KEY_RECEIPT, DEFAULT_RECEIPT, s_strReceipt)) return false; if (!GetSetFolderName( *config, KEY_RECORDBOX, DEFAULT_RECORDBOX, s_strRecordBox)) return false; if (!GetSetFolderName( *config, KEY_EXPIREDBOX, DEFAULT_EXPIREDBOX, s_strExpiredBox)) return false; if (!GetSetFolderName(*config, KEY_SPENT, DEFAULT_SPENT, s_strSpent)) return false; if (!GetSetFolderName( *config, KEY_USERACCT, DEFAULT_USERACCT, s_strUserAcct)) return false; if (!config->Save()) return false; config->Reset(); return true; }
const bool OTFolders::GetSetAll() { OTSettings * pConfig(new OTSettings(OTPaths::GlobalConfigFile())); pConfig->Reset(); if(!pConfig->Load()) return false; if(!GetSetFolderName(pConfig,KEY_ACCOUNT, DEFAULT_ACCOUNT, m_strAccount )) return false; if(!GetSetFolderName(pConfig,KEY_CERT, DEFAULT_CERT, m_strCert )) return false; if(!GetSetFolderName(pConfig,KEY_CONTRACT, DEFAULT_CONTRACT, m_strContract )) return false; if(!GetSetFolderName(pConfig,KEY_CREDENTIAL, DEFAULT_CREDENTIAL, m_strCredential )) return false; if(!GetSetFolderName(pConfig,KEY_CRON, DEFAULT_CRON, m_strCron )) return false; if(!GetSetFolderName(pConfig,KEY_INBOX, DEFAULT_INBOX, m_strInbox )) return false; if(!GetSetFolderName(pConfig,KEY_MARKET, DEFAULT_MARKET, m_strMarket )) return false; if(!GetSetFolderName(pConfig,KEY_MINT, DEFAULT_MINT, m_strMint )) return false; if(!GetSetFolderName(pConfig,KEY_NYM, DEFAULT_NYM, m_strNym )) return false; if(!GetSetFolderName(pConfig,KEY_NYMBOX, DEFAULT_NYMBOX, m_strNymbox )) return false; if(!GetSetFolderName(pConfig,KEY_OUTBOX, DEFAULT_OUTBOX, m_strOutbox )) return false; if(!GetSetFolderName(pConfig,KEY_PAYMENTINBOX, DEFAULT_PAYMENTINBOX, m_strPaymentInbox )) return false; if(!GetSetFolderName(pConfig,KEY_PUBCRED, DEFAULT_PUBCRED, m_strPubcred )) return false; if(!GetSetFolderName(pConfig,KEY_PUBKEY, DEFAULT_PUBKEY, m_strPubkey )) return false; if(!GetSetFolderName(pConfig,KEY_PURSE, DEFAULT_PURSE, m_strPurse )) return false; if(!GetSetFolderName(pConfig,KEY_RECEIPT, DEFAULT_RECEIPT, m_strReceipt )) return false; if(!GetSetFolderName(pConfig,KEY_RECORDBOX, DEFAULT_RECORDBOX, m_strRecordBox )) return false; if(!GetSetFolderName(pConfig,KEY_SCRIPT, DEFAULT_SCRIPT, m_strScript )) return false; if(!GetSetFolderName(pConfig,KEY_SMARTCONTRACTS,DEFAULT_SMARTCONTRACTS, m_strSmartContracts )) return false; if(!GetSetFolderName(pConfig,KEY_SPENT, DEFAULT_SPENT, m_strSpent )) return false; if(!GetSetFolderName(pConfig,KEY_USERACCT, DEFAULT_USERACCT, m_strUserAcct )) return false; if(!pConfig->Save()) return false; pConfig->Reset(); return true; }
bool OTFolders::GetSetAll() { Settings config(OTPaths::GlobalConfigFile()); config.Reset(); if (!config.Load()) return false; if (!GetSetFolderName(config, KEY_ACCOUNT, DEFAULT_ACCOUNT, s_strAccount)) return false; if (!GetSetFolderName(config, KEY_CERT, DEFAULT_CERT, s_strCert)) return false; if (!GetSetFolderName(config, KEY_COMMON, DEFAULT_COMMON, s_strCommon)) return false; if (!GetSetFolderName(config, KEY_CONTRACT, DEFAULT_CONTRACT, s_strContract)) return false; if (!GetSetFolderName(config, KEY_CRON, DEFAULT_CRON, s_strCron)) return false; if (!GetSetFolderName(config, KEY_INBOX, DEFAULT_INBOX, s_strInbox)) return false; if (!GetSetFolderName(config, KEY_MARKET, DEFAULT_MARKET, s_strMarket)) return false; if (!GetSetFolderName(config, KEY_MINT, DEFAULT_MINT, s_strMint)) return false; if (!GetSetFolderName(config, KEY_NYM, DEFAULT_NYM, s_strNym)) return false; if (!GetSetFolderName(config, KEY_NYMBOX, DEFAULT_NYMBOX, s_strNymbox)) return false; if (!GetSetFolderName(config, KEY_OUTBOX, DEFAULT_OUTBOX, s_strOutbox)) return false; if (!GetSetFolderName(config, KEY_PAYMENTINBOX, DEFAULT_PAYMENTINBOX, s_strPaymentInbox)) return false; if (!GetSetFolderName(config, KEY_PURSE, DEFAULT_PURSE, s_strPurse)) return false; if (!GetSetFolderName(config, KEY_RECEIPT, DEFAULT_RECEIPT, s_strReceipt)) return false; if (!GetSetFolderName(config, KEY_RECORDBOX, DEFAULT_RECORDBOX, s_strRecordBox)) return false; if (!GetSetFolderName(config, KEY_EXPIREDBOX, DEFAULT_EXPIREDBOX, s_strExpiredBox)) return false; if (!GetSetFolderName(config, KEY_SCRIPT, DEFAULT_SCRIPT, s_strScript)) return false; if (!GetSetFolderName(config, KEY_SMARTCONTRACTS, DEFAULT_SMARTCONTRACTS, s_strSmartContracts)) return false; if (!GetSetFolderName(config, KEY_SPENT, DEFAULT_SPENT, s_strSpent)) return false; if (!GetSetFolderName(config, KEY_USERACCT, DEFAULT_USERACCT, s_strUserAcct)) return false; if (!config.Save()) return false; config.Reset(); return true; }