LibPkg
module_info.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 //
3 // Copyright 2003-2020 Graham Shaw
4 // Copyright 2014-2020 Alan Buckley
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 // You may obtain a copy of the License at
9 //
10 // http://www.apache.org/licenses/LICENSE-2.0
11 //
12 // Unless required by applicable law or agreed to in writing, software
13 // distributed under the License is distributed on an "AS IS" BASIS,
14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 // See the License for the specific language governing permissions and
16 // limitations under the License.
17 
18 #ifndef LIBPKG_MODULE_INFO
19 #define LIBPKG_MODULE_INFO
20 
21 #include <string>
22 #include <stdexcept>
23 
24 
25 namespace pkg {
26 
31 {
32  std::string _title;
33  std::string _help_string;
34  std::string _version;
35  bool _read_ok;
36 
37 public:
42  module_info() {_read_ok = false;}
43  module_info(const std::string &path);
44  bool read(const std::string &path);
45  bool lookup(const std::string &title);
46 
51  bool read_ok() const {return _read_ok;}
56  const std::string &title() {return _title;}
61  const std::string &help_string() {return _help_string;}
67  std::string version() const {return _version;}
68 private:
69  void extract_version();
70 };
71 
72 }
73 
74 #endif
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
module_info()
Construct an uninitialised module_info object Call the read method to initialise it.
Definition: module_info.h:42
bool read(const std::string &path)
Read module information from given path to module file.
Definition: module_info.cc:48
bool lookup(const std::string &title)
Look up module in loaded module list.
Definition: module_info.cc:82
Class to read the header details from a RISC OS Module.
Definition: module_info.h:30
bool read_ok() const
Check if module information has been update successfully.
Definition: module_info.h:51
const std::string & help_string()
Get module help string.
Definition: module_info.h:61
std::string version() const
Get the module version.
Definition: module_info.h:67
const std::string & title()
Get the module title.
Definition: module_info.h:56

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)