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 
64  bool has_space_info() const;
65 
79 
83  void set_space_info(const SpaceInfo& space_info);
84 
85  public:
86 
87  class Impl;
88 
89  Impl& get_impl();
90  const Impl& get_impl() const;
91 
92  protected:
93 
94  Filesystem(Impl* impl);
95 
96  };
97 
98 
104  bool is_filesystem(const Device* device);
105 
112  Filesystem* to_filesystem(Device* device);
113 
117  const Filesystem* to_filesystem(const Device* device);
118 
119 }
120 
121 #endif
static std::vector< Filesystem * > get_all(Devicegraph *devicegraph)
Get all Filesystems.
bool is_filesystem(const Device *device)
Checks whether device points to a Filesystem.
SpaceInfo detect_space_info() const
Detect the SpaceInfo.
bool has_space_info() const
Query whether the SpaceInfo was already detected or set.
FsType get_type() const
Get the filesystem type.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
Definition: Mountable.h:111
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 for storage devices.
Definition: Device.h:81
Definition: FreeInfo.h:330
Definition: Filesystem.h:40
The storage namespace.
Definition: Actiongraph.h:39