Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63037065
class_dumper.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 17, 08:29
Size
803 B
Mime Type
text/x-python
Expires
Sun, May 19, 08:29 (2 d)
Engine
blob
Format
Raw Data
Handle
17723870
Attached To
R1692 code_skeleton
class_dumper.py
View Options
from
class_reader
import
ClassReader
class
ClassDumper
:
def
__init__
(
self
):
self
.
base_types
=
[
'int'
,
'double'
,
'float'
,
'unsigned int'
]
self
.
base_types
=
self
.
base_types
+
[
e
+
' *'
for
e
in
self
.
base_types
]
+
[
e
+
' &'
for
e
in
self
.
base_types
]
def
dump
(
self
,
class_file
):
cls_reader
=
ClassReader
()
classes
=
cls_reader
.
read
(
class_file
)
sstr
=
""
for
c
in
classes
:
sstr
+=
self
.
dumpFile
(
c
)
return
sstr
raise
Exception
(
'pure virtual function'
)
def
dumpFile
(
self
,
c
):
raise
Exception
(
'pure virtual function'
)
def
baseType
(
self
,
_type
):
temp_type
=
_type
.
replace
(
'&'
,
''
)
temp_type
=
temp_type
.
replace
(
'*'
,
''
)
temp_type
=
temp_type
.
strip
()
return
temp_type
Event Timeline
Log In to Comment