forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppMakeProperty.cxx
More file actions
122 lines (104 loc) · 2.26 KB
/
cppMakeProperty.cxx
File metadata and controls
122 lines (104 loc) · 2.26 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file cppMakeProperty.cxx
* @author rdb
* @date 2014-09-18
*/
#include "cppMakeProperty.h"
#include "cppFunctionGroup.h"
/**
*
*/
CPPMakeProperty::
CPPMakeProperty(CPPIdentifier *ident, Type type,
CPPScope *current_scope, const CPPFile &file) :
CPPDeclaration(file),
_ident(ident),
_type(type),
_length_function(nullptr),
_has_function(nullptr),
_get_function(nullptr),
_set_function(nullptr),
_clear_function(nullptr),
_del_function(nullptr),
_insert_function(nullptr),
_get_key_function(nullptr)
{
_ident->_native_scope = current_scope;
}
/**
*
*/
std::string CPPMakeProperty::
get_simple_name() const {
return _ident->get_simple_name();
}
/**
*
*/
std::string CPPMakeProperty::
get_local_name(CPPScope *scope) const {
return _ident->get_local_name(scope);
}
/**
*
*/
std::string CPPMakeProperty::
get_fully_scoped_name() const {
return _ident->get_fully_scoped_name();
}
/**
*
*/
void CPPMakeProperty::
output(std::ostream &out, int indent_level, CPPScope *scope, bool complete) const {
if (_length_function != nullptr) {
out << "__make_seq_property";
} else {
out << "__make_property";
}
if (_has_function != nullptr) {
out.put('2');
}
out << "(" << _ident->get_local_name(scope);
if (_length_function != nullptr) {
out << ", " << _length_function->_name;
}
if (_has_function != nullptr) {
out << ", " << _has_function->_name;
}
out << ", " << _get_function->_name;
if (_set_function != nullptr) {
out << ", " << _set_function->_name;
}
if (_clear_function != nullptr) {
out << ", " << _clear_function->_name;
}
if (_del_function != nullptr) {
out << ", " << _del_function->_name;
}
if (_insert_function != nullptr) {
out << ", " << _insert_function->_name;
}
out << ");";
}
/**
*
*/
CPPDeclaration::SubType CPPMakeProperty::
get_subtype() const {
return ST_make_property;
}
/**
*
*/
CPPMakeProperty *CPPMakeProperty::
as_make_property() {
return this;
}