本文整理汇总了C++中MojErrCheck函数的典型用法代码示例。如果您正苦于以下问题:C++ MojErrCheck函数的具体用法?C++ MojErrCheck怎么用?C++ MojErrCheck使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MojErrCheck函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MojAssert
MojErr MojDbServiceHandler::handleDelKind(MojServiceMessage* msg, MojObject& payload, MojDbReq& req)
{
MojAssert(msg);
MojLogTrace(s_log);
MojObject id;
MojErr err = payload.getRequired(MojDbServiceDefs::IdKey, id);
MojErrCheck(err);
bool found = false;
err = m_db.delKind(id, found, MojDb::FlagNone, req);
MojErrCheck(err);
if (!found)
MojErrThrow(MojErrDbKindNotRegistered);
err = msg->replySuccess();
MojErrCheck(err);
return MojErrNone;
}
示例2: LOG_TRACE
MojErr MojDbMultiExtractor::vals(const MojObject& obj, KeySet& valsOut) const
{
LOG_TRACE("Entering function %s", __FUNCTION__);
// extract property values
for (ExtractorVec::ConstIterator i = m_extractors.begin(); i != m_extractors.end(); ++i) {
MojErr err = (*i)->vals(obj, valsOut);
MojErrCheck(err);
}
return MojErrNone;
}
示例3: MojAssert
MojErr MojService::addRequest(MojServiceRequest* req)
{
MojAssert(req);
MojAssertMutexLocked(m_mutex);
MojLogTrace(s_log);
MojErr err = m_requests.put(req->token(), req);
MojErrCheck(err);
return MojErrNone;
}
示例4: MojAssert
MojErr MojDbKindState::indexId(const MojChar* indexName, MojDbReq& req, MojObject& idOut, bool& createdOut)
{
MojAssert(indexName);
MojThreadGuard guard(m_lock);
MojErr err = id(indexName, IndexIdsKey, req, idOut, createdOut);
MojErrCheck(err);
return MojErrNone;
}
示例5: MojErrCheck
MojErr MojDbKind::updateIndexes(const MojObject* newObj, const MojObject* oldObj, const MojDbReq& req, MojDbOp op, MojVector<MojDbKind*>& kindVec, MojInt32& idxcount)
{
MojErr err = kindVec.push(this);
MojErrCheck(err);
// update supers
for (KindVec::ConstIterator i = m_supers.begin();
i != m_supers.end(); ++i) {
if (kindVec.find((*i), 0) == MojInvalidIndex) {
err = (*i)->updateIndexes(newObj, oldObj, req, op, kindVec, idxcount);
MojErrCheck(err);
} else {
return MojErrNone;
}
}
err = updateOwnIndexes(newObj, oldObj, req, idxcount);
MojErrCheck(err);
return MojErrNone;
}
示例6: MojLogTrace
MojErr MojDbKind::clearSupers()
{
MojLogTrace(s_log);
// remove old supers
MojErr err = MojErrNone;
for (KindVec::ConstIterator i = m_supers.begin(); i != m_supers.end(); ++i) {
err = (*i)->removeKind((*i)->m_subs, this);
MojErrCheck(err);
}
m_supers.clear();
// remove old subs
for (KindVec::ConstIterator i = m_subs.begin(); i != m_subs.end(); ++i) {
err = (*i)->removeKind((*i)->m_supers, this);
MojErrCheck(err);
}
m_subs.clear();
return MojErrNone;
}
示例7: deny
MojErr MojDbKind::checkPermission(MojDbOp op, MojDbReq& req)
{
// if this request has admin privileges, skip the permissions check
if (hasOwnerPermission(req))
return MojErrNone;
if (op == OpKindUpdate) {
MojErr err = deny(req);
MojErrCheck(err);
} else {
// check if permissions are set on this kind
const MojChar* opStr = stringFromOperation(op);
MojDbPermissionEngine::Value val = objectPermission(opStr, req);
if (val != MojDbPermissionEngine::ValueAllow) {
MojErr err = deny(req);
MojErrCheck(err);
}
}
return MojErrNone;
}
示例8: MojAssert
MojErr MojServiceMessage::handleCancel()
{
MojAssert(m_service);
if (m_subscribed) {
MojErr err = m_service->removeSubscription(this);
MojErrCheck(err);
m_subscribed = false;
}
return MojErrNone;
}
示例9: MojAssert
MojErr MojDb::drop(const MojChar* path)
{
MojAssert(path);
MojLogTrace(s_log);
MojErr err = requireOpen();
MojErrCheck(err);
MojDbReq req;
err = req.begin(this, true);
MojErrCheck(err);
err = m_storageEngine->drop(path, req.txn());
MojErrCheck(err);
err = req.end();
MojErrCheck(err);
err = close();
MojErrCheck(err);
return MojErrNone;
}
示例10: LOG_TRACE
MojErr MojDbSearchCursor::count(MojUInt32& countOut)
{
LOG_TRACE("Entering function %s", __FUNCTION__);
countOut = 0;
MojErr err = begin();
MojErrCheck(err);
countOut = m_count;
return MojErrNone;
}
示例11: MojAssert
MojErr MojObjectFilter::intValue(MojInt64 val)
{
MojAssert(m_visitor);
if (m_state.m_includeCount) {
m_state.m_includeCount--;
MojErr err = m_visitor->intValue(val);
MojErrCheck(err);
}
return MojErrNone;
}
示例12: MojErrCheck
MojErr MojDbTestStorageDatabase::openIndex(const MojObject& id, MojDbStorageTxn* txn, MojRefCountedPtr<MojDbStorageIndex>& indexOut)
{
MojErr err = m_testEngine->checkErrMap(_T("db.openIndex"));
MojErrCheck(err);
MojAssert(m_db.get());
MojAssert(!indexOut.get());
//open the actual storage index
MojRefCountedPtr<MojDbStorageIndex> realIdx;
err = m_db->openIndex(id, MojTestTxn(txn), realIdx);
MojErrCheck(err);
//create the test storage index as a wrapper
MojRefCountedPtr<MojDbTestStorageIndex> index(new MojDbTestStorageIndex(realIdx.get(), m_testEngine));
MojAllocCheck(index.get());
indexOut = index;
return MojErrNone;
}
示例13: getKey
MojErr MojDbLevelQuery::seekImpl(const ByteVec& key, bool desc, bool& foundOut)
{
if (key.empty()) {
// if key is empty, seek to beginning (or end if desc)
MojErr err = getKey(foundOut, SeekEmptyFlags[desc]);
MojErrCheck(err);
} else {
// otherwise seek to the key
MojErr err = m_key.fromBytes(key.begin(), key.size());
MojErrCheck(err);
err = getKey(foundOut, SeekFlags);
MojErrCheck(err);
// if descending, skip the first result (which is outside the range)
if (desc) {
err = next(foundOut);
MojErrCheck(err);
}
}
return MojErrNone;
}
示例14: MojLogTrace
MojErr MojDb::delImpl(const MojObject& id, bool& foundOut, MojObject& foundObjOut, MojDbReq& req, MojUInt32 flags)
{
MojLogTrace(s_log);
foundObjOut.clear();
// get object, so we can find the type
MojRefCountedPtr<MojDbStorageItem> item;
MojErr err = m_objDb->get(id, req.txn(), true, item);
MojErrCheck(err);
if (item.get()) {
// and delete it
MojObject obj;
err = item->toObject(obj, m_kindEngine);
MojErrCheck(err);
err = delObj(id, obj, item.get(), foundObjOut, req, flags);
MojErrCheck(err);
foundOut = true;
}
return MojErrNone;
}
示例15: MojErrCheck
MojErr MojDbTextUtils::strToUnicode(const MojString& src, UnicodeVec& destOut)
{
MojErr err = destOut.resize(src.length() * 2);
MojErrCheck(err);
MojInt32 destCapacity = 0;
MojInt32 destLength = 0;
do {
UChar* dest = NULL;
err = destOut.begin(dest);
MojErrCheck(err);
destCapacity = (MojInt32) destOut.size();
UErrorCode status = U_ZERO_ERROR;
u_strFromUTF8(dest, destCapacity, &destLength, src.data(), (MojInt32) src.length(), &status);
if (status != U_BUFFER_OVERFLOW_ERROR)
MojUnicodeErrCheck(status);
err = destOut.resize(destLength);
MojErrCheck(err);
} while (destLength > destCapacity);
return MojErrNone;
}