1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
6 #include "base/object.hpp"
7 #include "base/array.hpp"
8 #include "base/dictionary.hpp"
15 * A config identifier.
19 class ConfigIdentifier final : public Object
22 DECLARE_PTR_TYPEDEFS(ConfigIdentifier);
24 ConfigIdentifier(String name);
26 String GetName() const;
33 * A configuration writer.
40 static void EmitBoolean(std::ostream& fp, bool val);
41 static void EmitNumber(std::ostream& fp, double val);
42 static void EmitString(std::ostream& fp, const String& val);
43 static void EmitEmpty(std::ostream& fp);
44 static void EmitArray(std::ostream& fp, int indentLevel, const Array::Ptr& val);
45 static void EmitArrayItems(std::ostream& fp, int indentLevel, const Array::Ptr& val);
46 static void EmitScope(std::ostream& fp, int indentLevel, const Dictionary::Ptr& val,
47 const Array::Ptr& imports = nullptr, bool splitDot = false);
48 static void EmitValue(std::ostream& fp, int indentLevel, const Value& val);
49 static void EmitRaw(std::ostream& fp, const String& val);
50 static void EmitIndent(std::ostream& fp, int indentLevel);
52 static void EmitIdentifier(std::ostream& fp, const String& identifier, bool inAssignment);
53 static void EmitConfigItem(std::ostream& fp, const String& type, const String& name, bool isTemplate,
54 bool ignoreOnError, const Array::Ptr& imports, const Dictionary::Ptr& attrs);
56 static void EmitComment(std::ostream& fp, const String& text);
57 static void EmitFunctionCall(std::ostream& fp, const String& name, const Array::Ptr& arguments);
59 static const std::vector<String>& GetKeywords();
61 static String EscapeIcingaString(const String& str);
67 #endif /* CONFIGWRITER_H */