1、创建CFDStructMainUtils
2、实现Utils中write函数 3、修改json写入逻辑,调用Utils中的wirte函数,强制创建路径feature/struct-menu-20241023
parent
36e41041dd
commit
011318054a
@ -0,0 +1,20 @@
|
||||
#include "CFDStructMainUtils.h"
|
||||
|
||||
#include <direct.h>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
|
||||
void CFDStructMainUtils::write(std::string path, std::string text) {
|
||||
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);
|
||||
freopen(path.c_str(), "w", stdout);
|
||||
cout << text << endl;
|
||||
fclose(stdout);
|
||||
}
|
||||
|
||||
void CFDStructMainUtils::read(std::string path, std::string &text) {
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
#ifndef CFDStructMainUtils_h
|
||||
#define CFDStructMainUtils_h
|
||||
|
||||
#include "CFDStructMainAPI.h"
|
||||
#include <string>
|
||||
|
||||
class CFDStructMAINAPI CFDStructMainUtils {
|
||||
|
||||
public:
|
||||
static void write(std::string path, std::string text);
|
||||
|
||||
static void read(std::string path, std::string &text);
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue