# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CFile Struct Reference

#include <path.h>

List of all members.

Static Public Methods

std::string getFilename (const std::string &filename)
 Retrieve the associated file name. More...

std::string getPath (const std::string &filename)
 Retrieve the associated file path with the trailing slash. More...

bool isDirectory (const std::string &filename)
 Just to know if it is a directory. More...

bool fileExists (const std::string &filename)
 Return true if the file exists. More...

std::string findNewFile (const std::string &filename)
 Return a new filename that doesn't exists. More...

int getLastSeparator (const std::string &filename)
 Return the position between [begin,end[ of the last separator between path and filename ('/' or '\'). More...


Member Function Documentation

bool NLMISC::CFile::fileExists ( const std::string & filename ) [static]
 

Return true if the file exists.

Warning: this test will also tell that the file does not exist if you don't have the rights to read it (Unix).

Definition at line 137 of file path.cpp.

string NLMISC::CFile::findNewFile ( const std::string & filename ) [static]
 

Return a new filename that doesn't exists.

It's used for screenshot filename for example. example: findNewFile("foobar.tga"); will try foobar001.tga, if the file exists, try foobar002.tga and so on until it finds an unexistant file.

Definition at line 152 of file path.cpp.

std::string NLMISC::CFile::getFilename ( const std::string & filename ) [static]
 

Retrieve the associated file name.

An empty string is returned if the path is invalid

Definition at line 113 of file path.cpp.

int NLMISC::CFile::getLastSeparator ( const std::string & filename ) [static]
 

Return the position between [begin,end[ of the last separator between path and filename ('/' or '\').

If there's no separator, it returns string::npos.

Definition at line 103 of file path.cpp.

std::string NLMISC::CFile::getPath ( const std::string & filename ) [static]
 

Retrieve the associated file path with the trailing slash.

Returns an empty string if the path is invalid

Definition at line 122 of file path.cpp.

bool NLMISC::CFile::isDirectory ( const std::string & filename ) [static]
 

Just to know if it is a directory.

_FileName empty and path not !!!

Definition at line 131 of file path.cpp.


The documentation for this struct was generated from the following files: