本文整理汇总了C++中mozilla::Move方法的典型用法代码示例。如果您正苦于以下问题:C++ mozilla::Move方法的具体用法?C++ mozilla::Move怎么用?C++ mozilla::Move使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mozilla
的用法示例。
在下文中一共展示了mozilla::Move方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nt
nsresult
txStylesheet::init()
{
mRootFrame = new ImportFrame;
NS_ENSURE_TRUE(mRootFrame, NS_ERROR_OUT_OF_MEMORY);
// Create default templates
// element/root template
mContainerTemplate = new txPushParams;
NS_ENSURE_TRUE(mContainerTemplate, NS_ERROR_OUT_OF_MEMORY);
nsAutoPtr<txNodeTest> nt(new txNodeTypeTest(txNodeTypeTest::NODE_TYPE));
NS_ENSURE_TRUE(nt, NS_ERROR_OUT_OF_MEMORY);
nsAutoPtr<Expr> nodeExpr(new LocationStep(nt, LocationStep::CHILD_AXIS));
NS_ENSURE_TRUE(nodeExpr, NS_ERROR_OUT_OF_MEMORY);
nt.forget();
txPushNewContext* pushContext = new txPushNewContext(Move(nodeExpr));
mContainerTemplate->mNext = pushContext;
NS_ENSURE_TRUE(pushContext, NS_ERROR_OUT_OF_MEMORY);
txApplyDefaultElementTemplate* applyTemplates =
new txApplyDefaultElementTemplate;
pushContext->mNext = applyTemplates;
NS_ENSURE_TRUE(applyTemplates, NS_ERROR_OUT_OF_MEMORY);
txLoopNodeSet* loopNodeSet = new txLoopNodeSet(applyTemplates);
applyTemplates->mNext = loopNodeSet;
NS_ENSURE_TRUE(loopNodeSet, NS_ERROR_OUT_OF_MEMORY);
txPopParams* popParams = new txPopParams;
pushContext->mBailTarget = loopNodeSet->mNext = popParams;
NS_ENSURE_TRUE(popParams, NS_ERROR_OUT_OF_MEMORY);
popParams->mNext = new txReturn();
NS_ENSURE_TRUE(popParams->mNext, NS_ERROR_OUT_OF_MEMORY);
// attribute/textnode template
nt = new txNodeTypeTest(txNodeTypeTest::NODE_TYPE);
NS_ENSURE_TRUE(nt, NS_ERROR_OUT_OF_MEMORY);
nodeExpr = new LocationStep(nt, LocationStep::SELF_AXIS);
NS_ENSURE_TRUE(nodeExpr, NS_ERROR_OUT_OF_MEMORY);
nt.forget();
mCharactersTemplate = new txValueOf(Move(nodeExpr), false);
NS_ENSURE_TRUE(mCharactersTemplate, NS_ERROR_OUT_OF_MEMORY);
mCharactersTemplate->mNext = new txReturn();
NS_ENSURE_TRUE(mCharactersTemplate->mNext, NS_ERROR_OUT_OF_MEMORY);
// pi/comment/namespace template
mEmptyTemplate = new txReturn();
NS_ENSURE_TRUE(mEmptyTemplate, NS_ERROR_OUT_OF_MEMORY);
return NS_OK;
}
示例2: mName
txStartElement::txStartElement(nsAutoPtr<Expr>&& aName,
nsAutoPtr<Expr>&& aNamespace,
txNamespaceMap* aMappings)
: mName(Move(aName)),
mNamespace(Move(aNamespace)),
mMappings(aMappings)
{
}
示例3: mExpr
txStylesheet::GlobalVariable::GlobalVariable(nsAutoPtr<Expr>&& aExpr,
nsAutoPtr<txInstruction>&& aInstr,
bool aIsParam)
: mExpr(Move(aExpr)),
mFirstInstruction(Move(aInstr)),
mIsParam(aIsParam)
{
}
示例4: CHECK
static void
TestAssignmentFromMozPair()
{
// Copy assignment
Tuple<int, int> a{0, 0};
Pair<int, int> b{42, 42};
a = b;
CHECK(Get<0>(a) == 42);
CHECK(Get<1>(a) == 42);
// Assignment to reference member
int i = 0;
int j = 0;
int k = 42;
Tuple<int&, int&> c{i, j};
Pair<int&, int&> d{k, k};
c = d;
CHECK(i == 42);
CHECK(j == 42);
// Move assignment
Tuple<UniquePtr<int>, UniquePtr<int>> e{MakeUnique<int>(0),
MakeUnique<int>(0)};
Pair<UniquePtr<int>, UniquePtr<int>> f{MakeUnique<int>(42),
MakeUnique<int>(42)};
e = Move(f);
CHECK(*Get<0>(e) == 42);
CHECK(*Get<1>(e) == 42);
CHECK(f.first() == nullptr);
CHECK(f.second() == nullptr);
}
示例5:
nsresult
txRtfHandler::getAsRTF(txAExprResult** aResult)
{
*aResult = new txResultTreeFragment(Move(mBuffer));
NS_ADDREF(*aResult);
return NS_OK;
}
示例6: Move
nsresult
txPushNewContext::addSort(nsAutoPtr<Expr>&& aSelectExpr,
nsAutoPtr<Expr>&& aLangExpr,
nsAutoPtr<Expr>&& aDataTypeExpr,
nsAutoPtr<Expr>&& aOrderExpr,
nsAutoPtr<Expr>&& aCaseOrderExpr)
{
if (SortKey *key = mSortKeys.AppendElement()) {
// workaround for not triggering the Copy Constructor
key->mSelectExpr = Move(aSelectExpr);
key->mLangExpr = Move(aLangExpr);
key->mDataTypeExpr = Move(aDataTypeExpr);
key->mOrderExpr = Move(aOrderExpr);
key->mCaseOrderExpr = Move(aCaseOrderExpr);
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
}
示例7: mExpression
NS_INTERFACE_MAP_END
nsXPathExpression::nsXPathExpression(nsAutoPtr<Expr>&& aExpression,
txResultRecycler* aRecycler,
nsIDOMDocument *aDocument)
: mExpression(Move(aExpression)),
mRecycler(aRecycler),
mDocument(aDocument)
{
}
示例8: mNamespaceID
txLREAttribute::txLREAttribute(int32_t aNamespaceID, nsIAtom* aLocalName,
nsIAtom* aPrefix, nsAutoPtr<Expr>&& aValue)
: mNamespaceID(aNamespaceID),
mLocalName(aLocalName),
mPrefix(aPrefix),
mValue(Move(aValue))
{
if (aNamespaceID == kNameSpaceID_None) {
mLowercaseLocalName = TX_ToLowerCaseAtom(aLocalName);
}
}
示例9: GlobalVariable
nsresult
txStylesheet::addGlobalVariable(txVariableItem* aVariable)
{
if (mGlobalVariables.get(aVariable->mName)) {
return NS_OK;
}
nsAutoPtr<GlobalVariable> var(
new GlobalVariable(Move(aVariable->mValue),
Move(aVariable->mFirstInstruction),
aVariable->mIsParam));
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
nsresult rv = mGlobalVariables.add(aVariable->mName, var);
NS_ENSURE_SUCCESS(rv, rv);
var.forget();
return NS_OK;
}
示例10: buf
JS::FormatStackDump(JSContext* cx, JS::UniqueChars&& inBuf, bool showArgs, bool showLocals,
bool showThisProps)
{
int num = 0;
JS::UniqueChars buf(Move(inBuf));
for (AllFramesIter i(cx); !i.done(); ++i) {
if (i.hasScript())
buf = FormatFrame(cx, i, Move(buf), num, showArgs, showLocals, showThisProps);
else
buf = FormatWasmFrame(cx, i, Move(buf), num, showArgs);
if (!buf)
return nullptr;
num++;
}
if (!num)
buf = JS_sprintf_append(Move(buf), "JavaScript stack is empty\n");
return buf;
}
示例11: txXSLKey
nsresult
txStylesheet::addKey(const txExpandedName& aName,
nsAutoPtr<txPattern> aMatch, nsAutoPtr<Expr> aUse)
{
nsresult rv = NS_OK;
txXSLKey* xslKey = mKeys.get(aName);
if (!xslKey) {
xslKey = new txXSLKey(aName);
NS_ENSURE_TRUE(xslKey, NS_ERROR_OUT_OF_MEMORY);
rv = mKeys.add(aName, xslKey);
if (NS_FAILED(rv)) {
delete xslKey;
return rv;
}
}
if (!xslKey->addKey(Move(aMatch), Move(aUse))) {
return NS_ERROR_OUT_OF_MEMORY;
}
return NS_OK;
}
示例12: Move
static JS::UniqueChars
FormatWasmFrame(JSContext* cx, const FrameIter& iter, JS::UniqueChars&& inBuf, int num,
bool showArgs)
{
JSAtom* functionDisplayAtom = iter.functionDisplayAtom();
UniqueChars nameStr;
if (functionDisplayAtom)
nameStr = StringToNewUTF8CharsZ(cx, *functionDisplayAtom);
JS::UniqueChars buf = sprintf_append(cx, Move(inBuf), "%d %s()",
num,
nameStr ? nameStr.get() : "<wasm-function>");
if (!buf)
return nullptr;
const char* filename = iter.filename();
uint32_t lineno = iter.computeLine();
buf = sprintf_append(cx, Move(buf), " [\"%s\":%d]\n",
filename ? filename : "<unknown>",
lineno);
MOZ_ASSERT(!cx->isExceptionPending());
return buf;
}
示例13: ReportOutOfMemory
sprintf_append(JSContext* cx, JS::UniqueChars&& buf, const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
JS::UniqueChars result = JS_vsprintf_append(Move(buf), fmt, ap);
va_end(ap);
if (!result) {
ReportOutOfMemory(cx);
return nullptr;
}
return result;
}
示例14: mLevel
txNumber::txNumber(txXSLTNumber::LevelType aLevel,
nsAutoPtr<txPattern>&& aCount, nsAutoPtr<txPattern>&& aFrom,
nsAutoPtr<Expr>&& aValue, nsAutoPtr<Expr>&& aFormat,
nsAutoPtr<Expr>&& aGroupingSeparator,
nsAutoPtr<Expr>&& aGroupingSize)
: mLevel(aLevel), mCount(Move(aCount)),
mFrom(Move(aFrom)),
mValue(Move(aValue)),
mFormat(Move(aFormat)),
mGroupingSeparator(Move(aGroupingSeparator)),
mGroupingSize(Move(aGroupingSize))
{
}
示例15: mExpr
txValueOf::txValueOf(nsAutoPtr<Expr>&& aExpr, bool aDOE)
: mExpr(Move(aExpr)),
mDOE(aDOE)
{
}