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

source code of lldb/source/Interpreter/Interfaces/ScriptedInterfaceUsages.cpp