LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
Scope.hpp
Go to the documentation of this file.
1/* Copyright 2022 - 2024 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 <memory>
19#include <string>
20
21#include "LIEF/visibility.h"
22
23namespace LIEF {
24namespace dwarf {
25
26namespace details {
27class Scope;
28}
29
33 public:
34 enum class TYPE : uint32_t {
35 UNKNOWN = 0,
36 UNION,
37 CLASS,
38 STRUCT,
39 NAMESPACE,
40 FUNCTION,
41 COMPILATION_UNIT,
42 };
43 Scope(std::unique_ptr<details::Scope> impl);
44
46 std::string name() const;
47
49 std::unique_ptr<Scope> parent() const;
50
52 TYPE type() const;
53
56 std::string chained(const std::string& sep = "::") const;
57
59 private:
60 std::unique_ptr<details::Scope> impl_;
61};
62
63}
64}
65#endif
This class materializes a scope in which Function, Variable, Type, ... can be defined.
Definition Scope.hpp:32
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....
TYPE
Definition Scope.hpp:34
Scope(std::unique_ptr< details::Scope > impl)
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41