A class containing mappings from an image basename, such as 'floppy.ko', to locations in the paths passed in to populate(). More...
#include <locate_images.h>
Classes | |
| struct | matcher |
| base class for matcher functors object More... | |
Public Member Functions | |
| extra_images () | |
| void | populate (std::vector< std::string > const &paths, std::string const &archive_path, std::string const &root_path) |
| add all filenames found in the given paths prefixed by the archive path or the root path, recursively | |
| std::vector< std::string > const | find (matcher const &match) const |
| return a vector of all directories that match the functor | |
| std::vector< std::string > const | find (std::string const &name) const |
| return a vector of all directories that match the given name | |
| std::string const | find_image_path (std::string const &image_name, image_error &error, bool fixup) const |
| std::string | get_archive_path () const |
| return the archive path used to populate the images name map | |
| std::string | strip_path_prefix (std::string const &image) const |
| Given an image name returned by find_image_path() return a filename with the archive_path or root_path stripped. | |
| int | get_uid () const |
| return the uid for this extra_images, first valid uid is 1 | |
A class containing mappings from an image basename, such as 'floppy.ko', to locations in the paths passed in to populate().
The name may exist multiple times; all locations are recorded in this container.
| extra_images::extra_images | ( | ) |
| std::vector<std::string> const extra_images::find | ( | std::string const & | name | ) | const |
return a vector of all directories that match the given name
| vector< string > const extra_images::find | ( | extra_images::matcher const & | match | ) | const |
return a vector of all directories that match the functor
| std::string const extra_images::find_image_path | ( | std::string const & | image_name, | |
| image_error & | error, | |||
| bool | fixup | |||
| ) | const |
| image_name | binary image name | |
| error | errors are flagged in this passed enum ref | |
| fixup | if true return the fixed image name else always return image_name and update error |
Locate a (number of) matching absolute paths to the given image name. If we fail to find the file we fill in error and return the original string.
Referenced by image_name_storage::get_name(), and populate_for_image().
| std::string extra_images::get_archive_path | ( | ) | const [inline] |
return the archive path used to populate the images name map
Referenced by report_image_error().
| int extra_images::get_uid | ( | ) | const [inline] |
return the uid for this extra_images, first valid uid is 1
Referenced by image_name_storage::get_name().
| void extra_images::populate | ( | std::vector< std::string > const & | paths, | |
| std::string const & | archive_path, | |||
| std::string const & | root_path | |||
| ) |
add all filenames found in the given paths prefixed by the archive path or the root path, recursively
| std::string extra_images::strip_path_prefix | ( | std::string const & | image | ) | const |
Given an image name returned by find_image_path() return a filename with the archive_path or root_path stripped.
Referenced by parse_filename().
1.6.1