7 #ifndef LIBPKG_COMPONENT 8 #define LIBPKG_COMPONENT 68 component(std::string::const_iterator first, std::string::const_iterator last);
87 operator std::string()
const;
93 const std::string &
name()
const {
return _name;}
98 unsigned int flags()
const {
return _flags;}
105 {
return (_flags>>flag)&1; }
116 const std::string &
path()
const {
return _path;}
128 void parse(std::string::const_iterator first,std::string::const_iterator last);
134 public std::runtime_error
149 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:179
unsigned int flags() const
Get the bit field containing the component flags.
Definition: component.h:98
A flag to indicate this component should be added to the RISC OS application pseudo folder...
Definition: component.h:45
The namespace used to hold the package management library.
Definition: auto_dir.cc:12
component()
Empty constructor, unnamed component with no flags.
Definition: component.cc:21
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:93
A flag to indicate this component can have it's install location changed and it may be moved after in...
Definition: component.h:36
bool flag(flag_type flag) const
Get component flag.
Definition: component.h:104
std::istream & operator>>(std::istream &in, component &comp)
Read component record from input stream.
Definition: component.cc:193
const std::string & path() const
Get the installation path.
Definition: component.h:116
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:39
An exception class for reporting parse errors.
Definition: component.h:133
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:42
void path(const std::string &path)
Set the installation path.
Definition: component.h:121
A class to represent a component of a package.
Definition: component.h:27
flag_type
The options available/selected for this component.
Definition: component.h:32
~component()
Destroy component.
Definition: component.cc:33
bool operator!=(const component &other) const
Check if it is different from another component.
Definition: component.cc:42
bool operator==(const component &other) const
Check if it is the same as another component.
Definition: component.cc:37
void parse_component_list(std::string::const_iterator first, std::string::const_iterator last, std::vector< component > *out)
Parse component list.
Definition: component.cc:139