Cheetah Software  1.0
save_file.cpp File Reference
+ Include dependency graph for save_file.cpp:

Go to the source code of this file.

Functions

void cleaning_file (const std::string &folder_name, const std::string &file_name, std::string &full_ret_file)
 
void create_folder (const std::string &folder_name)
 

Function Documentation

void cleaning_file ( const std::string &  folder_name,
const std::string &  file_name,
std::string &  full_ret_file 
)

Definition at line 3 of file save_file.cpp.

References gs_fileName_string.

4  {
5  full_ret_file = THIS_COM + folder_name + file_name;
6  full_ret_file += ".txt";
7 
8  std::list<std::string>::iterator iter = std::find(
9  gs_fileName_string.begin(), gs_fileName_string.end(), full_ret_file);
10  if (gs_fileName_string.end() == iter) {
11  gs_fileName_string.push_back(full_ret_file);
12  remove(full_ret_file.c_str());
13  }
14 }
static std::list< std::string > gs_fileName_string
Definition: save_file.h:14
std::string folder_name
Definition: test_spline.cpp:13

+ Here is the caller graph for this function:

void create_folder ( const std::string &  folder_name)

Definition at line 16 of file save_file.cpp.

References folder_name.

16  {
17  std::string full_path = THIS_COM + folder_name;
18 
19  if (mkdir(full_path.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
20  if (errno == EEXIST) {
21  // alredy exists
22  // printf("%s is already exist\n", full_path.c_str());
23  } else {
24  // something else
25  std::cout << "cannot create session name folder error:" << strerror(errno)
26  << std::endl;
27  exit(0);
28  }
29  }
30 }
std::string folder_name
Definition: test_spline.cpp:13