6 #ifndef LIBPKG_PATH_TABLE
7 #define LIBPKG_PATH_TABLE
43 std::map<key_type,mapped_type>
_data;
67 {
return _data.begin(); }
73 {
return _data.end(); }
99 {
return _data.size(); }
123 bool read(
const string& pathname);
128 public std::runtime_error
139 public std::runtime_error
148 public std::runtime_error
const_iterator find(const string &src_pathname)
Find table entry.
Definition: path_table.cc:101
void erase(const string &src_pathname)
Erase table entry.
Definition: path_table.cc:118
virtual ~path_table()
Destroy path table.
Definition: path_table.cc:59
void rollback()
Roll back changes.
Definition: path_table.cc:171
parse_error(const string &message)
Construct parse error.
Definition: path_table.cc:282
An exception class for reporting failure to commit table.
Definition: path_table.h:147
size_t size() const
Get number of paths in table.
Definition: path_table.h:98
char * _data
Definition: zipfile.cc:68
string resolve_pathrefs(const path_table &paths, const string &in)
Resolve logical path references.
Definition: path_table.cc:294
string key_type
Definition: path_table.h:28
string operator()(const string &src_pathname, const string &pkgname) const
Convert source pathname to destination pathname.
Definition: path_table.cc:62
path_table()
Construct empty path table.
Definition: path_table.cc:50
bool ensure_defaults()
Ensure that default paths are present in the table.
Definition: path_table.cc:182
void alter(const string &src_pathname, const string &dst_pathname)
Alter table entry.
Definition: path_table.cc:112
void commit()
Commit changes.
Definition: path_table.cc:130
invalid_source_path(const string &path)
Construct invalid source path error.
Definition: path_table.cc:286
string mapped_type
Definition: path_table.h:29
const_iterator end() const
Get const iterator for end of table.
Definition: path_table.h:72
const char * dst_pathname
Definition: path_table.cc:20
void clear()
Clear all paths.
Definition: path_table.cc:124
std::map< key_type, mapped_type >::const_iterator const_iterator
Definition: path_table.h:30
commit_error()
Construct commit error.
Definition: path_table.cc:290
const char * src_pathname
Definition: path_table.cc:19
An exception class for reporting invalid source paths.
Definition: path_table.h:138
A base class to represent a data table.
Definition: table.h:18
An exception class for reporting parse errors.
Definition: path_table.h:127
A class for mapping source paths to destination paths.
Definition: path_table.h:24
const_iterator begin() const
Get const iterator for start of table.
Definition: path_table.h:66