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 
12 #include "lldb/lldb-enumerations.h"
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringRef.h"
15 
16 #include <string>
17 
18 namespace lldb_private {
19 
21 protected:
22  enum Wrapping : bool {
23  Wrap = true,
24  NoWrap = false,
25  };
26 
27 public:
28  bool NeedsWrapping() const { return m_wrap == Wrap; }
29 
30  const char *GetName() const { return m_name.c_str(); }
31 
32 protected:
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 
42 };
43 
44 } // namespace lldb_private
45 
46 #endif
lldb_private::ExpressionSourceCode::GetName
const char * GetName() const
Definition: ExpressionSourceCode.h:30
lldb_private::ExpressionSourceCode::m_name
std::string m_name
Definition: ExpressionSourceCode.h:38
lldb_private::ExpressionSourceCode::m_prefix
std::string m_prefix
Definition: ExpressionSourceCode.h:39
lldb_private::ExpressionSourceCode::ExpressionSourceCode
ExpressionSourceCode(llvm::StringRef name, llvm::StringRef prefix, llvm::StringRef body, Wrapping wrap)
Definition: ExpressionSourceCode.h:33
lldb-enumerations.h
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ExpressionSourceCode::Wrapping
Wrapping
Definition: ExpressionSourceCode.h:22
lldb_private::ExpressionSourceCode
Definition: ExpressionSourceCode.h:20
lldb_private::ExpressionSourceCode::m_wrap
Wrapping m_wrap
Definition: ExpressionSourceCode.h:41
lldb_private::ExpressionSourceCode::NoWrap
@ NoWrap
Definition: ExpressionSourceCode.h:24
lldb_private::ExpressionSourceCode::NeedsWrapping
bool NeedsWrapping() const
Definition: ExpressionSourceCode.h:28
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ExpressionSourceCode::m_body
std::string m_body
Definition: ExpressionSourceCode.h:40
lldb_private::ExpressionSourceCode::Wrap
@ Wrap
Definition: ExpressionSourceCode.h:23