]> granicus.if.org Git - icinga2/blob - lib/cli/featureutility.hpp
Merge pull request #7145 from Icinga/feature/dotnet-4.6
[icinga2] / lib / cli / featureutility.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef FEATUREUTILITY_H
4 #define FEATUREUTILITY_H
5
6 #include "base/i2-base.hpp"
7 #include "cli/i2-cli.hpp"
8 #include "base/string.hpp"
9 #include <vector>
10 #include <iostream>
11
12 namespace icinga
13 {
14
15 /**
16  * @ingroup cli
17  */
18 class FeatureUtility
19 {
20 public:
21         static String GetFeaturesAvailablePath();
22         static String GetFeaturesEnabledPath();
23
24         static std::vector<String> GetFieldCompletionSuggestions(const String& word, bool enable);
25
26         static int EnableFeatures(const std::vector<std::string>& features);
27         static int DisableFeatures(const std::vector<std::string>& features);
28         static int ListFeatures(std::ostream& os = std::cout);
29
30         static bool GetFeatures(std::vector<String>& features, bool enable);
31         static bool CheckFeatureEnabled(const String& feature);
32         static bool CheckFeatureDisabled(const String& feature);
33
34 private:
35         FeatureUtility();
36         static void CollectFeatures(const String& feature_file, std::vector<String>& features);
37         static bool CheckFeatureInternal(const String& feature, bool check_disabled);
38 };
39
40 }
41
42 #endif /* FEATUREUTILITY_H */