libstorage-ng
Toggle main menu visibility
Loading...
Searching...
No Matches
Environment.h
1
/*
2
* Copyright (c) [2014-2015] Novell, Inc.
3
* Copyright (c) 2022 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_ENVIRONMENT_H
25
#define STORAGE_ENVIRONMENT_H
26
27
28
#include <string>
29
#include <memory>
30
31
32
namespace
storage
33
{
34
36
enum class
ProbeMode
{
37
STANDARD,
// probe system during init
38
STANDARD_WRITE_DEVICEGRAPH,
// probe system during init, write devicegraph
39
STANDARD_WRITE_MOCKUP,
// probe system during init, write mockup
40
NONE,
// no probing - for testsuite
41
READ_DEVICEGRAPH,
// fake probe - for testsuite
42
READ_MOCKUP
// fake probe - for testsuite
43
};
44
45
49
enum class
TargetMode
{
50
52
DIRECT
,
53
55
CHROOT
,
56
58
IMAGE
59
60
};
61
62
63
class
Environment
64
{
65
public
:
66
67
Environment(
bool
read_only);
68
Environment(
bool
read_only,
ProbeMode
probe_mode,
TargetMode
target_mode);
69
Environment(
const
Environment& environment);
70
~Environment();
71
72
Environment& operator=(
const
Environment& environment) =
delete
;
73
77
bool
is_read_only
()
const
;
78
84
ProbeMode
get_probe_mode
()
const
;
85
91
TargetMode
get_target_mode
()
const
;
92
102
const
std::string&
get_rootprefix
()
const
;
103
111
void
set_rootprefix
(
const
std::string& rootprefix);
112
113
const
std::string& get_devicegraph_filename()
const
;
114
void
set_devicegraph_filename(
const
std::string& devicegraph_filename);
115
116
const
std::string& get_arch_filename()
const
;
117
void
set_arch_filename(
const
std::string& arch_filename);
118
119
const
std::string& get_mockup_filename()
const
;
120
void
set_mockup_filename(
const
std::string& mockup_filename);
121
122
friend
std::ostream& operator<<(std::ostream& out,
const
Environment& environment);
123
124
public
:
125
126
class
Impl;
127
128
Impl& get_impl() {
return
*impl; }
129
const
Impl& get_impl()
const
{
return
*impl; }
130
131
private
:
132
133
const
std::unique_ptr<Impl> impl;
134
135
};
136
137
}
138
139
#endif
storage::Environment::get_rootprefix
const std::string & get_rootprefix() const
Query the rootprefix.
storage::Environment::is_read_only
bool is_read_only() const
Return whether the Environment has read-only set.
storage::Environment::set_rootprefix
void set_rootprefix(const std::string &rootprefix)
Set the rootprefix.
storage::Environment::get_probe_mode
ProbeMode get_probe_mode() const
Return the probe mode.
storage::Environment::get_target_mode
TargetMode get_target_mode() const
return the target mode.
storage
The storage namespace.
Definition
Actiongraph.h:40
storage::ProbeMode
ProbeMode
How to probe the system.
Definition
Environment.h:36
storage::TargetMode
TargetMode
Enum with target modes.
Definition
Environment.h:49
storage::TargetMode::IMAGE
@ IMAGE
The target is image based.
Definition
Environment.h:58
storage::TargetMode::CHROOT
@ CHROOT
The target is chrooted, e.g.
Definition
Environment.h:55
storage::TargetMode::DIRECT
@ DIRECT
Direct target.
Definition
Environment.h:52
storage
Environment.h
Generated by
1.17.0