bool AXUtinity::String2TString(const char* str,LPTSTR buf,ULONG buflen) { #if defined(_UNICODE) return String2WString(str,buf,buflen); #else memcpy(...); return TRUE; #endif }
void TestUsageSetLocaleInCPP() { std::wcout<<L"==="<<__FUNCTIONW__<<L"==="<<std::endl; /* Note: use locale object for c++, affect std::cout and std::wcout */ std::wcout.clear(); std::wcout.flush(); std::wcout.imbue(std::locale("eng")); std::wcout<<L"\tCurrent Locale : "<<String2WString(std::wcout.getloc().name())<<std::endl; std::wcout<<L"\tThousand Separator: "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).thousands_sep()<<std::endl; std::wcout<<L"\tGrouping : "<<String2WString(std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).grouping())<<std::endl; std::wcout<<L"\tCurrency Symbol : "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).curr_symbol()<<std::endl; std::wcout<<L"\tNumber 1000000 : "<<1000000<<std::endl; std::wcout.flush(); std::wcout.imbue(std::locale("C")); std::wcout<<L"\tCurrent Locale : "<<String2WString(std::wcout.getloc().name())<<std::endl; std::wcout<<L"\tThousand Separator: "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).thousands_sep()<<std::endl; std::wcout<<L"\tGrouping : "<<String2WString(std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).grouping())<<std::endl; std::wcout<<L"\tCurrency Symbol : "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).curr_symbol()<<std::endl; std::wcout<<L"\tNumber 1000000 : "<<1000000<<std::endl; std::wcout.flush(); #if defined (_WIN32) std::wcout.imbue(std::locale("deu_deu.1252")); #else std::wcout.imbue(std::locale("de_DE")); #endif std::wcout<<L"\tCurrent Locale : "<<String2WString(std::wcout.getloc().name())<<std::endl; std::wcout<<L"\tThousand Separator: "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).thousands_sep()<<std::endl; std::wcout<<L"\tGrouping : "<<String2WString(std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).grouping())<<std::endl; std::wcout<<L"\tCurrency Symbol : "<<std::use_facet<std::moneypunct<wchar_t> >(std::wcout.getloc()).curr_symbol()<<std::endl; std::wcout<<L"\tNumber 1000000 : "<<1000000<<std::endl; std::wcout.flush(); if (std::wcout.bad()) { std::wcout.clear(); std::wcout.flush(); std::wcout<<"Reset std::wcout"<<std::endl; } }
cOAL_Stream* cOAL_Device::LoadStream(const string& asFilename) { return LoadStream(String2WString(asFilename)); }
cOAL_Sample* cOAL_Device::LoadSample(const string &asFilename) { return LoadSample(String2WString(asFilename)); }