diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-13 14:55:49 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-27 11:29:45 -0700 |
commit | 9951ad78c80e144c166a7d476cad7ffdf84332a9 (patch) | |
tree | 9f5498a9a3c23b62dc928288e72081e99f958f46 /src/mmo/strs.py | |
parent | 749fec734c4583153fb2dbc80f1d21db2c2ab457 (diff) | |
download | tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.gz tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.bz2 tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.xz tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.zip |
Debug debugging
Diffstat (limited to 'src/mmo/strs.py')
-rw-r--r-- | src/mmo/strs.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/mmo/strs.py b/src/mmo/strs.py new file mode 100644 index 0000000..3e39ef4 --- /dev/null +++ b/src/mmo/strs.py @@ -0,0 +1,35 @@ +for s in [ + 'AccountName', + 'AccountPass', + 'AccountCrypt', + 'AccountEmail', + 'ServerName', + 'PartyName', + 'VarName', + 'MapName', + 'CharName', +]: + class OtherString(object): + __slots__ = ('_value') + name = 'tmwa::%s' % s + enabled = True + + def __init__(self, value): + self._value = value + + def to_string(self): + value = self._value + fields = value.type.fields() + field0 = fields[-1] + return '%s' % value[field0] + + test_extra = ''' + #include "../strings/fwd.hpp" + using tmwa::operator "" _s; + ''' + + tests = [ + ('tmwa::stringish<tmwa::%s>("Hello"_s)' % s, '"Hello"'), + ] + globals()[s] = OtherString + del OtherString |