Commit 24fe65a0 authored by Thomas Feuvrier's avatar Thomas Feuvrier

Change signature des méthodes pour manipuler les noms de fichier: replacement...

Change signature des méthodes pour manipuler les noms de fichier: replacement de std::string par const std::string &
parent 237b5d39
......@@ -79,7 +79,7 @@ System::GetRootName( const std::string& filename )
return( filename );
}
bool System::IsAFileName(std::string pszPath)
bool System::IsAFileName(const std::string& pszPath)
{
return( ! IsADirName(pszPath) );
}
......@@ -135,7 +135,7 @@ std::string System::SetToLower( const std::string& str )
WIN32 / MSVC++ implementation
*====================================================================*/
bool System::IsADirName(std::string pszPath)
bool System::IsADirName(const std::string& pszPath)
{
struct _finddata_t c_file;
long hFile;
......@@ -161,7 +161,7 @@ bool System::IsADirName(std::string pszPath)
return isADir;
}
std::vector<std::string> System::Readdir(std::string pszPath)
std::vector<std::string> System::Readdir(const std::string& pszPath)
{
struct _finddata_t c_file;
long hFile;
......@@ -193,7 +193,7 @@ std::vector<std::string> System::Readdir(std::string pszPath)
POSIX (Unix) implementation
*====================================================================*/
bool System::IsADirName(std::string pszPath)
bool System::IsADirName(const std::string& pszPath)
{
bool isADir(false);
DIR *hDir;
......@@ -231,7 +231,7 @@ bool System::IsADirName(std::string pszPath)
* doesn't exist.
*/
std::vector<std::string> System::Readdir(std::string pszPath)
std::vector<std::string> System::Readdir(const std::string& pszPath)
{
DIR *hDir;
std::vector<std::string> listFileFind;
......
......@@ -49,9 +49,9 @@ public:
typedef System Self;
/** Return true if the parameter 'pszPath' specify a directory name) */
static bool IsADirName(std::string pszPath);
static bool IsADirName(const std::string& pszPath);
/** Return true if the parameter 'pszPath' specify a file name) */
static bool IsAFileName(std::string pszPath);
static bool IsAFileName(const std::string& pszPath);
/** Get the extension of the file name */
static std::string GetExtension( const std::string& filename );
/** Get the root name */
......@@ -66,7 +66,7 @@ public:
static std::string SetToLower( const std::string& str );
/** Get list of file find in a directory */
static std::vector<std::string> Readdir(std::string pszPath);
static std::vector<std::string> Readdir(const std::string& pszPath);
};
} // namespace otb
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment