gatb.core-API-1.4.2
FileSystemLinux Class Reference

default implementation More...

#include <FileSystemLinux.hpp>

Inheritance diagram for FileSystemLinux:
Inheritance graph

Public Member Functions

size_t getMaxFilesNumber ()
 
ssize_t getAttribute (const Path &filename, const char *key, std::string &value)
 
ssize_t setAttribute (const Path &filename, const char *key, const char *fmt,...)
 
IFilenewFile (const Path &path, const char *mode)
 
IFilenewFile (const Path &dirpath, const Path &filename, const char *mode)
 
int clearCache ()
 
- Public Member Functions inherited from FileSystemCommon
u_int64_t getAvailableSpace (const Path &path)
 
Path getCurrentDirectory ()
 
Path getDirectory (const Path &path)
 
Path getTemporaryDirectory ()
 
Path getBaseName (const Path &path, bool cutToFirstDot=false)
 
Path getRealPath (const Path &file)
 
std::string getExtension (const Path &path)
 
std::string getTemporaryFilename (const std::string &filename="")
 
bool doesExist (const Path &path)
 
bool doesExistDirectory (const Path &path)
 
bool isFolderEndingWith (const Path &path, const std::string &ending)
 
u_int64_t getSize (const Path &path)
 
int mkdir (const Path &path, u_int64_t mode)
 
int rmdir (const Path &path)
 
int remove (const Path &path)
 
int rename (const Path &from, const Path &to)
 
void iterate (const Path &path, void(*callback)(const Path &entry, void *data), void *data)
 
std::vector< std::string > listdir (const Path &path)
 
- Public Member Functions inherited from IFileSystem
virtual ~IFileSystem ()
 

Additional Inherited Members

- Public Types inherited from IFileSystem
typedef std::string Path
 

Detailed Description

default implementation

Member Function Documentation

int clearCache ( )
virtual

Clear the file system cache.

Implements IFileSystem.

ssize_t getAttribute ( const Path filename,
const char *  key,
std::string &  value 
)
virtual

Get metadata associated with the file for a given key.

Parameters
[in]filename: name of the file.
[in]key: key for which we want the value
[in]value: value associated to the key
Returns
-1 if KO, 0 otherwise, otherwise length of the retrieved value.

Reimplemented from FileSystemCommon.

size_t getMaxFilesNumber ( )
virtual

Return the maximum number of files that can be used at the same time.

Returns
the max number of files.

Implements IFileSystem.

IFile* newFile ( const Path path,
const char *  mode 
)
virtual

Creates a new IFile instance (equivalent to 'fopen' function)

Parameters
[in]path: uri of the file to be opened.
[in]mode: mode of the file (like fopen)
Returns
instance of IFile, 0 otherwise.

Implements IFileSystem.

IFile* newFile ( const Path dirpath,
const Path filename,
const char *  mode 
)
virtual

Creates a new IFile instance (equivalent to 'fopen' function)

Parameters
[in]dirpath: uri of the directory where the file is meant to be.
[in]filename: name of the file
[in]mode: mode of the file (like fopen)
Returns
instance of IFile, 0 otherwise.

Implements IFileSystem.

ssize_t setAttribute ( const Path filename,
const char *  key,
const char *  fmt,
  ... 
)
virtual

Set metadata associated with the file for a given key.

Parameters
[in]filename: name of the file.
[in]key: key for which we want the value
[in]fmt: format of the string (in the 'printf' way)
[in]...: paramters for the format parameter
Returns
-1 if error, 0 otherwise.

Reimplemented from FileSystemCommon.


The documentation for this class was generated from the following file: