ENH: Use const char where it should have been. At same time fix Bug#2958
This commit is contained in:
parent
d5631f370b
commit
e9fcafafe5
@ -80,8 +80,7 @@ const char* Directory::GetPath() const
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void Directory::Clear()
|
void Directory::Clear()
|
||||||
{
|
{
|
||||||
//this->Internal->Path.clear();
|
this->Internal->Path.resize(0);
|
||||||
this->Internal->Path = "";
|
|
||||||
this->Internal->Files.clear();
|
this->Internal->Files.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,30 +23,30 @@ class DirectoryInternals;
|
|||||||
|
|
||||||
/** \class Directory
|
/** \class Directory
|
||||||
* \brief Portable directory/filename traversal.
|
* \brief Portable directory/filename traversal.
|
||||||
*
|
*
|
||||||
* Directory provides a portable way of finding the names of the files
|
* Directory provides a portable way of finding the names of the files
|
||||||
* in a system directory.
|
* in a system directory.
|
||||||
*
|
*
|
||||||
* Directory currently works with Windows and Unix operating systems.
|
* Directory currently works with Windows and Unix operating systems.
|
||||||
*/
|
*/
|
||||||
class @KWSYS_NAMESPACE@_EXPORT Directory
|
class @KWSYS_NAMESPACE@_EXPORT Directory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Directory();
|
Directory();
|
||||||
~Directory();
|
~Directory();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the specified directory and load the names of the files
|
* Load the specified directory and load the names of the files
|
||||||
* in that directory. 0 is returned if the directory can not be
|
* in that directory. 0 is returned if the directory can not be
|
||||||
* opened, 1 if it is opened.
|
* opened, 1 if it is opened.
|
||||||
*/
|
*/
|
||||||
bool Load(const char*);
|
bool Load(const char*);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of files in the current directory.
|
* Return the number of files in the current directory.
|
||||||
*/
|
*/
|
||||||
unsigned long GetNumberOfFiles() const;
|
unsigned long GetNumberOfFiles() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the file at the given index, the indexing is 0 based
|
* Return the file at the given index, the indexing is 0 based
|
||||||
*/
|
*/
|
||||||
@ -57,10 +57,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
const char* GetPath() const;
|
const char* GetPath() const;
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
/**
|
||||||
* Clear the internal structure. Used internally at beginning of Load(...) to clear
|
* Clear the internal structure. Used internally at beginning of Load(...)
|
||||||
* the cache.
|
* to clear the cache.
|
||||||
*/
|
*/
|
||||||
void Clear();
|
void Clear();
|
||||||
|
|
||||||
|
@ -359,10 +359,10 @@ bool SystemTools::MakeDirectory(const char* path)
|
|||||||
// return EACCES when it should return EEXISTS
|
// return EACCES when it should return EEXISTS
|
||||||
// if it is some other error besides directory exists
|
// if it is some other error besides directory exists
|
||||||
// then return false
|
// then return false
|
||||||
if( (errno != EEXIST)
|
if( (errno != EEXIST)
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
&& (errno != EACCES)
|
&& (errno != EACCES)
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
// after stdarg.h does not solve things because we do not have control over
|
// after stdarg.h does not solve things because we do not have control over
|
||||||
// what the user does. This hack solves this problem by moving va_list to our
|
// what the user does. This hack solves this problem by moving va_list to our
|
||||||
// own namespace that is local for kwsys.
|
// own namespace that is local for kwsys.
|
||||||
namespace std {} // Required for platforms that do not have std::
|
namespace std {} // Required for platforms that do not have std::
|
||||||
namespace @KWSYS_NAMESPACE@_VA_LIST
|
namespace @KWSYS_NAMESPACE@_VA_LIST
|
||||||
{
|
{
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user