forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurationContext.cpp
More file actions
86 lines (70 loc) · 2.34 KB
/
Copy pathConfigurationContext.cpp
File metadata and controls
86 lines (70 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "pch.h"
#include "ConfigurationContext.h"
#include <winrt/Microsoft.Management.Configuration.h>
using namespace winrt::Microsoft::Management::Configuration;
namespace AppInstaller::CLI::Execution
{
namespace details
{
struct ConfigurationContextData
{
ConfigurationProcessor Processor = nullptr;
ConfigurationSet Set = nullptr;
std::vector<ConfigurationSet> History;
};
}
ConfigurationContext::ConfigurationContext() : m_data(std::make_unique<details::ConfigurationContextData>())
{
}
ConfigurationContext::~ConfigurationContext() = default;
ConfigurationContext::ConfigurationContext(ConfigurationContext&&) = default;
ConfigurationContext& ConfigurationContext::operator=(ConfigurationContext&&) = default;
ConfigurationProcessor& ConfigurationContext::Processor()
{
return m_data->Processor;
}
const ConfigurationProcessor& ConfigurationContext::Processor() const
{
return m_data->Processor;
}
void ConfigurationContext::Processor(const ConfigurationProcessor& value)
{
m_data->Processor = value;
}
void ConfigurationContext::Processor(ConfigurationProcessor&& value)
{
m_data->Processor = std::move(value);
}
ConfigurationSet& ConfigurationContext::Set()
{
return m_data->Set;
}
const ConfigurationSet& ConfigurationContext::Set() const
{
return m_data->Set;
}
void ConfigurationContext::Set(const ConfigurationSet& value)
{
m_data->Set = value;
}
void ConfigurationContext::Set(ConfigurationSet&& value)
{
m_data->Set = std::move(value);
}
std::vector<ConfigurationSet>& ConfigurationContext::History()
{
return m_data->History;
}
const std::vector<ConfigurationSet>& ConfigurationContext::History() const
{
return m_data->History;
}
void ConfigurationContext::History(const winrt::Windows::Foundation::Collections::IVector<ConfigurationSet>& value)
{
std::vector<ConfigurationSet> history{ value.Size() };
value.GetMany(0, history);
m_data->History = std::move(history);
}
}