当前位置: 首页>>代码示例>>C++>>正文


C++ tokenizer::token方法代码示例

本文整理汇总了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));
}
开发者ID:alhunor,项目名称:projects,代码行数:7,代码来源:events.cpp

示例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));
}
开发者ID:alhunor,项目名称:projects,代码行数:13,代码来源:events.cpp

示例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)
开发者ID:alhunor,项目名称:projects,代码行数:38,代码来源:events.cpp

示例4: spellAuraRemoved

spellAuraRemovedDose::spellAuraRemovedDose(tokenizer& t) : spellAuraRemoved(t)
{
	etype = SPELL_AURA_REMOVED_DOSE;
	amount = asInt(t.token(13));
}
开发者ID:alhunor,项目名称:projects,代码行数:5,代码来源:events.cpp

示例5: spellAuraApplied

spellAuraAppliedDose::spellAuraAppliedDose(tokenizer& t) : spellAuraApplied(t)
{
	etype = SPELL_AURA_APPLIED_DOSE;
	amount = asInt(t.token(13));
}
开发者ID:alhunor,项目名称:projects,代码行数:5,代码来源:events.cpp

示例6: spellEvent

spellAuraRefresh::spellAuraRefresh(tokenizer& t) : spellEvent(t)
{
	etype = SPELL_AURA_REFRESH;
	buffOrDebuff = t.token(12);// Contains "BUFF" od "DEBUFF"
}
开发者ID:alhunor,项目名称:projects,代码行数:5,代码来源:events.cpp

示例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)
开发者ID:alhunor,项目名称:projects,代码行数:64,代码来源:events.cpp


注:本文中的tokenizer::token方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。