The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
unicode.h
Go to the documentation of this file.
1 /*
2  * Dune D3D library - Tobias Alexander Franke 2011
3  * For copyright and license see LICENSE
4  * http://www.tobias-franke.eu
5  */
6 
9 #ifndef DUNE_UNICODE
10 #define DUNE_UNICODE
11 
12 #include <string>
13 #include <iostream>
14 #include <sstream>
15 #include <fstream>
16 
17 namespace dune
18 {
19  #ifdef UNICODE
20 
21  typedef std::wstring tstring;
22  typedef std::wifstream tifstream;
23  typedef std::wofstream tofstream;
24  typedef std::wstringstream tstringstream;
25  #define tcerr std::wcerr
26  #define tclog std::wclog
27  #define tcout std::wcout
28 
29  tstring to_tstring(const std::string& str);
30  std::string to_string(const tstring& str);
31 
32  #else
33 
34  typedef std::string tstring;
35  typedef std::ifstream tifstream;
36  typedef std::ofstream tofstream;
37  typedef std::stringstream tstringstream;
38  #define tcerr std::cerr
39  #define tclog std::clog
40  #define tcout std::cout
41 
42  tstring to_tstring(const std::wstring& str);
43  std::wstring to_string(const tstring& str);
44 
45  #endif
46 }
47 
48 #endif