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 
44  static std::vector<Filesystem*> get_all(Devicegraph* devicegraph);
45  static std::vector<const Filesystem*> get_all(const Devicegraph* devicegraph);
46 
47  FsType get_type() const;
48 
49  bool has_space_info() const;
50 
57 
61  void set_space_info(const SpaceInfo& space_info);
62 
63  public:
64 
65  class Impl;
66 
67  Impl& get_impl();
68  const Impl& get_impl() const;
69 
70  protected:
71 
72  Filesystem(Impl* impl);
73 
74  };
75 
76 
77  bool is_filesystem(const Device* device);
78 
86 
90  const Filesystem* to_filesystem(const Device* device);
91 
92 }
93 
94 #endif
SpaceInfo detect_space_info() const
So far only supported for Nfs.
The master container of the libstorage.
Definition: Devicegraph.h:153
Definition: Mountable.h:89
Filesystem * to_filesystem(Device *device)
Converts pointer to Device to pointer to Filesystem.
void set_space_info(const SpaceInfo &space_info)
Set the SpaceInfo.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
Definition: FreeInfo.h:254
Definition: Filesystem.h:40
The storage namespace.
Definition: Actiongraph.h:37