Loads the entire text from the given vfs file into a string
| 57 | |
| 58 | // Loads the entire text from the given vfs file into a string |
| 59 | inline std::string loadTextFromVfsFile(const std::string& vfsPath) |
| 60 | { |
| 61 | auto file = GlobalFileSystem().openTextFile(vfsPath); |
| 62 | |
| 63 | if (!file) |
| 64 | { |
| 65 | return std::string(); |
| 66 | } |
| 67 | |
| 68 | std::stringstream textStream; |
| 69 | std::istream mapStream(&file->getInputStream()); |
| 70 | textStream << mapStream.rdbuf(); |
| 71 | textStream.flush(); |
| 72 | |
| 73 | return textStream.str(); |
| 74 | } |
| 75 | |
| 76 | // Returns the text contents of the given file |
| 77 | inline std::string loadFileToString(const fs::path& path) |
no test coverage detected