forked from pocoproject/poco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariable.h
More file actions
94 lines (68 loc) · 1.68 KB
/
Variable.h
File metadata and controls
94 lines (68 loc) · 1.68 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//
// Variable.h
//
// $Id: //poco/1.4/CppParser/include/Poco/CppParser/Variable.h#1 $
//
// Library: CppParser
// Package: SymbolTable
// Module: Variable
//
// Definition of the Variable class.
//
// Copyright (c) 2006, Applied Informatics Software Engineering GmbH.
// and Contributors.
//
// SPDX-License-Identifier: BSL-1.0
//
#ifndef CppParser_Variable_INCLUDED
#define CppParser_Variable_INCLUDED
#include "Poco/CppParser/CppParser.h"
#include "Poco/CppParser/Decl.h"
namespace Poco {
namespace CppParser {
class CppParser_API Variable: public Decl
/// This class represents (member) variable declaration.
{
public:
enum Flags
{
VAR_STATIC = 1, /// The variable is static.
VAR_MUTABLE = 2, /// The variable is mutable.
VAR_VOLATILE = 4, /// The variable is volatile.
VAR_CONST = 8 /// The variable is const.
};
Variable(const std::string& decl, NameSpace* pNameSpace);
/// Creates the Variable.
~Variable();
/// Destroys the Variable.
int flags() const;
/// Returns the variable's flags.
bool isPointer() const;
/// Returns true iff the variable holds a pointer.
Symbol::Kind kind() const;
const std::string& declType() const;
/// Returns the type of the parameter without const and & if present.
///
/// Example: a type const std::string& -> std::string, a type const std::string* returns std::string
private:
int _flags;
bool _isPointer;
std::string _type;
};
//
// inlines
//
inline int Variable::flags() const
{
return _flags;
}
inline bool Variable::isPointer() const
{
return _isPointer;
}
inline const std::string& Variable::declType() const
{
return _type;
}
} } // namespace Poco::CppParser
#endif // CppParser_Variable_INCLUDED