AbstractFile
Content
| class | File |
| class | File_Manager |
Fields
None |
|
Again |
|
Failed |
|
ReadOnly |
|
ReadWrite |
|
Begin |
|
Current |
|
End |
Functions
~AbstractFile |
|
AbstractFile |
|
AbstractFile |
|
| void | SetPath |
| path const & | GetPath |
State |
GetState |
| bool | IsOpen |
| void | Release |
State |
AcquireReadOnly |
State |
AcquireReadWrite |
| int64_t | Seek |
| bool | Truncate |
| int64_t | Size |
| size_t | Read |
| size_t | Write |
| bool | Flush |
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
AbstractFilesystemto 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
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