summaryrefslogtreecommitdiff
path: root/apps/EnumUtils/enumutils_describe.py
diff options
context:
space:
mode:
authorKargatum <dowlandtop@yandex.com>2021-06-01 22:58:01 +0700
committerGitHub <noreply@github.com>2021-06-01 17:58:01 +0200
commit584b8d908e378e47c88f75da7bbcf0c3948ba94d (patch)
tree20e20b5bc6d4e476dee972ba8ed4a261c92f2b2e /apps/EnumUtils/enumutils_describe.py
parentd398c34c617bfa2460865eac37091d0aabc9555b (diff)
feat(Core/Apps): add support dynamic lib for EnumUtils (#6120)
Diffstat (limited to 'apps/EnumUtils/enumutils_describe.py')
-rw-r--r--apps/EnumUtils/enumutils_describe.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/EnumUtils/enumutils_describe.py b/apps/EnumUtils/enumutils_describe.py
index 4154fdaff9..18946350de 100644
--- a/apps/EnumUtils/enumutils_describe.py
+++ b/apps/EnumUtils/enumutils_describe.py
@@ -36,7 +36,7 @@ def processFile(path, filename):
if input is None:
print('Failed to open %s.h' % filename)
return
-
+
file = input.read()
enums = []
@@ -46,22 +46,22 @@ def processFile(path, filename):
values = []
for value in EnumValuesPattern.finditer(enum.group(3)):
valueData = value.group(0)
-
+
valueNameMatch = EnumValueNamePattern.search(valueData)
if valueNameMatch is None:
if EnumValueSkipLinePattern.search(valueData) is None:
print('Name of value not found: %s' % repr(valueData))
continue
valueName = valueNameMatch.group(1)
-
+
valueCommentMatch = EnumValueCommentPattern.search(valueData)
valueComment = None
if valueCommentMatch:
valueComment = valueCommentMatch.group(1)
-
+
valueTitle = None
valueDescription = None
-
+
if valueComment is not None:
if CommentSkipFormat.match(valueComment) is not None:
continue
@@ -71,20 +71,20 @@ def processFile(path, filename):
valueDescription = commentMatch.group(6)
else:
valueDescription = valueComment
-
+
if valueTitle is None:
valueTitle = valueName
if valueDescription is None:
valueDescription = ''
-
+
values.append((valueName, valueTitle, valueDescription))
-
+
enums.append((prefix + name, prefix, values))
print('%s.h: Enum %s parsed with %d values' % (filename, name, len(values)))
-
+
if not enums:
return
-
+
print('Done parsing %s.h (in %s)\n' % (filename, path))
output = open('%s/enuminfo_%s.cpp' % (path, filename), 'w')
if output is None:
@@ -107,7 +107,7 @@ def processFile(path, filename):
output.write('|* ' + tag + ' *|\n')
output.write('\\*' + ('*'*(len(tag)+2)) + '*/\n')
output.write('template <>\n')
- output.write('EnumText EnumUtils<%s>::ToString(%s value)\n' % (name, name))
+ output.write('AC_API_EXPORT EnumText EnumUtils<%s>::ToString(%s value)\n' % (name, name))
output.write('{\n')
output.write(' switch (value)\n')
output.write(' {\n')
@@ -118,10 +118,10 @@ def processFile(path, filename):
output.write('}\n')
output.write('\n')
output.write('template <>\n')
- output.write('size_t EnumUtils<%s>::Count() { return %d; }\n' % (name, len(values)))
+ output.write('AC_API_EXPORT size_t EnumUtils<%s>::Count() { return %d; }\n' % (name, len(values)))
output.write('\n')
output.write('template <>\n')
- output.write('%s EnumUtils<%s>::FromIndex(size_t index)\n' % (name, name))
+ output.write('AC_API_EXPORT %s EnumUtils<%s>::FromIndex(size_t index)\n' % (name, name))
output.write('{\n')
output.write(' switch (index)\n')
output.write(' {\n')
@@ -132,7 +132,7 @@ def processFile(path, filename):
output.write('}\n')
output.write('\n')
output.write('template <>\n')
- output.write('size_t EnumUtils<%s>::ToIndex(%s value)\n' % (name, name))
+ output.write('AC_API_EXPORT size_t EnumUtils<%s>::ToIndex(%s value)\n' % (name, name))
output.write('{\n')
output.write(' switch (value)\n')
output.write(' {\n')