LibPkg
|
A class to represent a component of a package. More...
#include <component.h>
Classes | |
class | parse_error |
An exception class for reporting parse errors. More... | |
Public Types | |
enum | flag_type { movable, look_at, run, add_to_apps } |
The options available/selected for this component. More... | |
Public Member Functions | |
component () | |
Empty constructor, unnamed component with no flags. More... | |
component (std::string::const_iterator first, std::string::const_iterator last) | |
Construct a component from a sequence. More... | |
component (const std::string &compstr) | |
Construct component from string. More... | |
~component () | |
Destroy component. More... | |
bool | operator== (const component &other) const |
Check if it is the same as another component. More... | |
bool | operator!= (const component &other) const |
Check if it is different from another component. More... | |
operator std::string () const | |
Convert component to string. More... | |
const std::string & | name () const |
Get the name of the component The name is the same as the logical path to the component. More... | |
unsigned int | flags () const |
Get the bit field containing the component flags. More... | |
bool | flag (flag_type flag) const |
Get component flag. More... | |
void | flag (flag_type flag, bool value) |
Set component flag. More... | |
const std::string & | path () const |
Get the installation path. More... | |
void | path (const std::string &path) |
Set the installation path. More... | |
A class to represent a component of a package.
A component is a file or folder that has extra metadata associated with it to configure it at install time.
From LibPkg 0.4 any path that can be set at install time should have a component included with the Moveable flag set.
The options available/selected for this component.
pkg::component::component | ( | ) |
Empty constructor, unnamed component with no flags.
Referenced by pkg::operator>>().
pkg::component::component | ( | std::string::const_iterator | first, |
std::string::const_iterator | last | ||
) |
Construct a component from a sequence.
This is the name followed by space separated options in brackets
first | beginning of sequence |
last | end of sequence |
pkg::component::component | ( | const std::string & | compstr | ) |
Construct component from string.
compstr | the component string |
pkg::component::~component | ( | ) |
Destroy component.
bool pkg::component::operator== | ( | const component & | other | ) | const |
Check if it is the same as another component.
bool pkg::component::operator!= | ( | const component & | other | ) | const |
Check if it is different from another component.
pkg::component::operator std::string | ( | ) | const |
Convert component to string.
Does not include the path
References add_to_apps, flag(), and movable.
|
inline |
Get the name of the component The name is the same as the logical path to the component.
Referenced by pkg::component_update::insert(), and pkg::commit::poll().
|
inline |
Get the bit field containing the component flags.
|
inline |
Get component flag.
flag | the flag to be read |
Referenced by flag(), operator std::string(), and pkg::commit::poll().
void pkg::component::flag | ( | flag_type | flag, |
bool | value | ||
) |
Set component flag.
flag | the flag to be altered |
value | the required value |
References add_to_apps, flag(), and movable.
|
inline |
Get the installation path.
Referenced by pkg::operator<<(), pkg::operator>>(), and pkg::commit::poll().
|
inline |
Reference Manual | LibPkg | Version 0.9.0 (4 Sep 2020) |