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

Classes

class  file
 
class  image
 
class  archive
 
struct  relocation
 
struct  section
 
class  object
 
class  cache
 

Typedefs

typedef std::vector< std::string > paths
 
typedef std::vector< filefiles
 
typedef std::map< const
std::string, archive * > 
archives
 
typedef std::map< const
std::string, object * > 
objects
 
typedef std::list< object * > object_list
 
typedef std::list< relocationrelocations
 
typedef std::list< sectionsections
 

Functions

uint64_t scan_decimal (const uint8_t *string, size_t len)
 
void set_number (uint32_t value, uint8_t *string, size_t len, bool octal=false)
 
std::string basename (const std::string &name)
 
std::string dirname (const std::string &name)
 
std::string extension (const std::string &name)
 
void path_split (const std::string &path, rld::files::paths &paths)
 
void path_join (const std::string &path_, const std::string &file_, std::string &joined)
 
bool check_file (const std::string &path)
 
bool check_directory (const std::string &path)
 
void find_file (std::string &path, const std::string &name, paths &search_paths)
 
void copy_file (image &in, image &out, size_t size)
 
size_t sum_sizes (const sections &secs)
 
const sectionfind (const sections &secs, const int index)
 
void find_libraries (paths &libraries, paths &libpaths, paths &libs)
 
void copy (image &in, image &out, size_t size)
 

Detailed Description

Forward declarations.

Typedef Documentation

typedef std::map< const std::string, archive* > rld::files::archives

Container of archive files.

typedef std::vector< file > rld::files::files

Container of files.

typedef std::list< object* > rld::files::object_list

Container list of object files.

typedef std::map< const std::string, object* > rld::files::objects

Container of object files.

typedef std::vector< std::string > rld::files::paths

Container of file paths.

typedef std::list< relocation > rld::files::relocations

A container of relocations.

typedef std::list< section > rld::files::sections

A container of sections.

Function Documentation

std::string rld::files::basename ( const std::string &  name)

Return the basename of the file name.

Parameters
nameThe full file name.
Returns
std::string The basename of the file.
bool rld::files::check_directory ( const std::string &  path)

Check if the path is a directory.

Parameters
pathThe path to check.
Return values
falseThe path is not a directory.
trueThe path is a directory.
bool rld::files::check_file ( const std::string &  path)

Check the path is a file using a stat call.

Parameters
pathThe path to check.
Return values
trueThe path is valid.
falseThe path is not valid.
void rld::files::copy ( image &  in,
image &  out,
size_t  size 
)

Copy the input section of the image to the output section. The file positions in the images must be set before making the call.

Parameters
inThe input image.
outThe output image.
sizeThe amouint of data to copy.
void rld::files::copy_file ( image &  in,
image &  out,
size_t  size = 0 
)

Copy the in file to the out file.

Parameters
inThe input file.
outThe output file.
sizeThe amount to copy. If 0 the whole on in is copied.
std::string rld::files::dirname ( const std::string &  name)

Return the dirname of the file name.

Parameters
nameThe full file name.
Returns
std::string The dirname of the file.
std::string rld::files::extension ( const std::string &  name)

Return the extension of the file name.

Parameters
nameThe full file name.
Returns
std::string The extension of the file.
const section * rld::files::find ( const sections &  secs,
const int  index 
)

Find the section that matches the index in the sections provided.

void rld::files::find_file ( std::string &  path,
const std::string &  name,
paths &  search_paths 
)

Find the file given a container of paths and file names.

Parameters
pathThe path of the file if found else empty.
nameThe name of the file to search for.
search_pathsThe container of paths to search.
void rld::files::find_libraries ( paths &  libraries,
paths &  libpaths,
paths &  libs 
)

Find the libraries given the list of libraries as bare name which have 'lib' and '.a' added.

void rld::files::path_join ( const std::string &  path_,
const std::string &  file_,
std::string &  joined 
)

Make a path by joining the parts with required separator.

Parameters
path_The path component to be joined.
file_The file name to add to the path.
joinedThe joined path and file name with a path separator.
void rld::files::path_split ( const std::string &  path,
paths &  paths 
)

Split a path from a string with a delimiter to the path container. Add only the paths that exist and ignore those that do not.

Parameters
pathThe paths as a single string delimited by the path separator.
pathsThe split path paths.
uint64_t rld::files::scan_decimal ( const uint8_t *  string,
size_t  len 
)

Scan the decimal number returning the value found.

void rld::files::set_number ( uint32_t  value,
uint8_t *  string,
size_t  len,
bool  octal = false 
)
size_t rld::files::sum_sizes ( const sections &  secs)

Sum the sizes of a container of sections.