18 #ifndef LIBPKG_COMPONENT 19 #define LIBPKG_COMPONENT 79 component(std::string::const_iterator first, std::string::const_iterator last);
98 operator std::string()
const;
104 const std::string &
name()
const {
return _name;}
109 unsigned int flags()
const {
return _flags;}
116 {
return (_flags>>flag)&1; }
127 const std::string &
path()
const {
return _path;}
139 void parse(std::string::const_iterator first,std::string::const_iterator last);
145 public std::runtime_error
160 std::string::const_iterator last,std::vector<component> *out);
std::ostream & operator<<(std::ostream &out, const component &comp)
Write component record to output stream.
Definition: component.cc:190
unsigned int flags() const
Get the bit field containing the component flags.
Definition: component.h:109
A flag to indicate this component should be added to the RISC OS application pseudo folder...
Definition: component.h:56
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
component()
Empty constructor, unnamed component with no flags.
Definition: component.cc:32
const std::string & name() const
Get the name of the component The name is the same as the logical path to the component.
Definition: component.h:104
A flag to indicate this component can have it's install location changed and it may be moved after in...
Definition: component.h:47
bool flag(flag_type flag) const
Get component flag.
Definition: component.h:115
std::istream & operator>>(std::istream &in, component &comp)
Read component record from input stream.
Definition: component.cc:204
const std::string & path() const
Get the installation path.
Definition: component.h:127
A flag to indicate this component should be added to the RISC OS boot look at file, so it is booted when the desktop starts.
Definition: component.h:50
An exception class for reporting parse errors.
Definition: component.h:144
A flag to indicate this component should be added to the RISC OS boot run file, so it is run when the...
Definition: component.h:53
void path(const std::string &path)
Set the installation path.
Definition: component.h:132
A class to represent a component of a package.
Definition: component.h:38
flag_type
The options available/selected for this component.
Definition: component.h:43
~component()
Destroy component.
Definition: component.cc:44
bool operator!=(const component &other) const
Check if it is different from another component.
Definition: component.cc:53
bool operator==(const component &other) const
Check if it is the same as another component.
Definition: component.cc:48
void parse_component_list(std::string::const_iterator first, std::string::const_iterator last, std::vector< component > *out)
Parse component list.
Definition: component.cc:150