Path: blob/main/contrib/llvm-project/lldb/source/Interpreter/Interfaces/ScriptedInterfaceUsages.cpp
213799 views
//===-- ScriptedInterfaceUsages.cpp --------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Interpreter/Interfaces/ScriptedInterfaceUsages.h"910using namespace lldb;11using namespace lldb_private;1213void ScriptedInterfaceUsages::Dump(Stream &s, UsageKind kind) const {14s.IndentMore();15s.Indent();16llvm::StringRef usage_kind =17(kind == UsageKind::CommandInterpreter) ? "Command Interpreter" : "API";18s << usage_kind << " Usages:";19const std::vector<llvm::StringRef> &usages =20(kind == UsageKind::CommandInterpreter) ? GetCommandInterpreterUsages()21: GetSBAPIUsages();22if (usages.empty())23s << " None\n";24else if (usages.size() == 1)25s << " " << usages.front() << '\n';26else {27s << '\n';28for (llvm::StringRef usage : usages) {29s.IndentMore();30s.Indent();31s << usage << '\n';32s.IndentLess();33}34}35s.IndentLess();36}373839