LibPkg
module_info.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 // Copyright � 2003-2005 Graham Shaw.
3 // Copyright � 2014 Alan Buckley
4 // Distribution and use are subject to the GNU Lesser General Public License,
5 // a copy of which may be found in the file !LibPkg.Copyright.
6 
7 #ifndef LIBPKG_MODULE_INFO
8 #define LIBPKG_MODULE_INFO
9 
10 #include <string>
11 #include <stdexcept>
12 
13 
14 namespace pkg {
15 
20 {
21  std::string _title;
22  std::string _help_string;
23  std::string _version;
24  bool _read_ok;
25 
26 public:
31  module_info() {_read_ok = false;}
32  module_info(const std::string &path);
33  bool read(const std::string &path);
34  bool lookup(const std::string &title);
35 
40  bool read_ok() const {return _read_ok;}
45  const std::string &title() {return _title;}
50  const std::string &help_string() {return _help_string;}
56  std::string version() const {return _version;}
57 private:
58  void extract_version();
59 };
60 
61 }
62 
63 #endif
The namespace used to hold the package management library.
Definition: auto_dir.cc:12
module_info()
Construct an uninitialised module_info object Call the read method to initialise it.
Definition: module_info.h:31
bool read(const std::string &path)
Read module information from given path to module file.
Definition: module_info.cc:37
bool lookup(const std::string &title)
Look up module in loaded module list.
Definition: module_info.cc:71
Class to read the header details from a RISC OS Module.
Definition: module_info.h:19
bool read_ok() const
Check if module information has been update successfully.
Definition: module_info.h:40
const std::string & help_string()
Get module help string.
Definition: module_info.h:50
std::string version() const
Get the module version.
Definition: module_info.h:56
const std::string & title()
Get the module title.
Definition: module_info.h:45

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)