LibPkg
source_table.h
Go to the documentation of this file.
1 // This file is part of LibPkg.
2 // Copyright © 2003-2005 Graham Shaw.
3 // Distribution and use are subject to the GNU Lesser General Public License,
4 // a copy of which may be found in the file !LibPkg.Copyright.
5 
6 #ifndef LIBPKG_SOURCE_TABLE
7 #define LIBPKG_SOURCE_TABLE
8 
9 #include <list>
10 #include <string>
11 
12 #include "libpkg/table.h"
13 
14 namespace pkg {
15 
16 using std::string;
17 
27  public table
28 {
29 public:
30  typedef string value_type;
31  typedef std::list<value_type>::const_iterator const_iterator;
32 private:
34  string _dpathname;
35 
37  string _pathname;
38 
40  std::list<string> _data;
41 public:
46  source_table(const string& dpathname,const string& pathname);
47 
49  virtual ~source_table();
50 
55  { return _data.begin(); }
56 
61  { return _data.end(); }
62 
64  void update();
65 private:
70  bool read(const string& pathname);
71 };
72 
73 }; /* namespace pkg */
74 
75 #endif
const_iterator begin() const
Get const iterator for start of table.
Definition: source_table.h:54
void update()
Re-read the default and configured sources files.
Definition: source_table.cc:22
const_iterator end() const
Get const iterator for end of table.
Definition: source_table.h:60
A class for holding a list of source URLs.
Definition: source_table.h:26
source_table(const string &dpathname, const string &pathname)
Construct source table.
Definition: source_table.cc:12
virtual ~source_table()
Destroy source table.
Definition: source_table.cc:19
string value_type
Definition: source_table.h:30
std::list< value_type >::const_iterator const_iterator
Definition: source_table.h:31
A base class to represent a data table.
Definition: table.h:18

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)