| cartobase
    5.1.2
    | 
Files and filenames portable utilities. More...
#include <cartobase/stream/fileutil.h>
| Static Public Member Functions | |
| static char | separator () | 
| returns '/' on Unix systems and '\' on Windows systems  More... | |
| static char | pathSeparator () | 
| character separating paths in a list (generally in an environment variable).  More... | |
| static std::string | basename (const std::string &) | 
| this is NOT conform to basename() from libgen: ::basename( "/" ) = "/", carto::FileUtil::basename( "/" ) = "", ::basename( "/usr/" ) = "usr", carto::FileUtil::basename( "/usr/" ) = "" ::basename( "." ) = ".", carto::FileUtil::basename( "." ) = "", ::basename( ".." ) = "..", carto::FileUtil::basename( ".." ) = "",  More... | |
| static std::string | dirname (const std::string &) | 
| this is NOT conform to dirname() from libgen: ::dirname( "/usr/" ) = "/", carto::FileUtil::dirname( "/usr/" ) = "/usr"  More... | |
| static std::string | fileStat (const std::string &) | 
| Checks file existence, type and read/write permission.  More... | |
| static std::string | extension (const std::string &) | 
| returns the file extension (without the dot)  More... | |
| static std::string | removeExtension (const std::string &) | 
| returns the filename without its extension  More... | |
| static bool | isAbsPath (const std::string &path) | 
| true if path is an absolute path, false if it is relative  More... | |
| static std::string | temporaryFile (const std::string &prefix, int &fd) | 
| opens a temporary file.  More... | |
| static std::string | temporaryDirectory (const std::string &prefix) | 
| Creates a temporary directory.  More... | |
| static std::list< std::string > | filenamesSplit (const std::string &filenames, const std::string &separator) | 
| interpret the filenames string as a list of filenames and split it.  More... | |
| static std::string | windowsFilename (const std::string &filename) | 
| Replaces slashes with backslashes characters.  More... | |
| static std::string | linuxFilename (const std::string &filename) | 
| Replaces backslashes with slashes characters on Windows OS on other OS, leaves filename unchanged.  More... | |
| static std::string | uriFilename (const std::string &filein) | 
| It is possible to treat an URI (Uniform Resource Identifier) instead of a simple path.  More... | |
| static Object | uriOptions (const std::string &filein) | 
| Extracts the options from the URI and returns them as a dictionary of strings : ( "options1" => "this", "option2" => "that" )  More... | |
| static std::string | uriCopyOptions (const std::string &filein) | 
| Extracts the options from the URI and returns them as a string : "?options1=this&option2=that".  More... | |
Files and filenames portable utilities.
Definition at line 53 of file fileutil.h.
| 
 | static | 
this is NOT conform to basename() from libgen: ::basename( "/" ) = "/", carto::FileUtil::basename( "/" ) = "", ::basename( "/usr/" ) = "usr", carto::FileUtil::basename( "/usr/" ) = "" ::basename( "." ) = ".", carto::FileUtil::basename( "." ) = "", ::basename( ".." ) = "..", carto::FileUtil::basename( ".." ) = "",
But I think this fits better the use we may have of it...
| 
 | static | 
this is NOT conform to dirname() from libgen: ::dirname( "/usr/" ) = "/", carto::FileUtil::dirname( "/usr/" ) = "/usr"
But I think this fits better the use we may have of it...
| 
 | static | 
returns the file extension (without the dot)
| 
 | static | 
interpret the filenames string as a list of filenames and split it.
escape characters and quotes (single and double) are allowed.
| 
 | static | 
Checks file existence, type and read/write permission.
| 
 | static | 
true if path is an absolute path, false if it is relative
| 
 | static | 
Replaces backslashes with slashes characters on Windows OS on other OS, leaves filename unchanged.
| 
 | static | 
character separating paths in a list (generally in an environment variable).
| 
 | static | 
returns the filename without its extension
| 
 | static | 
returns '/' on Unix systems and '\' on Windows systems
| 
 | static | 
Creates a temporary directory.
| 
 | static | 
opens a temporary file.
| prefix | is used to name the temporary file. If it is a local file (with no path), the temporary directory will be prefixed to it, otherwise the specified directory is used. A (random) generated number will be suffixed to the prefix filename, and the extension (if any) will also be appended to it. So "toto.ima" can become "/tmp/toto123456.ima". | 
| fd | will be filled with the file descriptor of the temp file | 
On Unix, the created file doesn't have to be deleted, it is hidden (already unlinked).
On Windows, I guess the file has to be manually deleted...
| 
 | static | 
Extracts the options from the URI and returns them as a string : "?options1=this&option2=that".
| 
 | static | 
It is possible to treat an URI (Uniform Resource Identifier) instead of a simple path.
It would have the following syntax : "/my/path/file.ext?options1=this&option2=that" Extracts the classical filename from the URI : "/my/path/file.ext"
| 
 | static | 
Extracts the options from the URI and returns them as a dictionary of strings : ( "options1" => "this", "option2" => "that" )
| 
 | static | 
Replaces slashes with backslashes characters.