LLDB mainline
ScriptedInterfaceUsages.cpp
Go to the documentation of this file.
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
10
11using namespace lldb;
12using namespace lldb_private;
13
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 =
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}
const std::vector< llvm::StringRef > & GetCommandInterpreterUsages() const
const std::vector< llvm::StringRef > & GetSBAPIUsages() const
void Dump(Stream &s, UsageKind kind) const
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
Definition: Stream.cpp:157
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
Definition: Stream.cpp:198
void IndentMore(unsigned amount=2)
Increment the current indentation level.
Definition: Stream.cpp:195
A class that represents a running process on the host machine.
Definition: SBAddress.h:15