ENH: save hms file to hms folder
Change-Id: I20ff7317c689eefc684c44e6509a45f5911de7fe
This commit is contained in:
parent
ba286fedbd
commit
63bd77caf9
1 changed files with 9 additions and 2 deletions
|
@ -83,7 +83,11 @@ int HMSQuery::load_from_local(std::string &version_info)
|
|||
return -1;
|
||||
}
|
||||
std::string filename = get_hms_file();
|
||||
std::string dir_str = (boost::filesystem::path(data_dir()) / filename).make_preferred().string();
|
||||
auto hms_folder = (boost::filesystem::path(data_dir()) / "hms");
|
||||
if (!fs::exists(hms_folder))
|
||||
fs::create_directory(hms_folder);
|
||||
|
||||
std::string dir_str = (hms_folder / filename).make_preferred().string();
|
||||
std::ifstream json_file(encode_path(dir_str.c_str()));
|
||||
try {
|
||||
if (json_file.is_open()) {
|
||||
|
@ -111,7 +115,10 @@ int HMSQuery::save_to_local()
|
|||
return -1;
|
||||
}
|
||||
std::string filename = get_hms_file();
|
||||
std::string dir_str = (boost::filesystem::path(data_dir()) / filename).make_preferred().string();
|
||||
auto hms_folder = (boost::filesystem::path(data_dir()) / "hms");
|
||||
if (!fs::exists(hms_folder))
|
||||
fs::create_directory(hms_folder);
|
||||
std::string dir_str = (hms_folder / filename).make_preferred().string();
|
||||
std::ofstream json_file(encode_path(dir_str.c_str()));
|
||||
if (json_file.is_open()) {
|
||||
json_file << std::setw(4) << m_hms_json << std::endl;
|
||||
|
|
Loading…
Reference in a new issue