os/ossrv/genericopenlibs/cppstdlib/stl/src/string.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/src/string.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,102 @@
     1.4 +#include "stlport_prefix.h"
     1.5 +
     1.6 +#include <string>
     1.7 +
     1.8 +_STLP_BEGIN_NAMESPACE
     1.9 +
    1.10 +#if defined(_STLP_USE_WIDE_INTERFACE)
    1.11 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.12 +
    1.13 +wstring __ASCIIToWide(const char *ascii) {
    1.14 +    size_t size = strlen(ascii);
    1.15 +    wchar_t* buff = new wchar_t[size+1];
    1.16 +    mbstowcs(buff, ascii, size);
    1.17 +    buff[size] = 0x00;
    1.18 +    wstring ret(buff);
    1.19 +    delete[] buff;
    1.20 +    return ret;
    1.21 +}
    1.22 +string __WideToASCII(const wchar_t *wide) {
    1.23 +    size_t size = wcslen(wide);
    1.24 +    char* buff = new char[size+1];
    1.25 +    wcstombs(buff, wide, size);
    1.26 +    buff[size] = 0;
    1.27 +    string ret(buff);
    1.28 +    delete[] buff;
    1.29 +    return ret;
    1.30 +}
    1.31 +_STLP_MOVE_TO_STD_NAMESPACE
    1.32 +#endif
    1.33 +
    1.34 +#if !defined (_STLP_NO_FORCE_INSTANTIATE)
    1.35 +
    1.36 +template class _STLP_CLASS_DECLSPEC allocator<char>;
    1.37 +
    1.38 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.39 +
    1.40 +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy<char*, char, allocator<char> >;
    1.41 +template class _STLP_CLASS_DECLSPEC _String_base<char, allocator<char> >;
    1.42 +
    1.43 +#  if defined (_STLP_DEBUG) && !defined (__SUNPRO_CC)
    1.44 +
    1.45 +#    if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
    1.46 +#      define basic_string _STLP_NON_DBG_NO_MEM_T_NAME(str)
    1.47 +#    else
    1.48 +#      define basic_string _STLP_NON_DBG_NAME(str)
    1.49 +#    endif
    1.50 +
    1.51 +template class _STLP_CLASS_DECLSPEC basic_string<char, char_traits<char>, allocator<char> >;
    1.52 +template class _STLP_CLASS_DECLSPEC __construct_checker<basic_string<char, char_traits<char>, allocator<char> > >;
    1.53 +
    1.54 +#    undef basic_string
    1.55 +#  endif
    1.56 +
    1.57 +#  if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
    1.58 +#    define basic_string _STLP_NO_MEM_T_NAME(str)
    1.59 +#  else
    1.60 +_STLP_MOVE_TO_STD_NAMESPACE
    1.61 +#  endif
    1.62 +
    1.63 +template class _STLP_CLASS_DECLSPEC basic_string<char, char_traits<char>, allocator<char> >;
    1.64 +
    1.65 +#  if defined (basic_string)
    1.66 +_STLP_MOVE_TO_STD_NAMESPACE
    1.67 +#    undef basic_string
    1.68 +#  endif
    1.69 +
    1.70 +#  if !defined (_STLP_NO_WCHAR_T)
    1.71 +template class _STLP_CLASS_DECLSPEC allocator<wchar_t>;
    1.72 +
    1.73 +_STLP_MOVE_TO_PRIV_NAMESPACE
    1.74 +
    1.75 +template class _STLP_CLASS_DECLSPEC _String_base<wchar_t, allocator<wchar_t> >;
    1.76 +
    1.77 +#    if defined (_STLP_DEBUG) && !defined (__SUNPRO_CC)
    1.78 +#      if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
    1.79 +#        define basic_string _STLP_NON_DBG_NO_MEM_T_NAME(str)
    1.80 +#      else
    1.81 +#        define basic_string _STLP_NON_DBG_NAME(str)
    1.82 +#      endif
    1.83 +
    1.84 +template class _STLP_CLASS_DECLSPEC basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
    1.85 +template class _STLP_CLASS_DECLSPEC __construct_checker<basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > >;
    1.86 +
    1.87 +#      undef basic_string
    1.88 +#    endif
    1.89 +
    1.90 +#    if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND)
    1.91 +#      define basic_string _STLP_NO_MEM_T_NAME(str)
    1.92 +#    else
    1.93 +_STLP_MOVE_TO_STD_NAMESPACE
    1.94 +#    endif
    1.95 +
    1.96 +template class _STLP_CLASS_DECLSPEC basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
    1.97 +
    1.98 +#    if defined (basic_string)
    1.99 +_STLP_MOVE_TO_STD_NAMESPACE
   1.100 +#      undef basic_string
   1.101 +#    endif
   1.102 +#  endif
   1.103 +#endif
   1.104 +
   1.105 +_STLP_END_NAMESPACE