本文整理汇总了C++中SetType函数的典型用法代码示例。如果您正苦于以下问题:C++ SetType函数的具体用法?C++ SetType怎么用?C++ SetType使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetType函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetType
LightNode::LightNode()
{
SetType(System::ObjectType::LIGHT_NODE);
}
示例2: SetType
void JSONValue::SetEmptyObject()
{
SetType(JSON_OBJECT);
Clear();
}
示例3: if
bool JSONValue::Parse(const char*& pos, const char*& end)
{
char c;
// Handle comments
for (;;)
{
if (!NextChar(c, pos, end, true))
return false;
if (c == '/')
{
if (!NextChar(c, pos, end, false))
return false;
if (c == '/')
{
// Skip until end of line
if (!MatchChar('\n', pos, end))
return false;
}
else if (c == '*')
{
// Skip until end of comment
if (!MatchChar('*', pos, end))
return false;
if (!MatchChar('/', pos, end))
return false;
}
else
return false;
}
else
break;
}
if (c == '}' || c == ']')
return false;
else if (c == 'n')
{
SetNull();
return MatchString("ull", pos, end);
}
else if (c == 'f')
{
*this = false;
return MatchString("alse", pos, end);
}
else if (c == 't')
{
*this = true;
return MatchString("rue", pos, end);
}
else if (IsDigit(c) || c == '-')
{
--pos;
*this = strtod(pos, const_cast<char**>(&pos));
return true;
}
else if (c == '\"')
{
SetType(JSON_STRING);
return ReadJSONString(*(reinterpret_cast<String*>(&data)), pos, end, true);
}
else if (c == '[')
{
SetEmptyArray();
// Check for empty first
if (!NextChar(c, pos, end, true))
return false;
if (c == ']')
return true;
else
--pos;
for (;;)
{
JSONValue arrayValue;
if (!arrayValue.Parse(pos, end))
return false;
Push(arrayValue);
if (!NextChar(c, pos, end, true))
return false;
if (c == ']')
break;
else if (c != ',')
return false;
}
return true;
}
else if (c == '{')
{
SetEmptyObject();
if (!NextChar(c, pos, end, true))
return false;
if (c == '}')
return true;
else
--pos;
for (;;)
//.........这里部分代码省略.........
示例4: SetType
void CNumberEdit::SetRange( short sMin, short sMax )
{
SetType( ntShort, (long)sMin, (ULONG)sMax );
}
示例5: switch
void SPELRecord::DeleteField(FIELD_IDENTIFIERS)
{
SPELSPIT defaultSPIT;
FNVCTDA defaultCTDA;
FNVEffect defaultEffect;
switch(FieldID)
{
case 1: //flags1
SetHeaderFlagMask(0);
return;
case 3: //versionControl1
flagsUnk = 0;
return;
case 4: //eid
EDID.Unload();
return;
case 5: //formVersion
formVersion = 0;
return;
case 6: //versionControl2
versionControl2[0] = 0;
versionControl2[1] = 0;
return;
case 7: //full
FULL.Unload();
return;
case 8: //spellType
SetType(defaultSPIT.spellType);
return;
case 9: //costUnused
SPIT.value.cost = defaultSPIT.cost;
return;
case 10: //levelTypeUnused
SPIT.value.levelType = defaultSPIT.levelType;
return;
case 11: //flags
SetFlagMask(defaultSPIT.flags);
return;
case 12: //unused1
SPIT.value.unused1[0] = defaultSPIT.unused1[0];
SPIT.value.unused1[1] = defaultSPIT.unused1[1];
SPIT.value.unused1[2] = defaultSPIT.unused1[2];
return;
case 13: //effects
if(ListFieldID == 0) //effectsSize
{
Effects.Unload();
return;
}
if(ListIndex >= Effects.value.size())
return;
switch(ListFieldID)
{
case 1: //effect
Effects.value[ListIndex]->EFID.value = defaultEffect.EFID.value;
return;
case 2: //magnitude
Effects.value[ListIndex]->EFIT.value.magnitude = defaultEffect.EFIT.value.magnitude;
return;
case 3: //area
Effects.value[ListIndex]->EFIT.value.area = defaultEffect.EFIT.value.area;
return;
case 4: //duration
Effects.value[ListIndex]->EFIT.value.duration = defaultEffect.EFIT.value.duration;
return;
case 5: //rangeType
Effects.value[ListIndex]->SetRange(defaultEffect.EFIT.value.rangeType);
return;
case 6: //actorValue
Effects.value[ListIndex]->EFIT.value.actorValue = defaultEffect.EFIT.value.actorValue;
return;
case 7: //conditions
if(ListX2FieldID == 0) //conditionsSize
{
Effects.value[ListIndex]->CTDA.Unload();
return;
}
if(ListX2Index >= Effects.value[ListIndex]->CTDA.value.size())
return;
switch(ListX2FieldID)
{
case 1: //operType
Effects.value[ListIndex]->CTDA.value[ListX2Index]->operType = defaultCTDA.operType;
return;
case 2: //unused1
Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[0] = defaultCTDA.unused1[0];
Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[1] = defaultCTDA.unused1[1];
Effects.value[ListIndex]->CTDA.value[ListX2Index]->unused1[2] = defaultCTDA.unused1[2];
return;
case 3: //compValue
Effects.value[ListIndex]->CTDA.value[ListX2Index]->compValue = defaultCTDA.compValue;
return;
case 4: //ifunc
Effects.value[ListIndex]->CTDA.value[ListX2Index]->ifunc = defaultCTDA.ifunc;
return;
case 5: //param1
//.........这里部分代码省略.........
示例6: SetType
void
InfoBoxManager::SetCurrentType(unsigned box, char type)
{
SetType(box, type, GetCurrentMode());
}
示例7: KVCalibrator
KVSeDPositionCal::KVSeDPositionCal() : KVCalibrator(NPAR_SEDPOSCAL)
{
// Default constructor
SetType("position->cm");
SetLabel("XY");
}
示例8: SetType
Rect::Rect(Float left, Float top, Float right, Float bottom)
{
SetType(SHAPE_TYPE_RECT);
SetValues(left, top, right, bottom);
}
示例9: SetType
void C4ParticleValueProvider::Set(float to)
{
SetType(C4PV_Const);
startValue = endValue = to;
}