本文整理汇总了C++中Tokens::parse方法的典型用法代码示例。如果您正苦于以下问题:C++ Tokens::parse方法的具体用法?C++ Tokens::parse怎么用?C++ Tokens::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tokens
的用法示例。
在下文中一共展示了Tokens::parse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PREPARSE_execute
/**
PREPARSE_execute
@brief
@param status
@param ptrAtt
@param stmt_length
@param stmt
@param stmt_eaten
@param dialect
**/
bool PREPARSE_execute(CheckStatusWrapper* status, Why::YAttachment** ptrAtt,
USHORT stmt_length, const SCHAR* stmt, bool* stmt_eaten, USHORT dialect)
{
// no use creating separate pool for a couple of strings
ContextPoolHolder context(getDefaultMemoryPool());
try
{
if (!stmt)
{
Arg::Gds(isc_command_end_err).raise();
}
Tokens tks;
tks.quotes(quotes);
tks.parse(stmt_length, stmt);
unsigned pos = 0;
if (getToken(pos, tks) != pp_symbols[PP_CREATE].symbol)
{
return false;
}
NoCaseString token(getToken(pos, tks));
if (token != pp_symbols[PP_DATABASE].symbol && token != pp_symbols[PP_SCHEMA].symbol)
{
return false;
}
PathName file_name(getToken(pos, tks, STRING).ToPathName());
*stmt_eaten = false;
ClumpletWriter dpb(ClumpletReader::Tagged, MAX_DPB_SIZE, isc_dpb_version1);
dpb.insertByte(isc_dpb_overwrite, 0);
dpb.insertInt(isc_dpb_sql_dialect, dialect);
SLONG page_size = 0;
bool matched;
do {
try
{
token = getToken(pos, tks);
}
catch (const Exception&)
{
*stmt_eaten = true;
break;
}
matched = false;
for (int i = 3; pp_symbols[i].symbol[0] && !matched; i++)
{
if (token == pp_symbols[i].symbol)
{
// CVC: What's strange, this routine doesn't check token.length()
// but it proceeds blindly, trying to exhaust the token itself.
switch (pp_symbols[i].code)
{
case PP_PAGE_SIZE:
case PP_PAGESIZE:
token = getToken(pos, tks);
if (token == "=")
token = getToken(pos, tks, NUMERIC);
page_size = atol(token.c_str());
dpb.insertInt(isc_dpb_page_size, page_size);
matched = true;
break;
case PP_USER:
token = getToken(pos, tks);
dpb.insertString(isc_dpb_user_name, token.ToString());
matched = true;
break;
case PP_PASSWORD:
token = getToken(pos, tks, STRING);
dpb.insertString(isc_dpb_password, token.ToString());
matched = true;
break;
case PP_ROLE:
token = getToken(pos, tks);
//.........这里部分代码省略.........