本文整理汇总了C++中StringPimpl::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ StringPimpl::empty方法的具体用法?C++ StringPimpl::empty怎么用?C++ StringPimpl::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringPimpl
的用法示例。
在下文中一共展示了StringPimpl::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAttribute
void Bot::setAttribute(const StringPimpl &name,
const StringPimpl &value)
throw(InternalProgrammerErrorException &)
{
if(name == "name" && (!value.empty()))
{
m_pimpl->m_botPredicateName = value;
}
}
示例2: getRecordTotalCount
int DatabaseManager::getRecordTotalCount(const StringPimpl &key)
{
StringPimpl sizeAsString = getRecord(m_reserved + key + "[email protected][email protected]", true);
if(sizeAsString.empty())
{
return 0;
}
else
{
return sizeAsString.getInteger();
}
}
示例3: setAttribute
void TopicStar::setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &)
{
try
{
if(name == "index" && (!value.empty()))
{
m_pimpl->m_index = value.getInteger();
}
}
catch(NumberFormatException &)
{
//Error, the cast to a numeric value failed
FrameworkFactory *factory = FrameworkFactory::getInstance();
IdentificationManager *ident = IdentificationManager::getInstance();
GraphBuilderFramework *builder = factory->getGraphBuilderFramework();
builder->getCallBacks().topicStarTagNumericConversionError("Index string is not numeric, " + value, ident->getUserId(), ident->getBotId(), ident->getEndUserId());
}
}
示例4: setAttribute
///@todo redo this without annoying tokenizer. Use a for loop
void TemplateSideThat::setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &)
{
if(name == "index" && (!value.empty()))
{
string valueString(value.c_str());
typedef tokenizer<char_separator<char> > tokenize;
typedef tokenizer<char_separator<char> >::const_iterator CI;
char_separator<char> sep(",");
tokenize pathTokens(valueString, sep);
int i = 0;
for(CI it = pathTokens.begin(); it != pathTokens.end(); ++it, ++i)
{
string s;
if(i == 0)
{
try
{
//This is the first index which is a previous bot response
s = *it;
trim(s);
m_pimpl->m_previousBotResponse = lexical_cast<int>(s);
}
catch(bad_lexical_cast &)
{
//User Error, the cast to a numeric value failed
string msg("First index string is not a valid number, ");
msg += s.c_str();
FrameworkFactory *factory = FrameworkFactory::getInstance();
IdentificationManager *ident = IdentificationManager::getInstance();
GraphBuilderFramework *builder = factory->getGraphBuilderFramework();
builder->getCallBacks().thatTagNumericConversionError(msg.c_str(), ident->getUserId(), ident->getBotId(), ident->getEndUserId());
}
}
else if(i == 1)
{
try
{
//This is the second index which is a sentence
s = *it;
trim(s);
m_pimpl->m_sentence = lexical_cast<int>(s);
}
catch(bad_lexical_cast &)
{
string msg("Second index string is not a valid number, ");
msg += s.c_str();
FrameworkFactory *factory = FrameworkFactory::getInstance();
IdentificationManager *ident = IdentificationManager::getInstance();
GraphBuilderFramework *builder = factory->getGraphBuilderFramework();
builder->getCallBacks().thatTagNumericConversionError(msg.c_str(), ident->getUserId(), ident->getBotId(), ident->getEndUserId());
//User Error, the cast to a numeric value failed
}
}
else
{
//User error, the i index is past 2
FrameworkFactory *factory = FrameworkFactory::getInstance();
IdentificationManager *ident = IdentificationManager::getInstance();
GraphBuilderFramework *builder = factory->getGraphBuilderFramework();
builder->getCallBacks().thatTagNumericConversionError("The index is past 2", ident->getUserId(), ident->getBotId(), ident->getEndUserId());
}
}
}
}