LibPkg
source_table.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 //
3 // Copyright 2003-2020 Graham Shaw
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef LIBPKG_SOURCE_TABLE
18 #define LIBPKG_SOURCE_TABLE
19 
20 #include <list>
21 #include <string>
22 
23 #include "libpkg/table.h"
24 
25 namespace pkg {
26 
27 using std::string;
28 
38  public table
39 {
40 public:
41  typedef string value_type;
42  typedef std::list<value_type>::const_iterator const_iterator;
43 private:
45  string _dpathname;
46 
48  string _pathname;
49 
51  std::list<string> _data;
52 public:
57  source_table(const string& dpathname,const string& pathname);
58 
60  virtual ~source_table();
61 
65  const_iterator begin() const
66  { return _data.begin(); }
67 
71  const_iterator end() const
72  { return _data.end(); }
73 
75  void update();
76 private:
81  bool read(const string& pathname);
82 };
83 
84 }; /* namespace pkg */
85 
86 #endif
const_iterator end() const
Get const iterator for end of table.
Definition: source_table.h:71
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
const_iterator begin() const
Get const iterator for start of table.
Definition: source_table.h:65
void update()
Re-read the default and configured sources files.
Definition: source_table.cc:33
A class for holding a list of source URLs.
Definition: source_table.h:37
source_table(const string &dpathname, const string &pathname)
Construct source table.
Definition: source_table.cc:23
virtual ~source_table()
Destroy source table.
Definition: source_table.cc:30
string value_type
Definition: source_table.h:41
std::list< value_type >::const_iterator const_iterator
Definition: source_table.h:42
A base class to represent a data table.
Definition: table.h:29

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)