AbstractFile
Content
class |
File |
class |
File_Manager |
Types
Fields
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Functions
void |
|
path const & |
|
bool |
|
void |
|
int64_t |
|
bool |
|
int64_t |
|
size_t |
|
size_t |
|
bool |
Detailed Description
-
class AbstractFile
The AbstractFile class to represent a file or any equivalent. It’s the main interface to read from or write to anything for the SC Store. The following pure virtual methods need to be implemented:
DoAcquire
DoRelease
DoSeek
DoTruncate
DoGetSize
DoRead
DoWrite
DoFlush SC Store will never directly create file objects, it will ask
AbstractFilesystem
to to it.
Public Types
-
enum class State
Indicates the status of the file.
Values:
-
enumerator None
Not initialized yet.
-
enumerator Again
Cannot access to the resource because it’s already used.
-
enumerator Failed
Cannot access to the resource.
-
enumerator ReadOnly
Resource accessible only for read.
-
enumerator ReadWrite
Resource fully accessible.
-
enumerator None
Public Functions
-
virtual ~AbstractFile()
-
AbstractFile()
Empty Initialization. Usualy do nothing with the resource.
-
AbstractFile(path const &path)
Initialization with a given path. The _path property is updated by the default implemenation.
-
inline bool IsOpen() const
-
void Release()
The following functions will handle some internal stuff then, the custom version Do*() will be called.
-
bool Truncate()
at current offset return true if it worked
-
int64_t Size() const
-
size_t Read(void *data, size_t n_bytes)
-
size_t Write(void const *data, size_t n_bytes)
-
bool Flush()
Friends
- friend class TC::IO::File
- friend class TC::IO::File_Manager