Detailed Description
This module define an abstract interface for generic data files by extending the BaseSequentialStream interface. Note that no code is present, data files are just abstract interface-like structures, you should look at the systems as to a set of abstract C++ classes (even if written in C). This system has the advantage to make the access to streams independent from the implementation logic.
The data files interface can be used as base class for high level object types such as an API for a File System implementation.
Define Documentation
No error return code.
Definition at line 45 of file chfiles.h.
| #define FILE_ERROR 0xFFFFFFFFUL |
Error code from the file stream methods.
Definition at line 50 of file chfiles.h.
| #define _base_file_stream_methods |
| #define _base_file_stream_data _base_sequential_stream_data |
| #define chFileStreamClose |
( |
|
ip | ) |
((ip)->vmt->close(ip)) |
Base file Stream close.
The function closes a file stream.
- Parameters:
-
- Returns:
- The operation status.
- Return values:
-
| FILE_OK | no error. |
| FILE_ERROR | operation failed. |
- Function Class:
- Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Definition at line 117 of file chfiles.h.
| #define chFileStreamGetError |
( |
|
ip | ) |
((ip)->vmt->geterror(ip)) |
Returns an implementation dependent error code.
- Parameters:
-
- Returns:
- Implementation dependent error code.
- Function Class:
- Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Definition at line 127 of file chfiles.h.
| #define chFileStreamGetSize |
( |
|
ip | ) |
((ip)->vmt->getsize(ip)) |
Returns the current file size.
- Parameters:
-
- Returns:
- The file size.
- Function Class:
- Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Definition at line 137 of file chfiles.h.
| #define chFileStreamGetPosition |
( |
|
ip | ) |
((ip)->vmt->getposition(ip)) |
Returns the current file pointer position.
- Parameters:
-
- Returns:
- The current position inside the file.
- Function Class:
- Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Definition at line 147 of file chfiles.h.
| #define chFileStreamSeek |
( |
|
ip, |
|
|
|
offset |
|
) |
| ((ip)->vmt->lseek(ip, offset)) |
Moves the file current pointer to an absolute position.
- Parameters:
-
| [in] | ip | pointer to a BaseFileStream or derived class |
| [in] | offset | new absolute position |
- Returns:
- The operation status.
- Return values:
-
| FILE_OK | no error. |
| FILE_ERROR | operation failed. |
- Function Class:
- Normal API, this function can be invoked by regular system threads but not from within a lock zone.
Definition at line 160 of file chfiles.h.
Typedef Documentation
File offset type.
Definition at line 55 of file chfiles.h.