本文整理汇总了C++中firebird::PathName::append方法的典型用法代码示例。如果您正苦于以下问题:C++ PathName::append方法的具体用法?C++ PathName::append怎么用?C++ PathName::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类firebird::PathName
的用法示例。
在下文中一共展示了PathName::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: concatPath
void PathUtils::concatPath(Firebird::PathName& result,
const Firebird::PathName& first,
const Firebird::PathName& second)
{
if (second.length() == 0)
{
result = first;
return;
}
if (first.length() == 0)
{
result = second;
return;
}
if (first[first.length() - 1] != dir_sep &&
second[0] != dir_sep)
{
result = first + dir_sep + second;
return;
}
if (first[first.length() - 1] == dir_sep &&
second[0] == dir_sep)
{
result = first;
result.append(second, 1, second.length() - 1);
return;
}
result = first + second;
}
示例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);
}