LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
Scope.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2025 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_DWARF_SCOPE_H
16#define LIEF_DWARF_SCOPE_H
17
18#include <cstdint>
19#include <memory>
20#include <string>
21
22#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace dwarf {
26
27namespace details {
28class Scope;
29}
30class LIEF_API Scope {
34 public:
35 enum class TYPE : uint32_t {
36 UNKNOWN = 0,
37 UNION,
38 CLASS,
39 STRUCT,
40 NAMESPACE,
41 FUNCTION,
42 COMPILATION_UNIT,
43 };
44 Scope(std::unique_ptr<details::Scope> impl);
45 std::string name() const;
48 std::unique_ptr<Scope> parent() const;
51 TYPE type() const;
54 std::string chained(const std::string& sep = "::") const;
58
60 private:
61 std::unique_ptr<details::Scope> impl_;
62};
63
64}
65}
66#endif
This class materializes a scope in which Function, Variable, Type, ... can be defined.
Definition Scope.hpp:33
TYPE type() const
The current scope type.
std::unique_ptr< Scope > parent() const
Parent scope (if any)
std::string name() const
Name of the scope. For instance namespace's name or function's name.
std::string chained(const std::string &sep="::") const
Represent the whole chain of all (parent) scopes using the provided separator. E.g....
Scope(std::unique_ptr< details::Scope > impl)
Definition DWARF/CompilationUnit.hpp:30
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41