LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
Scope.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2026 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 <string_view>
19#include <cstdint>
20#include <memory>
21#include <string>
22
24#include "LIEF/visibility.h"
25
26
27namespace LIEF::dwarf {
28
29namespace details {
30class Scope;
31}
32
36 public:
37 enum class TYPE : uint32_t {
38 UNKNOWN = 0,
39 UNION,
40 CLASS,
41 STRUCT,
42 NAMESPACE,
43 FUNCTION,
44 COMPILATION_UNIT,
45 };
46 Scope(std::unique_ptr<details::Scope> impl);
47
49 std::string_view name() const LIEF_LIFETIMEBOUND;
50
52 std::unique_ptr<Scope> parent() const LIEF_LIFETIMEBOUND;
53
55 TYPE type() const;
56
59 std::string chained(std::string_view sep = "::") const;
60
62
63 private:
64 std::unique_ptr<details::Scope> impl_;
65};
66
67}
68
69#endif
std::string_view name() const
Name of the scope. For instance namespace's name or function's name.
TYPE type() const
The current scope type.
std::unique_ptr< Scope > parent() const
Parent scope (if any).
std::string chained(std::string_view sep="::") const
Represent the whole chain of all (parent) scopes using the provided separator. E.g....
TYPE
Definition Scope.hpp:37
Scope(std::unique_ptr< details::Scope > impl)
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Definition DWARF/CompilationUnit.hpp:33
Namespace for the DWARF debug format.
Definition DWARF/CompilationUnit.hpp:31
#define LIEF_API
Definition visibility.h:45