本文整理汇总了C++中AvmCore::newConstantStringLatin1方法的典型用法代码示例。如果您正苦于以下问题:C++ AvmCore::newConstantStringLatin1方法的具体用法?C++ AvmCore::newConstantStringLatin1怎么用?C++ AvmCore::newConstantStringLatin1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvmCore
的用法示例。
在下文中一共展示了AvmCore::newConstantStringLatin1方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: implToString
Stringp ScriptObject::implToString() const
{
AvmCore* core = this->core();
Traits* t = this->traits();
Stringp s = core->concatStrings(core->newConstantStringLatin1("[object "), t->name());
return core->concatStrings(s, core->newConstantStringLatin1("]"));
}
示例2: implToString
Stringp ClassClosure::implToString() const
{
AvmCore* core = this->core();
Traits* t = this->traits()->itraits;
Stringp s = core->concatStrings(core->newConstantStringLatin1("[class "), t->name());
return core->concatStrings(s, core->newConstantStringLatin1("]"));
}
示例3: _toString
/**
* Object.prototype.toString()
*/
Stringp ObjectClass::_toString(Atom thisAtom)
{
AvmCore* core = this->core();
if (AvmCore::isObject(thisAtom))
{
return AvmCore::atomToScriptObject(thisAtom)->implToString();
}
else
{
Traits* t = toplevel()->toTraits(thisAtom);
Stringp s = core->concatStrings(core->newConstantStringLatin1("[object "), t->name());
return core->concatStrings(s, core->newConstantStringLatin1("]"));
}
}
示例4: implToString
Stringp FunctionObject::implToString() const
{
AvmCore* core = this->core();
Stringp s = core->concatStrings(core->newConstantStringLatin1("[object Function-"), core->intToString(_call->method->method_id()));
return core->concatStrings(s, core->newConstantStringLatin1("]"));
}
示例5: ClassClosure
ArrayClass::ArrayClass(VTable* cvtable)
: ClassClosure(cvtable),
kComma(core()->internConstantStringLatin1(","))
{
AvmCore* core = this->core();
Toplevel* toplevel = this->toplevel();
toplevel->arrayClass = this;
AvmAssert(traits()->getSizeOfInstance() == sizeof(ArrayClass));
VTable* ivtable = this->ivtable();
ScriptObject* objectPrototype = toplevel->objectClass->prototype;
prototype = new (core->GetGC(), ivtable->getExtraSize()) ArrayObject(ivtable, objectPrototype, 0);
// According to ECMAscript spec (ECMA-262.pdf)
// generic support: concat, join, pop, push, reverse, shift, slice, sort, splice, unshift
// NOT generic: toString, toLocaleString
// unknown: sortOn (our own extension)
#if defined(_DEBUG)
// AtomArray DRC unit tests, put here b/c this always runs once, has a GC * and
// this class has to do with arrays. this is more convienent that trying to test
// through actionscript
// create an atom
Stringp s = core->newConstantStringLatin1("foo");
Atom a = s->atom();
AvmAssert(s->RefCount()==0);
AtomArray *ar = new (gc()) AtomArray();
// test push/pop
ar->push(a); AvmAssert(s->RefCount()==1);
ar->push(a); AvmAssert(s->RefCount()==2);
ar->pop(); AvmAssert(s->RefCount()==1);
// reverse
ar->push(a); AvmAssert(s->RefCount()==2);
ar->reverse(); AvmAssert(s->RefCount()==2);
// shift
ar->shift(); AvmAssert(s->RefCount()==1);
// splice
AtomArray *ar2 = new (gc()) AtomArray();
ar->push(a);
ar2->push(ar); AvmAssert(s->RefCount()==4);
ar->splice(1, 2, 1, ar2, 0); // [a,a,a]
AvmAssert(s->RefCount()==5);
// unshift
Atom as[4] = {a,a,a,a};
ar->unshift(as, 4);
AvmAssert(s->RefCount()==9);
// removeAt
ar->removeAt(1); AvmAssert(s->RefCount()==8);
// setAt
ar->setAt(2, a); AvmAssert(s->RefCount()==8);
// insert
ar->insert(2, a); AvmAssert(s->RefCount()==9);
// clear
ar->clear(); AvmAssert(s->RefCount() == 2);
ar2->clear(); AvmAssert(s->RefCount() == 0);
gc()->Free(ar);
gc()->Free(ar2);
#endif
}