#include <rld-files.h>
A file is a single object file that is either in an archive or a separate stand alone object file.
rld::files::file::file |
( |
const std::string & |
aname, |
|
|
const std::string & |
oname, |
|
|
off_t |
offset, |
|
|
size_t |
size |
|
) |
| |
Construct the file from the component parts when part of an archive.
- Parameters
-
aname | The archive name. |
oname | The object file name. |
offset | The offset in the archive the object file starts. |
size | The size of the archive the object file starts. |
rld::files::file::file |
( |
const std::string & |
path, |
|
|
bool |
is_object = true |
|
) |
| |
Construct the name by splitting the full path into an archive, object file name and offset.
- Parameters
-
path | The path to the image. |
is_object | If true (default) the name is for an object file. |
rld::files::file::file |
( |
| ) |
|
const std::string & rld::files::file::aname |
( |
| ) |
const |
The archive name component. A length of 0 means there was not archive component.
- Returns
- const std::string& The archive name.
const std::string rld::files::file::basename |
( |
| ) |
const |
The base path. It is the basename of the full path.
- Returns
- const std::string The basename of the full path to the image.
bool rld::files::file::exists |
( |
| ) |
const |
Exists returns true if the archive or object file is present on disk and a regular file.
- Return values
-
true | The file is valid and a regular file. |
false | The file is either not present, not accessable or not a regular file. |
const std::string rld::files::file::full |
( |
| ) |
const |
The full path.
- Returns
- const std::string The full path to the image.
bool rld::files::file::is_archive |
( |
| ) |
const |
Is an archive returns true if the file is in an archive.
- Return values
-
true | The object file is in an archive. |
false | The object file is stand alone. |
bool rld::files::file::is_object |
( |
| ) |
const |
Is object file stand alone.
- Return values
-
true | The object file is stand alone. |
false | The object could be part of an archive. |
bool rld::files::file::is_valid |
( |
| ) |
const |
Valid returns true if there is a valid name.
- Return values
-
true | There is a valid name. |
false | There is not name assigned. |
off_t rld::files::file::offset |
( |
| ) |
const |
The object's offset in the archive or on disk.
- Returns
- off_t The offset part of the file name.
const std::string & rld::files::file::oname |
( |
| ) |
const |
The object name. There is always an object name.
- Returns
- const std::string& The object name.
const std::string rld::files::file::path |
( |
| ) |
const |
The path maps to the real file on disk. The file may not be valid.
- Returns
- const std::string The real path to the file on disk.
void rld::files::file::set |
( |
const std::string & |
path, |
|
|
bool |
is_object = true |
|
) |
| |
Set a name from the path.
- Parameters
-
path | The path to the image. |
is_object | If true (default) the name is for an object file. |
size_t rld::files::file::size |
( |
| ) |
const |
The object's size in the archive.
- Returns
- size_t The size of the file in bytes.
The documentation for this class was generated from the following files:
- /Users/chris/Development/rtems/src/apps/rtl-host.chrisj/rld-files.h
- /Users/chris/Development/rtems/src/apps/rtl-host.chrisj/rld-files.cpp