28 std::string full_path( path );
29 std::string::size_type i = full_path.find_last_of(
"/\\" );
30 if( i != std::string::npos )
32 std::string
name( full_path.substr( i + 1 ) );
44 std::string
modified_filename(
const std::string filename,
const std::string new_end_with_suffix )
46 std::string str = filename;
47 size_t last_dot_pos = str.find_last_of(
'.' );
48 if( last_dot_pos != std::string::npos )
50 str[ last_dot_pos ] =
'_';
66 std::string command =
"fc \"" + file1 +
"\" \"" + file2 +
"\"";
68 std::string command =
"diff -a \"" + file1 +
"\" \"" + file2 +
"\"";
70 int ret = system( command.c_str() );
bool are_identical_files(const std::string &file1, const std::string &file2)
Compares two files for identical content.
Definition: helpers.hpp:61
std::string modified_filename(const std::string filename, const std::string new_end_with_suffix)
Modifies a filename by replacing the last dot with an underscore and appending a new end withsuffix.
Definition: helpers.hpp:44
std::string module_name(const char *path)
Helper function to extract module name from the path of the executable.
Definition: helpers.hpp:22
name
Definition: setup.py:6