当前位置: 首页>>代码示例>>C++>>正文


C++ BStringList::MakeEmpty方法代码示例

本文整理汇总了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;
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:28,代码来源:PathFinder.cpp

示例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;
}
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:70,代码来源:DebugServer.cpp


注:本文中的BStringList::MakeEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。