#include "CFDStructMainUtils.h" #include #include #include #include #include void CFDStructMainUtils::write(std::string path, std::string text) { std::cout << "start write" << endl; using namespace std; char drive[_MAX_PATH], dir[_MAX_PATH], filename[_MAX_PATH], ext[_MAX_PATH]; _splitpath(path.c_str(), drive, dir, filename, ext); _mkdir(dir); // if (FILE *file = fopen(path.c_str(), "w")) { // fprintf(file, "%s", text.c_str()); // fclose(file); // } ofstream outfile(path); outfile << text << endl; outfile.close(); } std::string CFDStructMainUtils::read(std::string path) { using namespace std; string res; ifstream infile(path); if (infile.is_open()) { cout << "openfile" << endl; char c; while (infile >> c) res += c; infile.close(); } else { cout << "cant openfile" << endl; } return res; }