16 #ifndef LIBPKG_PATH_TABLE 17 #define LIBPKG_PATH_TABLE 53 std::map<key_type,mapped_type> _data;
77 {
return _data.begin(); }
82 const_iterator
end()
const 83 {
return _data.end(); }
100 void erase(
const string& src_pathname);
109 {
return _data.size(); }
133 bool read(
const string& pathname);
138 public std::runtime_error
149 public std::runtime_error
158 public std::runtime_error
const_iterator find(const string &src_pathname)
Find table entry.
Definition: path_table.cc:116
void erase(const string &src_pathname)
Erase table entry.
Definition: path_table.cc:133
size_t size() const
Get number of paths in table.
Definition: path_table.h:108
virtual ~path_table()
Destroy path table.
Definition: path_table.cc:74
void rollback()
Roll back changes.
Definition: path_table.cc:186
string operator()(const string &src_pathname, const string &pkgname) const
Convert source pathname to destination pathname.
Definition: path_table.cc:77
An exception class for reporting failure to commit table.
Definition: path_table.h:157
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
string resolve_pathrefs(const path_table &paths, const string &in)
Resolve logical path references.
Definition: path_table.cc:309
string key_type
Definition: path_table.h:38
path_table()
Construct empty path table.
Definition: path_table.cc:65
bool ensure_defaults()
Ensure that default paths are present in the table.
Definition: path_table.cc:197
void alter(const string &src_pathname, const string &dst_pathname)
Alter table entry.
Definition: path_table.cc:127
const_iterator begin() const
Get const iterator for start of table.
Definition: path_table.h:76
void commit()
Commit changes.
Definition: path_table.cc:145
string mapped_type
Definition: path_table.h:39
const_iterator end() const
Get const iterator for end of table.
Definition: path_table.h:82
const char * dst_pathname
Definition: path_table.cc:32
void clear()
Clear all paths.
Definition: path_table.cc:139
std::map< key_type, mapped_type >::const_iterator const_iterator
Definition: path_table.h:40
const char * src_pathname
Definition: path_table.cc:31
An exception class for reporting invalid source paths.
Definition: path_table.h:148
A base class to represent a data table.
Definition: table.h:29
An exception class for reporting parse errors.
Definition: path_table.h:137
A class for mapping source paths to destination paths.
Definition: path_table.h:34