vpr7_x2p/vpr/SRC/fpga_x2p/base/fpga_x2p_utils.cpp
/******************************************************************** 
 * Extract full directory path from a full path of file
 * For example: <dir_path>/<file_name>
 * This function will return <dir_path>
 ********************************************************************/
Extract full directory path from a full path of file
For example: /
This function will return 
Extract full directory path from a full path of file For example : / This function will return
std::string find_path_dir_name(const std::string& file_name) {
  char back_slash = '/';
#ifdef _WIN32
  char back_slash = '\\';
#endif 
  size_t found = file_name.rfind(back_slash);
  if (found != std::string::npos) {
    return file_name.substr(0, found);
  }
  return std::string();
}
std :: string find_path_dir_name ( const std :: string & file_name ) { char back_slash = ' ' ; #ifdef _WIN32 char back_slash = ' \\ ' ; #endif size_t found = file_name . rfind ( back_slash ) ; if ( found != std :: string :: npos ) { return file_name . substr ( 0 , found ) ; } return std :: string ( ) ; }
Extract full directory path from a full path of file
 For example: <dir_path>/<file_name>
 This function will return <dir_path>
Extract full directory path from a full path of file For example : <dir_path > / <file_name > This function will return <dir_path >
/* For windows OS, replace any '/' with '\' */ /* Find the last '/' in the string and return the left part */ /* Not found, return an empty string */