aboutsummaryrefslogtreecommitdiffstats
path: root/qface/helper/qtcpp.py
diff options
context:
space:
mode:
authorJuergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com>2017-08-01 13:47:06 +0200
committerJuergen Bocklage-Ryannel <jbocklage-ryannel@luxoft.com>2017-08-01 13:47:06 +0200
commit622669b25ed8798ba45b72e8ec0a59afd3c04d14 (patch)
tree993c2270d26768a421ff722bf2c0dc5e39fb8f0a /qface/helper/qtcpp.py
parenta0d369a124fa70c8df5a539bc6e28c86987f73ad (diff)
Added filters dictionary to standard filters.
Filters can now be batch added using generator.filters.update(filters)
Diffstat (limited to 'qface/helper/qtcpp.py')
-rw-r--r--qface/helper/qtcpp.py27
1 files changed, 18 insertions, 9 deletions
diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py
index a26e9e9..5561fe5 100644
--- a/qface/helper/qtcpp.py
+++ b/qface/helper/qtcpp.py
@@ -3,10 +3,7 @@ Provides helper functionality specificially for Qt C++/QML code generators
"""
import qface.idl.domain as domain
from jinja2 import environmentfilter
-
-def upper_first(s):
- s = str(s)
- return s[0].upper() + s[1:]
+from ..filters import upper_first
class Filters(object):
@@ -183,11 +180,23 @@ class Filters(object):
return str(s).lower().replace('.', '_')
@staticmethod
- def upper_first(s):
- s = str(s)
- return s[0].upper() + s[1:]
-
- @staticmethod
def path(s):
return str(s).replace('.', '/')
+ @staticmethod
+ def get_filters():
+ return {
+ 'defaultValue': Filters.defaultValue,
+ 'returnType': Filters.returnType,
+ 'parameterType': Filters.parameterType,
+ 'open_ns': Filters.open_ns,
+ 'close_ns': Filters.close_ns,
+ 'using_ns': Filters.using_ns,
+ 'ns': Filters.ns,
+ 'signalName': Filters.signalName,
+ 'parameters': Filters.parameters,
+ 'signature': Filters.signature,
+ 'identifier': Filters.identifier,
+ 'path': Filters.path,
+ 'className': Filters.className,
+ }