这篇教程C++ ABC_CHECK函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ABC_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ ABC_CHECK函数的具体用法?C++ ABC_CHECK怎么用?C++ ABC_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ABC_CHECK函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: loginServerUpdatePinPackageStatusloginServerUpdatePinPackage(const Login &login, DataSlice DID, DataSlice LPIN1, const std::string &pinPackage, time_t ali){ const auto url = ABC_SERVER_ROOT "/account/pinpackage/update"; // format the ali char szALI[DATETIME_LENGTH]; strftime(szALI, DATETIME_LENGTH, "%Y-%m-%dT%H:%M:%S", gmtime(&ali)); // Encode those: JsonPtr json(json_pack("{ss, ss, ss, ss, ss, ss}", ABC_SERVER_JSON_L1_FIELD, base64Encode(login.lobby.authId()).c_str(), ABC_SERVER_JSON_LP1_FIELD, base64Encode(login.authKey()).c_str(), ABC_SERVER_JSON_DID_FIELD, base64Encode(DID).c_str(), ABC_SERVER_JSON_LPIN1_FIELD, base64Encode(LPIN1).c_str(), JSON_ACCT_PIN_PACKAGE, pinPackage.c_str(), ABC_SERVER_JSON_ALI_FIELD, szALI)); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply.body)); ABC_CHECK(replyJson.ok()); return Status();}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:28,
示例2: ABC_CHECKStatusServerRequestJson::setup(const Login &login){ ABC_CHECK(setup(login.store)); ABC_CHECK(passwordAuthSet(base64Encode(login.passwordAuth()))); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:7,
示例3: ABC_CHECKStatusServerRequestJson::setup(const Login &login){ ABC_CHECK(setup(login.lobby)); ABC_CHECK(authKeySet(base64Encode(login.authKey()))); return Status();}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:7,
示例4: ABC_CHECKStatusJsonBox::decrypt(DataChunk &result, DataSlice key){ DataChunk nonce; ABC_CHECK(nonceOk()); ABC_CHECK(base16Decode(nonce, this->nonce())); DataChunk cyphertext; ABC_CHECK(cyphertextOk()); ABC_CHECK(base64Decode(cyphertext, this->cyphertext())); switch (type()) { case AES256_CBC_AIRBITZ: { ABC_CHECK_OLD(ABC_CryptoDecryptAES256Package(result, cyphertext, key, nonce, &error)); return Status(); } default: return ABC_ERROR(ABC_CC_DecryptError, "Unknown encryption type"); }}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:25,
示例5: loginServerGetPinPackageStatusloginServerGetPinPackage(DataSlice DID, DataSlice LPIN1, std::string &result, AuthError &authError){ const auto url = ABC_SERVER_ROOT "/v1/account/pinpackage/get"; ServerRequestJson json; ABC_CHECK(json.set(ABC_SERVER_JSON_DID_FIELD, base64Encode(DID))); ABC_CHECK(json.set(ABC_SERVER_JSON_LPIN1_FIELD, base64Encode(LPIN1))); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply, &authError)); struct ResultJson: public JsonObject { ABC_JSON_CONSTRUCTORS(ResultJson, JsonObject) ABC_JSON_STRING(package, "pin_package", nullptr) } resultJson(replyJson.results()); ABC_CHECK(resultJson.packageOk()); result = resultJson.package(); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:25,
示例6: loginServerChangePasswordStatusloginServerChangePassword(const Login &login, DataSlice newLP1, DataSlice newLRA1, const CarePackage &carePackage, const LoginPackage &loginPackage){ const auto url = ABC_SERVER_ROOT "/account/password/update"; JsonPtr json(json_pack("{ss, ss, ss, ss, ss}", ABC_SERVER_JSON_L1_FIELD, base64Encode(login.lobby.authId()).c_str(), ABC_SERVER_JSON_LP1_FIELD, base64Encode(login.authKey()).c_str(), ABC_SERVER_JSON_NEW_LP1_FIELD, base64Encode(newLP1).c_str(), ABC_SERVER_JSON_CARE_PACKAGE_FIELD, carePackage.encode().c_str(), ABC_SERVER_JSON_LOGIN_PACKAGE_FIELD, loginPackage.encode().c_str())); if (newLRA1.size()) { json_object_set_new(json.get(), ABC_SERVER_JSON_NEW_LRA1_FIELD, json_string(base64Encode(newLRA1).c_str())); } HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply.body)); ABC_CHECK(replyJson.ok()); return Status();}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:26,
示例7: loginServerOtpStatusStatusloginServerOtpStatus(const Login &login, bool &on, long &timeout){ const auto url = ABC_SERVER_ROOT "/v1/otp/status"; ServerRequestJson json; ABC_CHECK(json.setup(login)); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); struct ResultJson: public JsonObject { ABC_JSON_CONSTRUCTORS(ResultJson, JsonObject) ABC_JSON_BOOLEAN(on, "on", false) ABC_JSON_INTEGER(timeout, "otp_timeout", 0) } resultJson(replyJson.results()); on = resultJson.on(); if (on) { ABC_CHECK(resultJson.timeoutOk()); timeout = resultJson.timeout(); } return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:28,
示例8: accountCategoriesRemoveStatusaccountCategoriesRemove(const Account &account, const std::string &category){ AccountCategories categories; ABC_CHECK(accountCategoriesLoad(categories, account)); categories.erase(category); ABC_CHECK(accountCategoriesSave(account, categories)); return Status();}
开发者ID:codeaudit,项目名称:airbitz-core,代码行数:9,
示例9: ABC_CHECKStatusAccount::load(){ // If the sync dir doesn't exist, create it: ABC_CHECK(syncEnsureRepo(dir(), login.lobby.dir() + "tmp/", login.syncKey())); ABC_CHECK(wallets.load()); return Status();}
开发者ID:BitcoinKinetics,项目名称:airbitz-core,代码行数:9,
示例10: ABC_CHECKStatusLogin::loadOffline(){ ABC_CHECK(store.paths(paths, true)); LoginPackage loginPackage; ABC_CHECK(loginPackage.load(paths.loginPackagePath())); ABC_CHECK(loginPackage.passwordAuthBox().decrypt(passwordAuth_, dataKey_)); // Look for an existing rootKeyBox: JsonBox rootKeyBox; if (fileExists(paths.rootKeyPath())) { ABC_CHECK(rootKeyBox.load(paths.rootKeyPath())); } else { // Try asking the server: AuthJson authJson; LoginReplyJson loginJson; ABC_CHECK(authJson.loginSet(*this)); ABC_CHECK(loginServerLogin(loginJson, authJson)); ABC_CHECK(loginJson.save(*this)); rootKeyBox = loginJson.rootKeyBox(); } // Otherwise, there just isn't one. // Extract the rootKey: if (rootKeyBox.ok()) ABC_CHECK(rootKeyBox.decrypt(rootKey_, dataKey_)); else ABC_CHECK(rootKeyUpgrade()); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:35,
示例11: loginServerPasswordSetStatusloginServerPasswordSet(AuthJson authJson, DataSlice passwordAuth, JsonPtr passwordKeySnrp, JsonPtr passwordBox, JsonPtr passwordAuthBox){ const auto url = ABC_SERVER_ROOT "/v2/login/password"; JsonSnrp passwordAuthSnrp; ABC_CHECK(passwordAuthSnrp.snrpSet(usernameSnrp())); JsonObject dataJson; ABC_CHECK(dataJson.set("passwordAuth", base64Encode(passwordAuth))); ABC_CHECK(dataJson.set("passwordAuthSnrp", passwordAuthSnrp)); ABC_CHECK(dataJson.set("passwordKeySnrp", passwordKeySnrp)); ABC_CHECK(dataJson.set("passwordBox", passwordBox)); ABC_CHECK(dataJson.set("passwordAuthBox", passwordAuthBox)); ABC_CHECK(authJson.set("data", dataJson)); HttpReply reply; ABC_CHECK(AirbitzRequest().request(reply, url, "PUT", authJson.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:27,
示例12: watcherSaveStatuswatcherSave(Wallet &self){ Watcher *watcher = nullptr; ABC_CHECK(watcherFind(watcher, self)); auto data = watcher->serialize();; ABC_CHECK(fileSave(data, watcherPath(self))); return Status();}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:11,
示例13: ABC_CHECKStatusWallet::createNew(std::shared_ptr<Wallet> &result, Account &account, const std::string &name, int currency){ std::string id; ABC_CHECK(randomUuid(id)); std::shared_ptr<Wallet> out(new Wallet(account, id)); ABC_CHECK(out->createNew(name, currency)); result = std::move(out); return Status();}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:12,
示例14: lockStatusWallet::nameSet(const std::string &name){ std::lock_guard<std::mutex> lock(mutex_); name_ = name; NameJson json; ABC_CHECK(json.nameSet(name)); ABC_CHECK(json.save(syncDir() + WALLET_NAME_FILENAME, dataKey())); return Status();}
开发者ID:MoeAfilal,项目名称:airbitz-core,代码行数:12,
示例15: loginServerRecovery2DeleteStatusloginServerRecovery2Delete(AuthJson authJson){ const auto url = ABC_SERVER_ROOT "/v2/login/recovery2"; HttpReply reply; ABC_CHECK(AirbitzRequest().request(reply, url, "DELETE", authJson.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:12,
示例16: loginServerOtpPendingStatusloginServerOtpPending(std::list<DataChunk> users, std::list<bool> &isPending){ const auto url = ABC_SERVER_ROOT "/v1/otp/pending/check"; std::string param; std::map<std::string, bool> userMap; std::list<std::string> usersEncoded; for (const auto &u : users) { std::string username = base64Encode(u); param += (username + ","); userMap[username] = false; usersEncoded.push_back(username); } JsonObject json; ABC_CHECK(json.set("l1s", param)); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); JsonArray arrayJson = replyJson.results(); size_t size = arrayJson.size(); for (size_t i = 0; i < size; i++) { json_t *pJSON_Row = arrayJson[i].get(); if (!pJSON_Row || !json_is_object(pJSON_Row)) return ABC_ERROR(ABC_CC_JSONError, "Error parsing JSON array element object"); json_t *pJSON_Value = json_object_get(pJSON_Row, "login"); if (!pJSON_Value || !json_is_string(pJSON_Value)) return ABC_ERROR(ABC_CC_JSONError, "Error otp/pending/login JSON"); std::string username(json_string_value(pJSON_Value)); pJSON_Value = json_object_get(pJSON_Row, ABC_SERVER_JSON_OTP_PENDING); if (!pJSON_Value || !json_is_boolean(pJSON_Value)) return ABC_ERROR(ABC_CC_JSONError, "Error otp/pending/pending JSON"); if (json_is_true(pJSON_Value)) { userMap[username] = json_is_true(pJSON_Value); } } isPending.clear(); for (auto &username: usersEncoded) { isPending.push_back(userMap[username]); } return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:52,
示例17: watcherLoadstatic StatuswatcherLoad(Wallet &self){ Watcher *watcher = nullptr; ABC_CHECK(watcherFind(watcher, self)); DataChunk data; ABC_CHECK(fileLoad(data, watcherPath(self))); if (!watcher->load(data)) return ABC_ERROR(ABC_CC_Error, "Unable to load serialized watcher"); return Status();}
开发者ID:TSchnaars,项目名称:airbitz-core,代码行数:13,
示例18: loginServerGetQuestionsStatusloginServerGetQuestions(JsonPtr &result){ const auto url = ABC_SERVER_ROOT "/v1/questions"; HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url)); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); result = replyJson.results(); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:13,
示例19: loginServerLobbyGetStatusloginServerLobbyGet(JsonPtr &result, const std::string &id){ const auto url = ABC_SERVER_ROOT "/v2/lobby/" + id; HttpReply reply; ABC_CHECK(AirbitzRequest().get(reply, url)); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); result = replyJson.results(); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:13,
示例20: ABC_CHECK_OLDStatusJsonBox::encrypt(DataSlice data, DataSlice key){ DataChunk nonce; AutoU08Buf cyphertext; ABC_CHECK_OLD(ABC_CryptoEncryptAES256Package(data, key, &cyphertext, nonce, &error)); ABC_CHECK(typeSet(AES256_CBC_AIRBITZ)); ABC_CHECK(nonceSet(base16Encode(nonce))); ABC_CHECK(cyphertextSet(base64Encode(cyphertext))); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:14,
示例21: loginServerAvailableStatusloginServerAvailable(const LoginStore &store){ const auto url = ABC_SERVER_ROOT "/v1/account/available"; ServerRequestJson json; ABC_CHECK(json.setup(store)); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:14,
示例22: loginServerCreateChildLoginStatusloginServerCreateChildLogin(AuthJson authJson, JsonPtr loginJson){ const auto url = ABC_SERVER_ROOT "/v2/login/create"; ABC_CHECK(authJson.set("data", loginJson)); HttpReply reply; ABC_CHECK(AirbitzRequest().request(reply, url, "PUT", authJson.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:14,
示例23: loginServerOtpResetCancelPendingStatusloginServerOtpResetCancelPending(const Login &login){ const auto url = ABC_SERVER_ROOT "/v1/otp/pending/cancel"; ServerRequestJson json; ABC_CHECK(json.setup(login)); HttpReply reply; ABC_CHECK(AirbitzRequest().post(reply, url, json.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply)); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:14,
示例24: loginServerLoginStatusloginServerLogin(LoginReplyJson &result, AuthJson authJson, AuthError *authError){ const auto url = ABC_SERVER_ROOT "/v2/login"; HttpReply reply; ABC_CHECK(AirbitzRequest().request(reply, url, "GET", authJson.encode())); ServerReplyJson replyJson; ABC_CHECK(replyJson.decode(reply, authError)); result = replyJson.results(); return Status();}
开发者ID:Airbitz,项目名称:airbitz-core,代码行数:14,
注:本文中的ABC_CHECK函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ABC_FREE函数代码示例 C++ ABCA_ASSERT函数代码示例 |