本文整理汇总了C++中BStringList::MakeEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ BStringList::MakeEmpty方法的具体用法?C++ BStringList::MakeEmpty怎么用?C++ BStringList::MakeEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BStringList
的用法示例。
在下文中一共展示了BStringList::MakeEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pathArrayDeleter
/*static*/ status_t
BPathFinder::FindPaths(const char* architecture,
path_base_directory baseDirectory, const char* subPath, uint32 flags,
BStringList& _paths)
{
_paths.MakeEmpty();
// get the paths
char** pathArray;
size_t pathCount;
status_t error = find_paths_etc(architecture, baseDirectory, subPath, flags,
&pathArray, &pathCount);
if (error != B_OK)
return error;
MemoryDeleter pathArrayDeleter(pathArray);
// add them to BStringList
for (size_t i = 0; i < pathCount; i++) {
BString path(pathArray[i]);
if (path.IsEmpty() || !_paths.Add(path)) {
_paths.MakeEmpty();
return B_NO_MEMORY;
}
}
return B_OK;
}
示例2: strerror
status_t
TeamDebugHandler::_SetupGDBArguments(BStringList &arguments, bool usingConsoled)
{
// prepare the argument vector
BString teamString;
teamString.SetToFormat("--pid=%" B_PRId32, fTeam);
status_t error;
BPath terminalPath;
if (usingConsoled) {
error = find_directory(B_SYSTEM_BIN_DIRECTORY, &terminalPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-bin directory: %s\n",
strerror(error));
return error;
}
error = terminalPath.Append("consoled");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-bin path: %s\n",
strerror(error));
return error;
}
} else {
error = find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-apps directory: %s\n",
strerror(error));
return error;
}
error = terminalPath.Append("Terminal");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-apps path: %s\n",
strerror(error));
return error;
}
}
arguments.MakeEmpty();
if (!arguments.Add(terminalPath.Path()))
return B_NO_MEMORY;
if (!usingConsoled) {
BString windowTitle;
windowTitle.SetToFormat("Debug of Team %" B_PRId32 ": %s", fTeam,
_LastPathComponent(fExecutablePath));
if (!arguments.Add("-t") || !arguments.Add(windowTitle))
return B_NO_MEMORY;
}
BPath gdbPath;
error = find_directory(B_SYSTEM_BIN_DIRECTORY, &gdbPath);
if (error != B_OK) {
debug_printf("debug_server: can't find system-bin directory: %s\n",
strerror(error));
return error;
}
error = gdbPath.Append("gdb");
if (error != B_OK) {
debug_printf("debug_server: can't append to system-bin path: %s\n",
strerror(error));
return error;
}
if (!arguments.Add(gdbPath.Path()) || !arguments.Add(teamString))
return B_NO_MEMORY;
if (strlen(fExecutablePath) > 0 && !arguments.Add(fExecutablePath))
return B_NO_MEMORY;
return B_OK;
}