Changeset 145:ace18c6c0493 in rrlib_util for fileio.h


Ignore:
Timestamp:
17.05.2016 16:00:07 (4 years ago)
Author:
Jens Wettach <wettach@…>
Branch:
default
Phase:
public
Rebase:
64333035623138393666396266343736616636373365663064666166353538616637646630323033
Message:

cleaned code; added function for retrieving extension from a file name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fileio.h

    r142 r145  
    102102 
    103103/*! 
    104  * \brief Removes the file with \param filename. 
     104 * \brief Removes the file with \param file_name. 
    105105 * \return true if file could be removed 
    106106 * \throws runtime_error if file removal fails 
    107107 */ 
    108 bool DeleteFile(const std::string& filename); 
     108bool DeleteFile(const std::string& file_name); 
    109109 
    110110/*! 
    111  * \brief Removes the directory with \param directoryname. 
     111 * \brief Removes the directory with \param directory_name. 
    112112 * \return true if directory could be removed 
    113113 * \throws runtime_error if directory removal fails 
    114114 */ 
    115 bool DeleteDirectory(const std::string& directoryname); 
     115bool DeleteDirectory(const std::string& directory_name); 
    116116 
    117117/*! 
    118  * \brief Tests if file with \param filename exists 
     118 * \brief Tests if file with \param file_name exists 
    119119 * 
    120120 * \return true if file exists, false otherwise 
    121121 */ 
    122 bool FileExists(const std::string &filename); 
     122bool FileExists(const std::string &file_name); 
    123123 
    124124/*! 
    125  * \brief Counts number of lines in \param filename 
     125 * \brief Counts number of lines in \param file_name 
    126126 * 
    127127 * \return numboer of lines 
    128128 * \throws runtime_error if file cannot be opened 
    129129 */ 
    130 size_t CountLineNumbers(const std::string &filename); 
     130size_t CountLineNumbers(const std::string &file_name); 
    131131 
    132 /*! Expands the \param filename via a pipe and echo command in order to replace all contained environment variables with their actual value. 
     132/*! Expands the \param file_name via a pipe and echo command in order to replace all contained environment variables with their actual value. 
    133133 * 
    134  * \param filename file name to be expanded (will contain the result afterwards) 
     134 * \param file_name file name to be expanded (will contain the result afterwards) 
    135135 * 
    136136 * \return true if file name could be expanded 
    137137 * \throws runtime_error if expansion of file name failed 
    138138 */ 
    139 bool ShellExpandFilename(std::string &filename) __attribute__((__warn_unused_result__)); 
     139bool ShellExpandFilename(std::string &file_name) __attribute__((__warn_unused_result__)); 
    140140 
    141 /*! Expands the \param filename via a pipe and echo command in order to replace all contained environment variables with their actual value. 
     141/*! Expands the \param file_name via a pipe and echo command in order to replace all contained environment variables with their actual value. 
    142142 * 
    143  * \param filename file name to be expanded 
     143 * \param file_name file name to be expanded 
    144144 * 
    145145 * \return expanded file name in case of success 
     
    148148std::string ShellExpandFilename(const std::string &file_name)  __attribute__((__warn_unused_result__)); 
    149149 
    150 /*! Expands the \param filename via a pipe and echo command in order to replace all contained environment variables with their actual value. 
     150/*! Expands the \param file_name via a pipe and echo command in order to replace all contained environment variables with their actual value. 
    151151 * 
    152  * \param filename file name to be expanded 
     152 * \param file_name file name to be expanded 
    153153 * \param result will contain the expanded file name 
    154154 * 
     
    167167void SplitFullQualifiedFilename(const std::string& complete_name, std::string& file_dir, std::string& file_base, std::string& file_ext); 
    168168 
     169/* 
     170 * Extracts the file extension from \param file_name 
     171 * \param file_name file name with extension 
     172 * \returns file extension (may be empty) 
     173 */ 
     174std::string GetFileExtension(const std::string &file_name); 
     175 
     176 
    169177//---------------------------------------------------------------------- 
    170178// End of namespace declaration 
Note: See TracChangeset for help on using the changeset viewer.