Skip to content
Snippets Groups Projects
csandbox.cc 1.51 KiB
Newer Older
  • Learn to ignore specific revisions
  • Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    #include <boost/core/ignore_unused.hpp>
    #include <iostream>
    #include <boost/filesystem.hpp>
    
    #include <vereign/core/string.hh>
    
    #include <vereign/bytes/view.hh>
    #include <vereign/bytes/view_dump.hh>
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
    namespace fs = boost::filesystem;
    
    auto main(int argc, char** argv) -> int {
      boost::ignore_unused(argc);
      boost::ignore_unused(argv);
    
      // fs::path ;
    
    
      // std::wstring s = L"c:\\проба.txt";
      std::string path = "c:\\ztrash\\проба.txt";
      std::wstring ws = vereign::string::widen(path);
    
      std::string p2 = vereign::string::narrow(ws);
      std::cout << vereign::bytes::dump(vereign::bytes::View(path)) << std::endl;
      std::cout << vereign::bytes::dump(vereign::bytes::View(p2)) << std::endl;
      if (p2 == path) {
        std::cout << "yes" << std::endl;
      }
    
      std::cout << vereign::bytes::dump(vereign::bytes::View(ws)) << std::endl;
    
      // std::ofstream f{ws};
      // std::wcout << ws;
      std::cout << path << std::endl;
      std::wcout << ws << std::endl;
      // std::cout << "проба" << std::endl;
      // wchar_t ru[] = L"Привет"; //Russian language
      // std::wcout << ru;
      // std::cout << std::endl;
      // std::cout << "Temp directory is " << fs::temp_directory_path() << '\n';
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
      // std::cout << "Home directory is " << fs::user << '\n';
    
      // p.wstring();
      // std::cout << p.string() << std::endl;;
    
    
      // wchar_t* in = L"ทดสอบ"; // thai language
      // char* out=(char *)malloc(15);
      // WideCharToMultiByte(874, 0, in, 15, out, 15, NULL, NULL);
      // printf(out); // result is correctly in Thai although not neat
    
    
    Daniel Lyubomirov's avatar
    Daniel Lyubomirov committed
      return 1;