diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2010-02-01 21:41:28 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-02-02 18:05:47 -0200 |
commit | 05bfd60c0ca9798b7a2df97104eec2c18d48b268 (patch) | |
tree | 5dde32a9235ed1aa3b2ca4bfe323ca90178b218e /libshiboken | |
parent | 813bc2a8a7b65d273ca3e4f4009041f2923d25de (diff) |
char converter return string instead of int
Only if not specified signed/unsigned
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libshiboken')
-rw-r--r-- | libshiboken/conversions.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libshiboken/conversions.h b/libshiboken/conversions.h index 0cb163441..fd8358e83 100644 --- a/libshiboken/conversions.h +++ b/libshiboken/conversions.h @@ -313,7 +313,13 @@ struct CharConverter template <> struct Converter<unsigned long> : Converter_PyULongInt<unsigned long> {}; template <> struct Converter<unsigned int> : Converter_PyULongInt<unsigned int> {}; -template <> struct Converter<char> : CharConverter<char> {}; +template <> struct Converter<char> : CharConverter<char> { + // Should we really return a string? + using CharConverter<char>::toPython; + static inline PyObject* toPython(const char& cppObj) { + return PyString_FromFormat("%c", cppObj); + } +}; template <> struct Converter<signed char> : CharConverter<signed char> {}; template <> struct Converter<unsigned char> : CharConverter<unsigned char> {}; template <> struct Converter<int> : Converter_PyInt<int> {}; |