RTEMS Linker  0.0.1
RTEMS Tools Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rld::files::file Class Reference

#include <rld-files.h>

Public Member Functions

 file (const std::string &aname, const std::string &oname, off_t offset, size_t size)
 
 file (const std::string &path, bool is_object=true)
 
 file ()
 
void set (const std::string &path, bool is_object=true)
 
bool is_archive () const
 
bool is_object () const
 
bool is_valid () const
 
bool exists () const
 
const std::string path () const
 
const std::string full () const
 
const std::string basename () const
 
const std::string & aname () const
 
const std::string & oname () const
 
off_t offset () const
 
size_t size () const
 

Detailed Description

A file is a single object file that is either in an archive or a separate stand alone object file.

Constructor & Destructor Documentation

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
anameThe archive name.
onameThe object file name.
offsetThe offset in the archive the object file starts.
sizeThe 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
pathThe path to the image.
is_objectIf true (default) the name is for an object file.
rld::files::file::file ( )

Contruct an empty file.

Member Function Documentation

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
trueThe file is valid and a regular file.
falseThe 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
trueThe object file is in an archive.
falseThe object file is stand alone.
bool rld::files::file::is_object ( ) const

Is object file stand alone.

Return values
trueThe object file is stand alone.
falseThe 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
trueThere is a valid name.
falseThere 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
pathThe path to the image.
is_objectIf 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: