FileReader.cpp 338 B

123456789101112131415161718
  1. //
  2. // Created by xcbosa on 2023/1/28.
  3. //
  4. #include "utils-private.h"
  5. using namespace std;
  6. namespace xc::utils {
  7. string contentsOfTextFile(string filePath) {
  8. ifstream fin(filePath);
  9. stringstream buffer;
  10. buffer << fin.rdbuf();
  11. string str(buffer.str());
  12. fin.close();
  13. return str;
  14. }
  15. }