libstorage-ng
Filesystem.h
1 /*
2  * Copyright (c) [2014-2015] Novell, Inc.
3  * Copyright (c) [2016-2017] SUSE LLC
4  *
5  * All Rights Reserved.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of version 2 of the GNU General Public License as published
9  * by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, contact Novell, Inc.
18  *
19  * To contact Novell about this file by physical or electronic mail, you may
20  * find current contact information at www.novell.com.
21  */
22 
23 
24 #ifndef STORAGE_FILESYSTEM_H
25 #define STORAGE_FILESYSTEM_H
26 
27 
28 #include <vector>
29 
30 #include "storage/Filesystems/Mountable.h"
31 
32 
33 namespace storage
34 {
35  class SpaceInfo;
36 
37 
38  // abstract class
39 
40  class Filesystem : public Mountable
41  {
42  public:
43 
47  static std::vector<Filesystem*> get_all(Devicegraph* devicegraph);
48 
52  static std::vector<const Filesystem*> get_all(const Devicegraph* devicegraph);
53 
59  FsType get_type() const;
60 
61  bool has_space_info() const;
62 
69 
73  void set_space_info(const SpaceInfo& space_info);
74 
75  public:
76 
77  class Impl;
78 
79  Impl& get_impl();
80  const Impl& get_impl() const;
81 
82  protected:
83 
84  Filesystem(Impl* impl);
85 
86  };
87 
88 
94  bool is_filesystem(const Device* device);
95 
103 
107  const Filesystem* to_filesystem(const Device* device);
108 
109 }
110 
111 #endif
storage::is_filesystem
bool is_filesystem(const Device *device)
Checks whether device points to a Filesystem.
storage::Filesystem::get_all
static std::vector< Filesystem * > get_all(Devicegraph *devicegraph)
Get all Filesystems.
storage
The storage namespace.
Definition: Actiongraph.h:39
storage::Filesystem::set_space_info
void set_space_info(const SpaceInfo &space_info)
Set the SpaceInfo.
storage::Mountable
Definition: Mountable.h:101
storage::to_filesystem
Filesystem * to_filesystem(Device *device)
Converts pointer to Device to pointer to Filesystem.
storage::Devicegraph
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
storage::Filesystem::get_type
FsType get_type() const
Get the filesystem type.
storage::SpaceInfo
Definition: FreeInfo.h:274
storage::Device
An abstract base class for storage devices.
Definition: Device.h:82
storage::Filesystem
Definition: Filesystem.h:41
storage::Filesystem::detect_space_info
SpaceInfo detect_space_info() const
So far only supported for Nfs.
storage::Filesystem::get_all
static std::vector< const Filesystem * > get_all(const Devicegraph *devicegraph)
Get all Filesystems.