emitterutils.h 1.41 KB
Newer Older
1
2
3
#ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66

4
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5
6
7
#pragma once
#endif

8

9
#include "emitterstate.h"
10
#include "yaml-cpp/ostream.h"
11
12
13
14
#include <string>

namespace YAML
{
15
16
    class Binary;
    
17
18
    struct StringFormat { enum value { Plain, SingleQuoted, DoubleQuoted, Literal }; };

19
20
	namespace Utils
	{
21
22
        StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, FlowType::value flowType, bool escapeNonAscii);
        
23
		bool WriteSingleQuotedString(ostream& out, const std::string& str);
24
		bool WriteDoubleQuotedString(ostream& out, const std::string& str, bool escapeNonAscii);
25
		bool WriteLiteralString(ostream& out, const std::string& str, int indent);
Jesse Beder's avatar
Jesse Beder committed
26
		bool WriteChar(ostream& out, char ch);
27
28
29
		bool WriteComment(ostream& out, const std::string& str, int postCommentIndent);
		bool WriteAlias(ostream& out, const std::string& str);
		bool WriteAnchor(ostream& out, const std::string& str);
30
		bool WriteTag(ostream& out, const std::string& str, bool verbatim);
31
		bool WriteTagWithPrefix(ostream& out, const std::string& prefix, const std::string& tag);
32
		bool WriteBinary(ostream& out, const Binary& binary);
33
34
	}
}
35
36

#endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66