本文整理汇总了C++中firebird::PathName::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::erase方法的具体用法?C++ PathName::erase怎么用?C++ PathName::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类firebird::PathName
的用法示例。
在下文中一共展示了PathName::erase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: splitPrefix
void PathUtils::splitPrefix(Firebird::PathName& path, Firebird::PathName& prefix)
{
prefix.erase();
while (path.hasData() && path[0] == dir_sep)
{
prefix = dir_sep;
path.erase(0, 1);
}
}
示例2: splitLastComponent
void PathUtils::splitLastComponent(Firebird::PathName& path, Firebird::PathName& file,
const Firebird::PathName& orgPath)
{
Firebird::PathName::size_type pos = orgPath.rfind(dir_sep);
if (pos == Firebird::PathName::npos)
{
path = "";
file = orgPath;
return;
}
path.erase();
path.append(orgPath, 0, pos); // skip the directory separator
file.erase();
file.append(orgPath, pos + 1, orgPath.length() - pos - 1);
}
示例3: splitLastComponent
void PathUtils::splitLastComponent(Firebird::PathName& path, Firebird::PathName& file,
const Firebird::PathName& orgPath)
{
Firebird::PathName::size_type pos = orgPath.rfind(PathUtils::dir_sep);
if (pos == Firebird::PathName::npos)
{
pos = orgPath.rfind('/'); // temp hack to make it work with paths,
// not expanded by ISC_expand_filename
if (pos == Firebird::PathName::npos)
{
path = "";
file = orgPath;
return;
}
}
path.erase();
path.append(orgPath, 0, pos); // skip the directory separator
file.erase();
file.append(orgPath, pos + 1, orgPath.length() - pos - 1);
}