]> granicus.if.org Git - icinga2/blob - lib/cli/objectlistutility.hpp
add some object locking to the Dump method (which could theoreticylly suffer from...
[icinga2] / lib / cli / objectlistutility.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef OBJECTLISTUTILITY_H
4 #define OBJECTLISTUTILITY_H
5
6 #include "base/i2-base.hpp"
7 #include "cli/i2-cli.hpp"
8 #include "base/dictionary.hpp"
9 #include "base/array.hpp"
10 #include "base/value.hpp"
11 #include "base/string.hpp"
12
13 namespace icinga
14 {
15
16 /**
17  * @ingroup cli
18  */
19 class ObjectListUtility
20 {
21 public:
22         static bool PrintObject(std::ostream& fp, bool& first, const String& message, std::map<String, int>& type_count, const String& name_filter, const String& type_filter);
23
24 private:
25         static void PrintProperties(std::ostream& fp, const Dictionary::Ptr& props, const Dictionary::Ptr& debug_hints, int indent);
26         static void PrintHints(std::ostream& fp, const Dictionary::Ptr& debug_hints, int indent);
27         static void PrintHint(std::ostream& fp, const Array::Ptr& msg, int indent);
28         static void PrintValue(std::ostream& fp, const Value& val);
29         static void PrintArray(std::ostream& fp, const Array::Ptr& arr);
30 };
31
32 }
33
34 #endif /* OBJECTLISTUTILITY_H */