UnicodeString.h

Go to the documentation of this file.
00001 /*
00002  *  BEEN: Benchmarking Environment
00003  *  ==============================
00004  *
00005  *  File author: Branislav Repcek
00006  *
00007  *  GNU Lesser General Public License Version 2.1
00008  *  ---------------------------------------------
00009  *  Copyright (C) 2004-2006 Distributed Systems Research Group,
00010  *  Faculty of Mathematics and Physics, Charles University in Prague
00011  *
00012  *  This library is free software; you can redistribute it and/or
00013  *  modify it under the terms of the GNU Lesser General Public
00014  *  License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *  This library is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *  Lesser General Public License for more details.
00020  *
00021  *  You should have received a copy of the GNU Lesser General Public
00022  *  License along with this library; if not, write to the Free Software
00023  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *  MA  02111-1307  USA
00025  */
00026 
00034 #ifndef UNI_STRING_H_INCLUDED
00035 #define UNI_STRING_H_INCLUDED
00036 
00037 #include <string>
00038 #include <sstream>
00039 #include <fstream>
00040 
00041 namespace hwdet
00042 {
00043 
00044 // Test if we are compiling unicode application
00045 #if defined UNICODE && defined _WINDOWS
00046     // we are compiling as unicode
00047 
00049     typedef ::std::wstring String;
00050 
00052     typedef ::std::wstringstream StringStream;
00053 
00055     typedef ::std::wistringstream IStringStream;
00056 
00058     typedef ::std::wostringstream OStringStream;
00059 
00061     typedef ::std::wfstream FStream;
00062 
00064     typedef ::std::wifstream IFStream;
00065 
00067     typedef ::std::wofstream OFStream;
00068 
00070     typedef ::std::wistream IStream;
00071 
00073     typedef ::std::wostream OStream;
00074 
00076     typedef ::std::wiostream IOStream;
00077 
00079     extern std::wostream &Cout;
00080 
00082     extern std::wostream &Cerr;
00083 
00085     extern std::wistream &Cin;
00086 
00088     typedef wchar_t Char;
00089 
00091     #define TXT(text) L##text
00092 
00093 #else
00094     // non-unicode compilation
00095 
00097     typedef ::std::string String;
00098 
00100     typedef ::std::stringstream StringStream;
00101 
00103     typedef ::std::istringstream IStringStream;
00104 
00106     typedef ::std::ostringstream OStringStream;
00107 
00109     typedef ::std::fstream FStream;
00110 
00112     typedef ::std::ifstream IFStream;
00113 
00115     typedef ::std::ofstream OFStream;
00116 
00118     typedef ::std::ostream OStream;
00119 
00121     typedef ::std::istream IStream;
00122 
00124     typedef ::std::iostream IOStream;
00125 
00127     extern std::ostream &Cout;
00128 
00130     extern std::ostream &Cerr;
00131 
00133     extern std::istream &Cin;
00134 
00136     typedef char Char;
00137 
00139     #define TXT(text) text
00140 
00141 #endif
00142 
00143 #ifdef _WINDOWS
00144     // Following methods will work only on Windows.
00145 
00146 
00148     std::string Win_UnicodeToANSI(std::wstring unicode);
00149 
00151     std::wstring Win_ANSIToUnicode(std::string ansi);
00152 #endif
00153 
00154 } // namespace hwdet
00155 
00156 #endif

Generated on Tue Dec 19 17:43:52 2006 for Detector for Windows by  doxygen 1.4.7