本文整理汇总了C++中tokenizer::token方法的典型用法代码示例。如果您正苦于以下问题:C++ tokenizer::token方法的具体用法?C++ tokenizer::token怎么用?C++ tokenizer::token使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tokenizer
的用法示例。
在下文中一共展示了tokenizer::token方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wowEvent
spellEvent::spellEvent(tokenizer& t) : wowEvent(t)
{
spellID = asInt(t.token(9));
string spellName = t.token(10); trimQuotes(spellName);
spells[spellID] = spellName;
spellSchool = asuIntFromHexa(t.token(11));
}
示例2: asInt
damage::damage(tokenizer& t, int offset)
{
dmgDone = asInt(t.token(22+offset));
overkill = asInt(t.token(23+offset));
magicSchool = asInt(t.token(24+offset));
resisted = asInt(t.token(25 + offset));
blocked = asInt(t.token(26 + offset));
absorbed = asInt(t.token(27 + offset));
critical = asInt(t.token(28 + offset));
glancing = asInt(t.token(29 + offset));
crushing = asInt(t.token(30 + offset));
multistrike = asInt(t.token(31 + offset));
}
示例3: asuIntFromHexa
wowEvent::wowEvent(tokenizer&t)
{
time_ms = t.time_ms;
string tmp = t.token(1); // sourceGUID
sourceFlags = asuIntFromHexa(t.token(3));
#ifndef _DEBUG
string sourceName;
string destName;
#else
nr = ++count;
if (nr == 2532)
{
nr = 2532;
}
#endif // DEBUG
if (tmp != "0000000000000000")
{
sourceName = t.token(2); trimQuotes(sourceName);
guidImpl source = guids.insert(tmp, sourceName);
sourceGUID = source.guid;
atype = source.type;
} else
{
atype = Nil;
}
sourceRaidFlags = asuIntFromHexa(t.token(4));
tmp = t.token(5); // destGUID
destName = t.token(6); trimQuotes(destName);
destFlags = asuIntFromHexa(t.token(7));
destRaidFlags = asuIntFromHexa(t.token(8));
if (destName != "nil")
{
guidImpl dest = guids.insert(tmp, destName);
destGUID = dest.guid;
}
} // wowEvent::wowEvent(tokenizer&t)
示例4: spellAuraRemoved
spellAuraRemovedDose::spellAuraRemovedDose(tokenizer& t) : spellAuraRemoved(t)
{
etype = SPELL_AURA_REMOVED_DOSE;
amount = asInt(t.token(13));
}
示例5: spellAuraApplied
spellAuraAppliedDose::spellAuraAppliedDose(tokenizer& t) : spellAuraApplied(t)
{
etype = SPELL_AURA_APPLIED_DOSE;
amount = asInt(t.token(13));
}
示例6: spellEvent
spellAuraRefresh::spellAuraRefresh(tokenizer& t) : spellEvent(t)
{
etype = SPELL_AURA_REFRESH;
buffOrDebuff = t.token(12);// Contains "BUFF" od "DEBUFF"
}
示例7: savetoDB
bool wowEvent::savetoDB(tokenizer& t, int etype)
{
int rc;
sqlite3_stmt* statement;
list<dbField>::const_iterator it;
dbField dbf;
int ii, hash;
unsigned int ui;
float f;
string s;
dbTable& tbl = dbTables[etype];
statement = tbl.statement;
if (statement == NULL)
{
return false;
}
rc = sqlite3_bind_int64(statement, 1, t.time_ms);
for (it = tbl.fields.begin(); it != tbl.fields.end(); ++it)
{
dbf = *it;
if (dbf.fieldtype == 'H')
{
ui = asuIntFromHexa(t.token(dbf.fieldpos));
rc = sqlite3_bind_int(statement, dbf.fieldpos, ui);
}
else if (dbf.fieldtype == 'I')
{
ii = asInt(t.token(dbf.fieldpos));
rc = sqlite3_bind_int(statement, dbf.fieldpos, ii);
} else if (dbf.fieldtype == 'G')
{
s = t.token(dbf.fieldpos);
trimQuotes(s);
hash = hashString(s.c_str(), s.length());
rc = sqlite3_bind_int(statement, dbf.fieldpos, hash);
}
else if (dbf.fieldtype == 'B')
{
ii = asInt(t.token(dbf.fieldpos));
rc = sqlite3_bind_int(statement, dbf.fieldpos, ii);
} else if (dbf.fieldtype == 'Q')
{
s = t.token(dbf.fieldpos);
trimQuotes(s);
rc = sqlite3_bind_text(statement, dbf.fieldpos, s.c_str(), s.length(), SQLITE_TRANSIENT);
} else if (dbf.fieldtype == 'F')
{
f = asFloat(t.token(dbf.fieldpos));
rc = sqlite3_bind_double(statement, dbf.fieldpos, f);
}
} // for (it = tbl.fields.begin(); it != tbl.fields.end(); ++it)
rc = sqlite3_step(statement);
if ( rc!= SQLITE_DONE)
{
wcout << "Can't step, error: " << sqlite3_errmsg(db) << endl;
}
sqlite3_reset(statement);
// sqlite3_clear_bindings(statement);
return true;
} // bool wowEvent::savetoDB(tokenizer& t, int etype)