aboutsummaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-02-01 21:41:28 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-02-02 18:05:47 -0200
commit05bfd60c0ca9798b7a2df97104eec2c18d48b268 (patch)
tree5dde32a9235ed1aa3b2ca4bfe323ca90178b218e /libshiboken
parent813bc2a8a7b65d273ca3e4f4009041f2923d25de (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.h8
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> {};