本文整理汇总了C++中AsArray函数的典型用法代码示例。如果您正苦于以下问题:C++ AsArray函数的具体用法?C++ AsArray怎么用?C++ AsArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AsArray函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AsArray
bool
nsSmallVoidArray::SizeTo(int32_t aMin)
{
if (!HasSingle()) {
return AsArray()->SizeTo(aMin);
}
if (aMin <= 0) {
mImpl = nullptr;
return true;
}
if (aMin == 1) {
return true;
}
void* single = GetSingle();
mImpl = nullptr;
if (!AsArray()->SizeTo(aMin)) {
SetSingle(single);
return false;
}
AsArray()->AppendElement(single);
return true;
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:29,代码来源:nsVoidArray.cpp
示例2: AsArray
PRBool
nsSmallVoidArray::SizeTo(PRInt32 aMin)
{
if (!HasSingle()) {
return AsArray()->SizeTo(aMin);
}
if (aMin <= 0) {
mImpl = nsnull;
return PR_TRUE;
}
if (aMin == 1) {
return PR_TRUE;
}
void* single = GetSingle();
mImpl = nsnull;
if (!AsArray()->SizeTo(aMin)) {
SetSingle(single);
return PR_FALSE;
}
AsArray()->AppendElement(single);
return PR_TRUE;
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:29,代码来源:nsVoidArray.cpp
示例3: Push
CP CLispEng::CopyVector(CP p) {
Push(p);
CArrayValue *oav = AsArray(p);
size_t size = oav->DataLength;
CArrayValue *av = CreateVector(size, oav->GetElementType());
oav = AsArray(Pop());
memcpy(av->m_pData, oav->m_pData, oav->GetByteLength());
return FromSValue(av);
}
开发者ID:ufasoft,项目名称:lisp,代码行数:9,代码来源:svalue.cpp
示例4: GetDirect
FX_BOOL CPDF_Object::IsIdentical(CPDF_Object* pOther) const {
if (this == pOther)
return TRUE;
if (!pOther)
return FALSE;
if (pOther->m_Type != m_Type) {
if (IsReference() && GetDirect())
return GetDirect()->IsIdentical(pOther);
if (pOther->IsReference())
return IsIdentical(pOther->GetDirect());
return FALSE;
}
switch (m_Type) {
case PDFOBJ_BOOLEAN:
return AsBoolean()->Identical(pOther->AsBoolean());
case PDFOBJ_NUMBER:
return AsNumber()->Identical(pOther->AsNumber());
case PDFOBJ_STRING:
return AsString()->Identical(pOther->AsString());
case PDFOBJ_NAME:
return AsName()->Identical(pOther->AsName());
case PDFOBJ_ARRAY:
return AsArray()->Identical(pOther->AsArray());
case PDFOBJ_DICTIONARY:
return AsDictionary()->Identical(pOther->AsDictionary());
case PDFOBJ_NULL:
return TRUE;
case PDFOBJ_STREAM:
return AsStream()->Identical(pOther->AsStream());
case PDFOBJ_REFERENCE:
return AsReference()->Identical(pOther->AsReference());
}
return FALSE;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:34,代码来源:fpdf_parser_objects.cpp
示例5: AsArray
CArrayValue *CLispEng::ToVector(CP p) {
if (Type(p) == TS_ARRAY) {
CArrayValue *av = AsArray(p);
if (Type(av->m_dims) == TS_FIXNUM)
return av;
}
E_TypeErr(p, S(L_VECTOR));
}
开发者ID:ufasoft,项目名称:lisp,代码行数:8,代码来源:svalue.cpp
示例6: return
PRBool
nsSmallVoidArray::EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData)
{
if (HasSingle()) {
return (*aFunc)(GetSingle(), aData);
}
return AsArray()->EnumerateBackwards(aFunc,aData);
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:8,代码来源:nsVoidArray.cpp
示例7: Find
inline std::vector<std::string> Object::Get<std::vector<std::string>>(const std::string &key) const
{
auto value = Find(key);
std::vector<std::string> result;
for(auto &entry : value->AsArray())
result.push_back(entry->AsString());
return result;
}
开发者ID:jbruce2112,项目名称:cpp-client-library,代码行数:8,代码来源:Object.hpp
示例8: ToCClosure
CClosure *CLispEng::CopyClosure(CP oldClos) {
CClosure *oc = ToCClosure(oldClos);
size_t len = AsArray(oldClos)->DataLength;
CClosure *nc = CreateClosure(len);
nc->NameOrClassVersion = oc->NameOrClassVersion;
nc->CodeVec = oc->CodeVec;
memcpy(nc->Consts, oc->Consts, len*sizeof(CP));
return nc;
}
开发者ID:ufasoft,项目名称:lisp,代码行数:9,代码来源:svalue.cpp
示例9: GetSingle
PRInt32
nsSmallVoidArray::IndexOf(void* aPossibleElement) const
{
if (HasSingle()) {
return aPossibleElement == GetSingle() ? 0 : -1;
}
return AsArray()->IndexOf(aPossibleElement);
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:9,代码来源:nsVoidArray.cpp
示例10: switch
bool CLispEng::StringP(CP p) {
if (!VectorP(p))
return false;
switch (AsArray(p)->GetElementType()) {
case ELTYPE_CHARACTER:
case ELTYPE_BASECHAR:
return true;
}
return false;
}
开发者ID:ufasoft,项目名称:lisp,代码行数:10,代码来源:svalue.cpp
示例11: NS_ASSERTION
void*
nsSmallVoidArray::FastElementAt(PRInt32 aIndex) const
{
NS_ASSERTION(0 <= aIndex && aIndex < Count(), "nsSmallVoidArray::FastElementAt: index out of range");
if (HasSingle()) {
return GetSingle();
}
return AsArray()->FastElementAt(aIndex);
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:11,代码来源:nsVoidArray.cpp
示例12: AsArray
bool
nsSmallVoidArray::RemoveElementAt(PRInt32 aIndex)
{
if (HasSingle()) {
if (aIndex == 0) {
mImpl = nsnull;
return true;
}
return false;
}
return AsArray()->RemoveElementAt(aIndex);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:15,代码来源:nsVoidArray.cpp
示例13: GetSingle
bool
nsSmallVoidArray::EnsureArray()
{
if (!HasSingle()) {
return true;
}
void* single = GetSingle();
mImpl = nullptr;
if (!AsArray()->AppendElement(single)) {
SetSingle(single);
return false;
}
return true;
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:17,代码来源:nsVoidArray.cpp
示例14: NS_ASSERTION
bool
nsSmallVoidArray::InsertElementAt(void* aElement, int32_t aIndex)
{
NS_ASSERTION(!(NS_PTR_TO_INT32(aElement) & 0x1),
"Attempt to add element with 0x1 bit set to nsSmallVoidArray");
if (aIndex == 0 && IsEmpty()) {
SetSingle(aElement);
return true;
}
if (!EnsureArray()) {
return false;
}
return AsArray()->InsertElementAt(aElement, aIndex);
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:18,代码来源:nsVoidArray.cpp
示例15: switch
nsSmallVoidArray&
nsSmallVoidArray::operator=(nsSmallVoidArray& other)
{
PRInt32 count = other.Count();
switch (count) {
case 0:
Clear();
break;
case 1:
Clear();
AppendElement(other.ElementAt(0));
break;
default:
if (GetArraySize() >= count || SizeTo(count)) {
*AsArray() = *other.AsArray();
}
}
return *this;
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:20,代码来源:nsVoidArray.cpp
示例16: switch
void CPDF_Object::Destroy() {
switch (m_Type) {
case PDFOBJ_STRING:
delete AsString();
break;
case PDFOBJ_NAME:
delete AsName();
break;
case PDFOBJ_ARRAY:
delete AsArray();
break;
case PDFOBJ_DICTIONARY:
delete AsDictionary();
break;
case PDFOBJ_STREAM:
delete AsStream();
break;
default:
delete this;
}
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:21,代码来源:fpdf_parser_objects.cpp
注:本文中的AsArray函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论