这篇教程C++ AsArray函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AsArray函数的典型用法代码示例。如果您正苦于以下问题:C++ AsArray函数的具体用法?C++ AsArray怎么用?C++ AsArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AsArray函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AsArrayboolnsSmallVoidArray::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,
示例2: AsArrayPRBoolnsSmallVoidArray::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,
示例3: PushCP 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,
示例4: GetDirectFX_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,
示例5: AsArrayCArrayValue *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,
示例6: returnPRBoolnsSmallVoidArray::EnumerateBackwards(nsVoidArrayEnumFunc aFunc, void* aData){ if (HasSingle()) { return (*aFunc)(GetSingle(), aData); } return AsArray()->EnumerateBackwards(aFunc,aData);}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:8,
示例7: Findinline 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,
示例8: ToCClosureCClosure *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,
示例9: GetSinglePRInt32nsSmallVoidArray::IndexOf(void* aPossibleElement) const{ if (HasSingle()) { return aPossibleElement == GetSingle() ? 0 : -1; } return AsArray()->IndexOf(aPossibleElement);}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:9,
示例10: switchbool 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,
示例11: NS_ASSERTIONvoid*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,
示例12: AsArrayboolnsSmallVoidArray::RemoveElementAt(PRInt32 aIndex){ if (HasSingle()) { if (aIndex == 0) { mImpl = nsnull; return true; } return false; } return AsArray()->RemoveElementAt(aIndex);}
开发者ID:lofter2011,项目名称:Icefox,代码行数:15,
示例13: GetSingleboolnsSmallVoidArray::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,
示例14: NS_ASSERTIONboolnsSmallVoidArray::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,
示例15: switchnsSmallVoidArray& 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,
示例16: switchvoid 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,
注:本文中的AsArray函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AsShared函数代码示例 C++ ArrayList_Unlock函数代码示例 |