From: David Elliott Date: Sat, 7 Jul 2007 18:09:11 +0000 (+0000) Subject: Add factory functions for use with future unit tests. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/ec0114abef6ee06425ec5bd423cf496271c086dd Add factory functions for use with future unit tests. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/corefoundation/strconv_cf.cpp b/src/mac/corefoundation/strconv_cf.cpp index 94cb8f34af..1aad21c298 100644 --- a/src/mac/corefoundation/strconv_cf.cpp +++ b/src/mac/corefoundation/strconv_cf.cpp @@ -29,6 +29,33 @@ // CoreFoundation conversion classes // ============================================================================ +/* Provide factory functions for unit tests. Not in any header. Do not + * assume ABI compatibility even within a given wxWidgets release. + */ + +WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf( const char* name) +{ + wxMBConv_cf *result = new wxMBConv_cf(name); + if(!result->IsOk()) + { + delete result; + return NULL; + } + else + return result; +} + +WXDLLIMPEXP_BASE wxMBConv* new_wxMBConv_cf(wxFontEncoding encoding) +{ + wxMBConv_cf *result = new wxMBConv_cf(encoding); + if(!result->IsOk()) + { + delete result; + return NULL; + } + else + return result; +} #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 // Provide a constant for the wchat_t encoding used by the host platform.