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:175
A flag to indicate this component should be added to the RISC OS application pseudo folder...
Definition: component.h:45
parse_error(const char *message)
Construct parse error.
Definition: component.cc:131
component()
Empty constructor, unnamed component with no flags.
Definition: component.cc:21
A flag to indicate this component can have it's install location changed and it may be moved after in...
Definition: component.h:36
std::istream & operator>>(std::istream &in, component &comp)
Read component record from input stream.
Definition: component.cc:189
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
bool flag(flag_type flag) const
Get component flag.
Definition: component.h:104
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
const std::string & path() const
Get the installation path.
Definition: component.h:116
flag_type
The options available/selected for this component.
Definition: component.h: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:93
~component()
Destroy component.
Definition: component.cc:33
void parse_component_list(std::string::const_iterator first, std::string::const_iterator last, std::vector< component > *out)
Parse component list.
Definition: component.cc:135
unsigned int flags() const
Get the bit field containing the component flags.
Definition: component.h:98