LLDB mainline
ExpressionSourceCode.h
Go to the documentation of this file.
1//===-- ExpressionSourceCode.h ----------------------------------*- C++ -*-===//
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#ifndef LLDB_EXPRESSION_EXPRESSIONSOURCECODE_H
10#define LLDB_EXPRESSION_EXPRESSIONSOURCECODE_H
11
13#include "llvm/ADT/ArrayRef.h"
14#include "llvm/ADT/StringRef.h"
15
16#include <string>
17
18namespace lldb_private {
19
21protected:
22 enum Wrapping : bool {
23 Wrap = true,
24 NoWrap = false,
25 };
26
27public:
28 bool NeedsWrapping() const { return m_wrap == Wrap; }
29
30 const char *GetName() const { return m_name.c_str(); }
31
32protected:
33 ExpressionSourceCode(llvm::StringRef name, llvm::StringRef prefix,
34 llvm::StringRef body, Wrapping wrap)
35 : m_name(name.str()), m_prefix(prefix.str()), m_body(body.str()),
36 m_wrap(wrap) {}
37
38 std::string m_name;
39 std::string m_prefix;
40 std::string m_body;
42};
43
44} // namespace lldb_private
45
46#endif
ExpressionSourceCode(llvm::StringRef name, llvm::StringRef prefix, llvm::StringRef body, Wrapping wrap)
A class that represents a running process on the host machine.