A TCHAR version of std stream and string classes
// A TCHAR based std::string typedef std::basic_string<tchar> tstring; // A TCHAR based std::ifstream; typedef std::basic_ifstream</tchar><tchar , std::char_traits<TCHAR> > tstream; // A TCHAR based std::stringstream typedef std::basic_stringstream</tchar><tchar , std::char_traits<TCHAR>, std::allocator</tchar><tchar> > tstringstream;
So now no need to worry about UNICODE and ANSI, should work as CString, since TCHAR becomes char/wchar_t based on _UNICODE macro definition.
Also note that stl has provided UNICODE versions of these classes for e.g. wstring, wstringstream, wifstream, but since windows has a type that switches automagically between char/wchar_t, we are making use of it.
So the idea behind this is that stl classes are mostly template based, so this means you can add your own version of an stl class for a custom type just like I’ve done. As a conclusion we can say that std::string can be called a vector<char> but with dedicated string operations.