diff options
author | Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com> | 2017-04-04 12:34:00 +0200 |
---|---|---|
committer | Juergen Bocklage-Ryannel <juergen.bocklage-ryannel@pelagicore.com> | 2017-04-04 12:34:00 +0200 |
commit | 1496c73920d2749b191fcd9eb79a1de11364c1d2 (patch) | |
tree | ac4458dfb8c020261f18c885c3ac1f9928c38a1c /qface/helper | |
parent | 8db91c520e2c18144edc2af28cb25d5c4259f542 (diff) |
updated namespace filters to support also using a namespace
Diffstat (limited to 'qface/helper')
-rw-r--r-- | qface/helper/qtcpp.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qface/helper/qtcpp.py b/qface/helper/qtcpp.py index 213abfe..7e8f3ca 100644 --- a/qface/helper/qtcpp.py +++ b/qface/helper/qtcpp.py @@ -107,12 +107,18 @@ class Filters(object): @staticmethod def open_ns(symbol): - # 'namespace x { y {' + ''' generates a open namespace from symbol namespace x { y { z {''' blocks = ['{0} {{'.format(x) for x in symbol.module.name_parts] return 'namespace {0}'.format(str.join(' ', blocks)) @staticmethod def close_ns(symbol): - # '} }' + '''generates a closing names statement from a symbol''' return ' '.join(['}' for x in symbol.module.name_parts]) + @staticmethod + def using_ns(symbol): + '''generates a using namespace x::y::z statement from a symbol''' + id = '::'.join(symbol.module.name_parts) + return 'using namespace {0}'.format(id) + |