本文整理汇总了C++中trpgReadBuffer::GetToken方法的典型用法代码示例。如果您正苦于以下问题:C++ trpgReadBuffer::GetToken方法的具体用法?C++ trpgReadBuffer::GetToken怎么用?C++ trpgReadBuffer::GetToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trpgReadBuffer
的用法示例。
在下文中一共展示了trpgReadBuffer::GetToken方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
bool trpgLightTable::Read(trpgReadBuffer &buf)
{
int32 numLights;
trpgToken lightTok;
int32 len;
try {
buf.Get(numLights);
for (int i=0;i<numLights;i++) {
buf.GetToken(lightTok,len);
if (lightTok != TRPGLIGHTATTR) throw 1;
buf.PushLimit(len);
trpgLightAttr light;// = lightList[i];
bool status = light.Read(buf);
buf.PopLimit();
if (!status) throw 1;
AddLightAttr(light);
}
}
catch (...) {
return false;
}
return true;
}
示例2: Read
bool trpgRangeTable::Read(trpgReadBuffer &buf)
{
int32 numRange;
trpgToken tok;
int32 len;
valid = false;
try {
buf.Get(numRange);
if (numRange < 0) throw 1;
for (int i=0;i<numRange;i++) {
// Read in the individual range
buf.GetToken(tok,len);
if (tok != TRPG_RANGE) throw 1;
buf.PushLimit(len);
trpgRange range;
bool status = range.Read(buf);
buf.PopLimit();
if (!status) throw 1;
AddRange(range);
}
valid = true;
}
catch (...) {
return false;
}
return isValid();
}
示例3: Read
bool trpgSupportStyleTable::Read(trpgReadBuffer &buf)
{
trpgSupportStyle style;
trpgToken styleTok;
int32 len;
bool status;
int numStyle;
int i;
Reset();
try
{
buf.Get(numStyle);
if (numStyle < 0)
throw 1;
//styles.resize(numStyle);
for (i=0;i<numStyle;i++) {
buf.GetToken(styleTok,len);
if (styleTok != TRPG_SUPPORT_STYLE) throw 1;
buf.PushLimit(len);
style.Reset();
status = style.Read(buf);
buf.PopLimit();
if (!status) throw 1;
AddStyle(style);
}
}
catch (...)
{
return false;
}
return isValid();
}
示例4: Read
bool trpgMatTable::Read(trpgReadBuffer &buf)
{
trpgMaterial mat;
trpgToken matTok;
int32 len;
bool status;
int i,j;
int nMat,nTable;
try {
buf.Get(nTable);
buf.Get(nMat);
if (nTable <= 0 || nMat < 0) throw 1;
// Read the materials
for (i=0;i<nTable;i++)
for (j=0;j<nMat;j++) {
buf.GetToken(matTok,len);
if (matTok != TRPGMATERIAL) throw 1;
buf.PushLimit(len);
mat.Reset();
status = mat.Read(buf);
buf.PopLimit();
if (!status) throw 1;
AddMaterial(mat,false);
}
numTable += nTable;
numMat = materialMap.size();
}
catch (...) {
return false;
}
return isValid();
}
示例5: Read
bool trpgModelTable::Read(trpgReadBuffer &buf)
{
int32 numModel;
trpgToken tok;
int32 len;
bool status;
try {
buf.Get(numModel);
for (int i=0;i<numModel;i++) {
trpgModel model;
buf.GetToken(tok,len);
bool readHandle;
if (tok == TRPGMODELREF)
readHandle = false;
else if (tok == TRPGMODELREF2)
readHandle = true;
else
throw 1;
buf.PushLimit(len);
status = model.Read(buf,readHandle);
buf.PopLimit();
if (!status) throw 1;
AddModel(model);
}
}
catch (...) {
return false;
}
return isValid();
}