string_convert.h

Go to the documentation of this file.
00001 #ifndef STRING_CONVERSION_GROUP
00002 #define STRING_CONVERSION_GROUP
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : string_convert                                                    *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2007-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include <basis/convert_utf.h>
00019 #include <basis/istring.h>
00020 #include <basis/portable.h>
00021 
00022 #ifdef __WIN32__
00023   #ifndef _MANAGED
00024     #ifndef __MINGW32__
00025       #include <comdef.h>
00026     #endif
00027   #endif
00028 #endif
00029 
00030 // forward.
00031 class _bstr_t;  // ATL (Active Template Library) string type.
00032 
00034 
00035 namespace string_convert
00036 {
00037 
00038 #ifdef _AFXDLL
00040   inline istring to_istring(const CString &original)
00041   { return istring(from_unicode_temp(original)); }
00042 
00044   inline CString to_CString(const istring &original)
00045   { return CString(to_unicode_temp(original)); }
00046 #endif
00047 
00048 #ifdef WIN32
00049  #ifndef _MANAGED
00050    #ifndef __MINGW32__
00052     inline istring to_istring(const _bstr_t &original) {
00053        return istring(istring::UNTERMINATED, (const char *)original,
00054           original.length());
00055     }
00056 
00058     inline _bstr_t to_bstr_t(const istring &original)
00059     { return _bstr_t(original.s()); }
00060    #endif
00061  #endif
00062 #endif
00063 
00064 //other conversions.
00065 
00066 } //namespace
00067 
00068 #endif
00069 

Generated on Fri Nov 21 04:29:59 2008 for HOOPLE Libraries by  doxygen 1.5.1