24 #ifndef STORAGE_STORAGE_H
25 #define STORAGE_STORAGE_H
31 #include <boost/noncopyable.hpp>
87 virtual void message(
const std::string& message)
const = 0;
88 virtual bool error(
const std::string& message,
const std::string& what)
const = 0;
92 virtual void pre(
const Action::Base* action)
const {}
93 virtual void post(
const Action::Base* action)
const {}
99 class Storage :
private boost::noncopyable
109 const Arch& get_arch()
const;
111 Devicegraph* create_devicegraph(
const std::string& name);
112 Devicegraph* copy_devicegraph(
const std::string& source_name,
const std::string& dest_name);
113 void remove_devicegraph(
const std::string& name);
114 void restore_devicegraph(
const std::string& name);
116 bool equal_devicegraph(
const std::string& lhs,
const std::string& rhs)
const;
118 bool exist_devicegraph(
const std::string& name)
const;
119 std::vector<std::string> get_devicegraph_names()
const;
148 const std::string& get_rootprefix()
const;
149 void set_rootprefix(
const std::string& rootprefix);
171 Impl& get_impl() {
return *impl; }
172 const Impl& get_impl()
const {
return *impl; }
176 const std::unique_ptr<Impl> impl;
Definition: Environment.h:52
void commit(const CommitCallbacks *commit_callbacks=nullptr)
The actiongraph must be valid.
std::string prepend_rootprefix(const std::string &mountpoint) const
Prepends the root prefix to a mountpoint if necessary.
const Actiongraph * calculate_actiongraph()
The actiongraph is only valid until either the probed or staging devicegraph is modified.
The master container of the libstorage.
Definition: Devicegraph.h:133
Devicegraph * get_devicegraph(const std::string &name)
Return a devicegraph by name.
Definition: Actiongraph.h:54
Devicegraph * get_staging()
Return the staging devicegraph.
The main entry point to libstorage.
Definition: Storage.h:99
The storage namespace.
Definition: Actiongraph.h:36
const Devicegraph * get_probed() const
Return the probed devicegraph.