MiKTeX 26.5-next
A scalable TeX distribution
Loading...
Searching...
No Matches
ComboCfg.h
1/* ComboCfg.h: -*- C++ -*-
2
3 Copyright (C) 2018-2019 Christian Schenk
4
5 This file is part of MiKTeX Package Manager.
6
7 MiKTeX Package Manager is free software; you can redistribute it
8 and/or modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2, or
10 (at your option) any later version.
11
12 MiKTeX Package Manager is distributed in the hope that it will be
13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with MiKTeX Package Manager; if not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
21
22#pragma once
23
24#if !defined(B1A7DA448CE140D291E771FF638D09CE)
25#define B1A7DA448CE140D291E771FF638D09CE
26
27#include <string>
28
29#include <miktex/Core/Cfg>
30#include <miktex/Util/PathName>
31#include <miktex/Core/Session>
32
33MPM_INTERNAL_BEGIN_NAMESPACE;
34
36{
37public:
38 void Load(const MiKTeX::Util::PathName& fileNameUser, const MiKTeX::Util::PathName& fileNameCommon);
39
40public:
41 void Clear();
42
43public:
44 void Save();
45
46public:
47 bool TryGetValueAsString(const std::string& keyName, const std::string& valueName, std::string& value);
48
49public:
50 bool TryGetValueAsString(MiKTeX::Core::ConfigurationScope scope, const std::string& keyName, const std::string& valueName, std::string& value);
51
52public:
53 void PutValue(const std::string& keyName, const std::string& valueName, const std::string& value);
54
55public:
56 void DeleteKey(const std::string& keyName);
57
58public:
59 bool Loaded() const;
60
61public:
62 std::size_t GetSize(MiKTeX::Core::ConfigurationScope scope) const;
63
64private:
65 MiKTeX::Util::PathName fileNameUser;
66
67private:
68 MiKTeX::Util::PathName fileNameCommon;
69
70private:
71 std::unique_ptr<MiKTeX::Core::Cfg> cfgUser;
72
73private:
74 std::unique_ptr<MiKTeX::Core::Cfg> cfgCommon;
75
76private:
77 std::shared_ptr<MiKTeX::Core::Session> session = MIKTEX_SESSION();
78};
79
80MPM_INTERNAL_END_NAMESPACE;
81
82#endif
Definition ComboCfg.h:36
Instances of this class can be used to store path names.
Definition PathName.h:64
ConfigurationScope
MiKTeX configuration scope.
Definition Session.h:103