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

#include <rld-files.h>

Inheritance diagram for rld::files::image:
rld::files::archive rld::files::object

Public Member Functions

 image (file &name)
 
 image (const std::string &path, bool is_object=true)
 
 image ()
 
virtual ~image ()
 
virtual void open (file &name)
 
virtual void open (bool writable=false)
 
virtual void close ()
 
virtual ssize_t read (void *buffer, size_t size)
 
virtual ssize_t write (const void *buffer, size_t size)
 
virtual void seek (off_t offset)
 
virtual bool seek_read (off_t offset, uint8_t *buffer, size_t size)
 
virtual bool seek_write (off_t offset, const void *buffer, size_t size)
 
const filename () const
 
virtual int references () const
 
virtual size_t size () const
 
virtual int fd () const
 
elf::fileelf ()
 
virtual void symbol_referenced ()
 
virtual int symbol_references () const
 
const std::string path () const
 
bool is_open () const
 
bool is_writable () const
 

Detailed Description

Image is the base file type and lets us have a single container to hold the types of images we need to support.

Constructor & Destructor Documentation

rld::files::image::image ( file name)

Construct the image.

Parameters
nameThe name of the image.
rld::files::image::image ( const std::string &  path,
bool  is_object = true 
)

Construct the image.

Parameters
pathThe file path.
is_objectIf true (default) the name is for an object file.
rld::files::image::image ( )

Construct the image.

rld::files::image::~image ( )
virtual

Destruct the image.

Member Function Documentation

void rld::files::image::close ( )
virtual

Close the image.

Reimplemented in rld::files::object.

rld::elf::file & rld::files::image::elf ( )

The ELF reference.

Returns
elf::file& The elf::file object of the image.
int rld::files::image::fd ( ) const
virtual

The file descriptor.

Returns
int The operating system file descriptor handle.

Reimplemented in rld::files::object.

bool rld::files::image::is_open ( ) const
inline

Is the image open ?

Return values
trueThe image is open.
falseThe image is not open.
bool rld::files::image::is_writable ( ) const
inline

Is the image writable ?

Return values
trueThe image is writable.
falseThe image is not writable.
const file & rld::files::image::name ( ) const

The name of the image.

Parameters
constfile& The file name of the image.
void rld::files::image::open ( file name)
virtual

Open the image. You can open the image more than once but you need to close it the same number of times.

Parameters
nameThe file name.
void rld::files::image::open ( bool  writable = false)
virtual

Open the image. You can open the image more than once but you need to close it the same number of times.

Parameters
writeableIf true the image is open as writable. The default is false.

Reimplemented in rld::files::object.

const std::string rld::files::image::path ( ) const
inline

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.
ssize_t rld::files::image::read ( void *  buffer,
size_t  size 
)
virtual

Read a block from the file.

Parameters
bufferThe buffer to read the data into.
sizeThe amount of data to read.
Returns
ssize_t The amount of data read.
int rld::files::image::references ( ) const
virtual

References to the image.

Returns
int The number of references the image has.

Reimplemented in rld::files::object.

void rld::files::image::seek ( off_t  offset)
virtual

Seek to the offset in the image.

Parameters
offsetThe offset to seek too.
bool rld::files::image::seek_read ( off_t  offset,
uint8_t *  buffer,
size_t  size 
)
virtual

Seek and then read.

Parameters
offsetThe offset to seek too before reading.
bufferThe buffer to read the data into.
sizeThe amount of data to read.
Return values
trueThe data requested was read.
falseThe request data was not read.
bool rld::files::image::seek_write ( off_t  offset,
const void *  buffer,
size_t  size 
)
virtual

Seek and then write.

Parameters
offsetThe offset to seek too before writing.
bufferThe buffer of data to write.
sizeThe amount of data to write.
Return values
trueThe data requested was written.
falseThe request data was not written.
size_t rld::files::image::size ( ) const
virtual

The file size.

Returns
size_t The size of the image.

Reimplemented in rld::files::object.

void rld::files::image::symbol_referenced ( )
virtual

A symbol in the image has been referenced.

Reimplemented in rld::files::object.

int rld::files::image::symbol_references ( ) const
virtual

Return the number of symbol references.

Returns
int The symbol references count.
ssize_t rld::files::image::write ( const void *  buffer,
size_t  size 
)
virtual

Write a block from the file.

Parameters
bufferThe buffer of data to write.
sizeThe amount of data to write.
Returns
ssize_t The amount of data written.

The documentation for this class was generated from the following files: