-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcpp_preprocessor_define.h
More file actions
59 lines (47 loc) · 1.14 KB
/
Copy pathcpp_preprocessor_define.h
File metadata and controls
59 lines (47 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright (C) 2022 Satya Das and CppParser contributors
// SPDX-License-Identifier: MIT
#ifndef BE744AC2_52B3_46C4_A40D_9DB23E75A1F2
#define BE744AC2_52B3_46C4_A40D_9DB23E75A1F2
#include "cppast/cpp_preprocessor.h"
#include <string>
namespace cppast {
enum class CppPreprocessorDefineType
{
RENAME,
NUMBER,
STRING,
CHARACTER,
COMPLEX_DEFN,
};
/**
* @brief A macro definition.
*/
class CppPreprocessorDefine : public CppPreprocessor
{
public:
CppPreprocessorDefine(CppPreprocessorDefineType defType, std::string name, std::string defn = std::string())
: CppPreprocessor(CppPreprocessorType::DEFINE)
, defType_(defType)
, name_(std::move(name))
, defn_(std::move(defn))
{
}
CppPreprocessorDefineType definitionType() const
{
return defType_;
}
const std::string& name() const
{
return name_;
}
const std::string& definition() const
{
return defn_;
}
private:
CppPreprocessorDefineType defType_;
std::string name_;
std::string defn_; ///< This will contain everything after name.
};
} // namespace cppast
#endif /* BE744AC2_52B3_46C4_A40D_9DB23E75A1F2 */