diff -r e20de85af2ee -r ce057bb09d0b genericopenlibs/cppstdlib/stl/src/string.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genericopenlibs/cppstdlib/stl/src/string.cpp Fri Jun 04 16:20:51 2010 +0100 @@ -0,0 +1,119 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "stlport_prefix.h" + +#include + +_STLP_BEGIN_NAMESPACE + +#if defined(_STLP_USE_WIDE_INTERFACE) +_STLP_MOVE_TO_PRIV_NAMESPACE + +wstring __ASCIIToWide(const char *ascii) { + size_t size = strlen(ascii); + wchar_t* buff = new wchar_t[size+1]; + mbstowcs(buff, ascii, size); + buff[size] = 0x00; + wstring ret(buff); + delete[] buff; + return ret; +} +string __WideToASCII(const wchar_t *wide) { + size_t size = wcslen(wide); + char* buff = new char[size+1]; + wcstombs(buff, wide, size); + buff[size] = 0; + string ret(buff); + delete[] buff; + return ret; +} +_STLP_MOVE_TO_STD_NAMESPACE +#endif + +#if !defined (_STLP_NO_FORCE_INSTANTIATE) + +template class _STLP_CLASS_DECLSPEC allocator; + +_STLP_MOVE_TO_PRIV_NAMESPACE + +template class _STLP_CLASS_DECLSPEC _STLP_alloc_proxy >; +template class _STLP_CLASS_DECLSPEC _String_base >; + +# if defined (_STLP_DEBUG) && !defined (__SUNPRO_CC) + +# if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) +# define basic_string _STLP_NON_DBG_NO_MEM_T_NAME(str) +# else +# define basic_string _STLP_NON_DBG_NAME(str) +# endif + +template class _STLP_CLASS_DECLSPEC basic_string, allocator >; +template class _STLP_CLASS_DECLSPEC __construct_checker, allocator > >; + +# undef basic_string +# endif + +# if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) +# define basic_string _STLP_NO_MEM_T_NAME(str) +# else +_STLP_MOVE_TO_STD_NAMESPACE +# endif + +template class _STLP_CLASS_DECLSPEC basic_string, allocator >; + +# if defined (basic_string) +_STLP_MOVE_TO_STD_NAMESPACE +# undef basic_string +# endif + +# if !defined (_STLP_NO_WCHAR_T) +template class _STLP_CLASS_DECLSPEC allocator; + +_STLP_MOVE_TO_PRIV_NAMESPACE + +template class _STLP_CLASS_DECLSPEC _String_base >; + +# if defined (_STLP_DEBUG) && !defined (__SUNPRO_CC) +# if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) +# define basic_string _STLP_NON_DBG_NO_MEM_T_NAME(str) +# else +# define basic_string _STLP_NON_DBG_NAME(str) +# endif + +template class _STLP_CLASS_DECLSPEC basic_string, allocator >; +template class _STLP_CLASS_DECLSPEC __construct_checker, allocator > >; + +# undef basic_string +# endif + +# if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) +# define basic_string _STLP_NO_MEM_T_NAME(str) +# else +_STLP_MOVE_TO_STD_NAMESPACE +# endif + +template class _STLP_CLASS_DECLSPEC basic_string, allocator >; + +# if defined (basic_string) +_STLP_MOVE_TO_STD_NAMESPACE +# undef basic_string +# endif +# endif +#endif + +_STLP_END_NAMESPACE