Horizon::DiskMan::DiskMan(3)

NAME
Horizon::DiskMan::DiskMan - main class of the Horizon Disk Manager

SYNOPSIS
#include <diskman/diskman.hh>
using Horizon::DiskMan::DiskMan;
vector<Disk>
DiskMan::find_disks(bool include_part = true, bool include_vg = true, bool include_lvm = false);

DESCRIPTION
The Horizon::DiskMan::DiskMan class provides a facility for inspecting the fixed disk(s) present on a computer.

Calling the DiskMan::find_disks() function will return a vector of Horizon::DiskMan::Disk containing all fixed disks presently attached to the system. The DiskMan::find_disks() function allows you to control the data returned with three arguments: include_part, which if true will include partition information when a fixed disk contains a readable disk label; include_vg, which if true will include each LVM volume group as a Disk; and include_lvm, which if true will include each LVM logical volume as a Disk.

You should only create instances of Horizon::DiskMan::DiskMan; the DiskMan class will provide you with the relevant instances of Disk and Parition.

RETURN VALUES
The DiskMan::find_disks() function returns a std::vector of Horizon::DiskMan::Disk objects describing all fixed disks attached to the system.

EXAMPLES

    #include <diskman/diskman.hh>
    #include <iostream>
    using Horizon::DiskMan::DiskMan;
    int main(void) {
        DiskMan diskMan;
        auto disks = diskMan.find_disks(false, false, false);
        std::cout << "Found " << std::to_string(disks.size()) << " disk(s):" << std::endl;
        for(auto &disk : disks) {
            std::cout << "==========================================" << std::endl;
            std::cout << "Disk: " << disk.name() << " (" << disk.model() << ")";
            std::cout << " at " << disk.dev_path() << std::endl;
            std::cout << "==========================================" << std::endl;
        }
        return 0;
    }

SEE ALSO
Horizon::DiskMan::Disk(3), Horizon::DiskMan::Partition(3).

HISTORY
The DiskMan library first appeared in Horizon 0.9.

AUTHORS
A. Wilcox <awilfox@adelielinux.org>