#error "OpenWatcom version >= 1.4 is required to compile this code"
#endif
-// include wchar_t definition if needed:
-#if defined(__WATCOMC__)
-#include <inttypes.h>
-#elif defined(__VISUALC__)
-#include <stdlib.h>
-#endif
-
+#include "wx/chartype.h"
class WXDLLIMPEXP_BASE wxCStrData;
class WXDLLIMPEXP_BASE wxString;
// special cases for converting strings:
-// FIXME-UTF8: move this to wxchartype.h!
-#if wxUSE_UNICODE
- /* for now, all Unicode builds are wchar_t* based: */
- #define wxUSE_UNICODE_WCHAR 1
-#else
- #define wxUSE_UNICODE_WCHAR 0
-#endif
-
-// FIXME-UTF8: include wx/wxchartype.h and use wxChar after headers split
-// FIXME-UTF8: this will be char* in UTF-8 build and wchar_t* on Windows
-#if wxUSE_UNICODE_WCHAR
- typedef wchar_t wxArgNativeCharType;
-#else
- typedef char wxArgNativeCharType;
-#endif
-
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxCStrData&>
{
wxArgNormalizer(const wxCStrData& value) : m_value(value) {}
- const wxArgNativeCharType *get() const;
+ const wxChar *get() const; // FIXME-UTF8: should be wxStringCharType
const wxCStrData& m_value;
};
struct WXDLLIMPEXP_BASE wxArgNormalizer<const wxString&>
{
wxArgNormalizer(const wxString& value) : m_value(value) {}
- const wxArgNativeCharType *get() const;
+ const wxChar *get() const; // FIXME-UTF8: should be wxStringCharType
const wxString& m_value;
};
: wxArgNormalizer<const wxString&>(value) {}
};
-#if wxUSE_UNICODE_WCHAR
-
+#if wxUSE_UNICODE // FIXME-UTF8: should be wxUSE_UNICODE_WCHAR
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizer<const char*>
{
wxArgNormalizer(char *value)
: wxArgNormalizer<const char*>(value) {}
};
+#endif // wxUSE_UNICODE_WCHAR
+
+// FIXME-UTF8
+#if 0 // wxUSE_UNICODE_UTF8
+// for conversion from local charset to UTF-8
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<const char*>
+{
+ wxArgNormalizer(const char *value);
+ ~wxArgNormalizer();
+ const char *get() const;
+
+ wxCharBuffer *m_value;
+};
-#elif wxUSE_WCHAR_T // !wxUSE_UNICODE_WCHAR && wxUSE_WCHAR_T
+template<>
+struct wxArgNormalizer<char*> : public wxArgNormalizer<const char*>
+{
+ wxArgNormalizer(char *value)
+ : wxArgNormalizer<const char*>(value) {}
+};
+#endif // wxUSE_UNICODE_UTF8
+#if /*wxUSE_UNICODE_UTF8 || */ !wxUSE_UNICODE // FIXME-UTF8
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizer<const wchar_t*>
{
wxArgNormalizer(wchar_t *value)
: wxArgNormalizer<const wchar_t*>(value) {}
};
+#endif // wxUSE_UNICODE_UTF8 || !wxUSE_UNICODE
+
+// versions for passing wx[W]CharBuffer:
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<wxCharBuffer>
+ : public wxArgNormalizer<const char*>
+{
+ wxArgNormalizer(const wxCharBuffer& buf);
+};
+
+template<>
+struct WXDLLIMPEXP_BASE wxArgNormalizer<wxWCharBuffer>
+ : public wxArgNormalizer<const wchar_t*>
+{
+ wxArgNormalizer(const wxWCharBuffer& buf);
+};
+
-#endif // wxUSE_UNICODE_WCHAR / !wxUSE_UNICODE_WCHAR && wxUSE_WCHAR_T
// NB: The vararg emulation code is limited to 30 arguments at the moment.
// If you need more, you need to