本文整理汇总了C++中ACE_TString::substring方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_TString::substring方法的具体用法?C++ ACE_TString::substring怎么用?C++ ACE_TString::substring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_TString
的用法示例。
在下文中一共展示了ACE_TString::substring方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool init (const ACE_TCHAR *inst)
{
ACE_TString tmp (inst);
size_t begin = 0;
size_t pos = tmp.find (',', begin);
if (pos != ACE_TString::npos)
path_ = tmp.substring (begin, pos - begin);
else
{
DANCE_ERROR (DANCE_LOG_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Options::Creation::init - ")
ACE_TEXT ("Creation directive missing name, base location, and replace parameters, ")
ACE_TEXT ("must have form path,name,base,replace\n")));
return false;
}
begin = pos + 1;
pos = tmp.find (',', begin);
if (pos != ACE_TString::npos)
name_ = tmp.substring (begin, pos - begin);
else
{
DANCE_ERROR (DANCE_LOG_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Options::Creation::init - ")
ACE_TEXT ("Creation directive mssing base location and replace parameter, ")
ACE_TEXT ("must have form path,name,base,replace\n")));
return false;
}
begin = pos + 1;
pos = tmp.find (',', begin);
if (pos != ACE_TString::npos)
base_location_ = tmp.substring (begin, pos - begin);
else
{
DANCE_ERROR (DANCE_LOG_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Options::Creation::init - ")
ACE_TEXT ("Creation directive mssing replace parameter, ")
ACE_TEXT ("must have form path,name,base,replace\n")));
return false;
}
begin = pos + 1;
if (tmp[begin] == '0') replace_ = false;
else if (tmp[begin] == '1') replace_ = true;
else
{
DANCE_ERROR (DANCE_LOG_ERROR, (LM_ERROR, DLINFO ACE_TEXT ("Options::Creation::init - ")
ACE_TEXT ("Replace directive muse be 1 or 0.\n")));
return false;
}
return true;
}