Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <string_view>
  2. #include <filesystem>
  3. #include <fstream>
  4. #include <iostream>
  5.  
  6. using namespace std;
  7. namespace fs = experimental::filesystem;
  8.  
  9. fs::path data_path;
  10. ifstream filestream;
  11.  
  12. fs::path FileSystemManager::GetDataPath()
  13. {
  14.     return data_path;
  15. }
  16.  
  17. FileSystemManager filesystem;
  18.  
  19. void openfile(string_view file_name)
  20. {
  21.     //filestream = ifstream(filesystem.GetDataPath() / string(file_name)); // это работает
  22.     filestream = ifstream(filesystem.GetDataPath() / file_name); // это нет
  23.     if (!filestream)
  24.     {
  25.         //throw underflow_error;
  26.         return;
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement