| 76 | } |
| 77 | |
| 78 | std::string readFile(const char *filePath) { |
| 79 | std::ifstream inputFile(filePath); |
| 80 | std::string fileContext; |
| 81 | if (inputFile.is_open()) { |
| 82 | inputFile.seekg(0, std::ios::end); |
| 83 | int fileSize = inputFile.tellg(); |
| 84 | fileContext.resize(fileSize); |
| 85 | inputFile.seekg(0, std::ios::beg); |
| 86 | inputFile.read(&fileContext[0], fileSize); |
| 87 | inputFile >> fileContext; |
| 88 | |
| 89 | std::cerr << "file opened: " << filePath << std::endl; |
| 90 | return fileContext; |
| 91 | } else { |
| 92 | std::cerr << "Failed Open File: " << filePath << std::endl; |
| 93 | return ""; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | std::vector<std::string> readDirectory(const std::string &dirPath) { |
| 98 | std::vector<std::string> fileList; |