1
0
mirror of https://github.com/EduApps-CDG/OpenDX synced 2024-12-30 09:45:37 +01:00
OpenDX/include/preprocessor/GetFileContent.hpp

18 lines
411 B
C++

#pragma once
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
/**
* Caution: by using that function,
* it means that every time it's called
* the file content will be included in the code
*/
#define GetFileContent(file_path) []() -> std::string { \
std::ifstream file(file_path); \
std::stringstream buffer; \
buffer << file.rdbuf(); \
return buffer.str(); \
}()