本文整理汇总了C++中NType类的典型用法代码示例。如果您正苦于以下问题:C++ NType类的具体用法?C++ NType怎么用?C++ NType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetValues
static NArrayWrapper<NInt> GetValues(const NType & type)
{
NInt count;
NCheck(NEnumGetValues(type.GetHandle(), NULL, &count));
NArrayWrapper<NInt> values(count);
NCheck(NEnumGetValues(type.GetHandle(), values.GetPtr(), &count));
return values;
}
示例2: n_to_string
NValue
n_to_string(NValue value) {
NTypeRegistry* registry = n_type_registry_get_default();
NType* type = n_type_registry_fetch_type(registry, n_typeof(value));
/* FIXME: Should manage the error result on string constructor and what
to do when type->to_string returns NULL */
char* repr_bytes = type->to_string(type, value);
NString* repr_string = n_string_wrap(repr_bytes, NULL);
return n_wrap_pointer(repr_string);
}
示例3: TryParse
static bool TryParse(const NType & type, const NStringWrapper & value, const NStringWrapper & format, NInt32 * pValue)
{
NBool result;
NCheck(NEnumTryParseN(type.GetHandle(), value.GetHandle(), format.GetHandle(), pValue, &result));
return result != 0;
}
示例4: ToString
static NString ToString(const NType & type, NInt32 value, const NStringWrapper & format = NString())
{
HNString hValue;
NCheck(NEnumToStringN(type.GetHandle(), value, format.GetHandle(), &hValue));
return NString(hValue, true);
}
示例5: NStack
NStack(const NType & elementType, NInt capacity, NInt maxCapacity, NInt growthDelta, NSizeType alignment)
{
NCheck(Internal::NStackInitEx(this, 0, elementType.GetHandle(), capacity, maxCapacity, growthDelta, alignment));
}
示例6: CopyTo
NInt CopyTo(const NType & valueType, void * pValues, NSizeType valuesSize, NInt valuesLength)
{
return NCheck(Internal::NStackCopyTo(this, valueType.GetHandle(), pValues, valuesSize, valuesLength));
}
示例7: Contains
bool Contains(const NType & valueType, const void * pValue, NSizeType valueSize)
{
NBool result;
NCheck(Internal::NStackContains(this, valueType.GetHandle(), pValue, valueSize, &result));
return result != 0;
}
示例8: Set
void Set(NInt baseIndex, NInt index, const NType & valueType, NAttributes attributes, const void * pValue, NSizeType valueSize)
{
NCheck(NArrayCollectionSet(GetHandle(), baseIndex, index, valueType.GetHandle(), attributes, pValue, valueSize));
}
示例9: Contains
bool Contains(NInt baseIndex, const NType & valueType, NAttributes attributes, const void * pValue, NSizeType valueSize) const
{
NBool result;
NCheck(NArrayCollectionContains(GetHandle(), baseIndex, valueType.GetHandle(), attributes, pValue, valueSize, &result));
return result != 0;
}
示例10: IndexOf
NInt IndexOf(NInt baseIndex, const NType & valueType, NAttributes attributes, const void * pValue, NSizeType valueSize) const
{
NInt index;
NCheck(NArrayCollectionIndexOf(GetHandle(), baseIndex, valueType.GetHandle(), attributes, pValue, valueSize, &index));
return index;
}
示例11: InsertRange
void InsertRange(NInt baseIndex, NInt index, const NType & valueType, NAttributes attributes, const void * arValues, NSizeType valuesSize, NInt valueCount)
{
NCheck(NArrayCollectionInsertRange(GetHandle(), baseIndex, index, valueType.GetHandle(), attributes, arValues, valuesSize, valueCount));
}
示例12: AddRange
NInt AddRange(NInt baseIndex, const NType & valueType, NAttributes attributes, const void * arValues, NSizeType valuesSize, NInt valueCount)
{
NInt index;
NCheck(NArrayCollectionAddRange(GetHandle(), baseIndex, valueType.GetHandle(), attributes, arValues, valuesSize, valueCount, &index));
return index;
}
示例13: Parse
static NInt32 Parse(const NType & type, const NStringWrapper & value, const NStringWrapper & format = NString())
{
NInt32 result;
NCheck(NEnumParseN(type.GetHandle(), value.GetHandle(), format.GetHandle(), &result));
return result;
}
示例14: Push
void Push(const NType & valueType, const void * pValue, NSizeType valueSize)
{
NCheck(Internal::NStackPush(this, valueType.GetHandle(), pValue, valueSize));
}
示例15: SetValue
void SetValue(const NObject & object, const NType & valueType, NAttributes attributes, const void * arValues, NSizeType valuesSize, NInt valuesLength, bool hasValue = true) const
{
NCheck(NPropertyInfoSetValue(GetHandle(), object.GetHandle(), valueType.GetHandle(), attributes, arValues, valuesSize, valuesLength, hasValue ? NTrue : NFalse));
}