-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathcpp_var_type.cpp
More file actions
45 lines (36 loc) · 1.02 KB
/
Copy pathcpp_var_type.cpp
File metadata and controls
45 lines (36 loc) · 1.02 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
// Copyright (C) 2022 Satya Das and CppParser contributors
// SPDX-License-Identifier: MIT
#include "cppast/cpp_var_type.h"
#include "cppast/cpp_compound.h"
namespace cppast {
CppVarType::CppVarType(std::string baseType, CppTypeModifier modifier)
: CppVarType(std::move(baseType), 0, modifier)
{
}
CppVarType::CppVarType(CppCompound* compound, CppTypeModifier modifier)
: compound_(compound)
, typeModifier_(modifier)
{
}
CppVarType::CppVarType(CppFunctionPointer* compound, CppTypeModifier modifier)
: compound_(compound)
, typeModifier_(modifier)
{
}
CppVarType::CppVarType(CppEnum* enumObj, CppTypeModifier modifier)
: compound_(enumObj)
, typeModifier_(modifier)
{
}
CppVarType::CppVarType(const CppVarType& varType)
: CppVarType(varType.baseType(), varType.typeModifier())
{
// TODO: clone compound_.
}
CppVarType::CppVarType(std::string baseType, std::uint32_t typeAttr, CppTypeModifier modifier)
: baseType_(std::move(baseType))
, typeModifier_(modifier)
, typeAttr_(typeAttr)
{
}
} // namespace cppast