From 0d626d668ba6c14022ca88611aff2365cbe4f30c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 31 Oct 2019 13:05:47 -0500 Subject: hscript: Implement lvm_lv, add tests --- hscript/disk.hh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'hscript/disk.hh') diff --git a/hscript/disk.hh b/hscript/disk.hh index a9adba4..43bb56d 100644 --- a/hscript/disk.hh +++ b/hscript/disk.hh @@ -145,6 +145,28 @@ public: }; class LVMVolume : public Key { +private: + const std::string _vg; + const std::string _lvname; + const SizeType _size_type; + const uint64_t _size; + + LVMVolume(int _line, const std::string &_v, const std::string &_n, + SizeType _t, uint64_t _s) : Key(_line), _vg(_v), _lvname(_n), + _size_type(_t), _size(_s) {} +public: + /*! Retrieve the volume group to which this volume belongs. */ + const std::string vg() const { return this->_vg; } + /*! Retrieve the name of this volume. */ + const std::string name() const { return this->_lvname; } + /*! Retrieve the type of size that this volume uses. */ + SizeType size_type() const { return this->_size_type; } + /*! Retrieve the size of this volume. */ + uint64_t size() const { return this->_size; } + + static Key *parseFromData(const std::string &, int, int*, int*); + bool validate(ScriptOptions) const override; + bool execute(ScriptOptions) const override; }; class Filesystem : public Key { -- cgit v1.2.3-60-g2f50