2009-07-30 02:27:20 +04:00
|
|
|
#ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
|
|
|
|
#define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|
|
|
|
|
|
2011-09-06 09:16:03 +04:00
|
|
|
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
|
2011-03-02 09:11:41 +03:00
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-07-30 02:27:20 +04:00
|
|
|
|
2012-05-22 04:07:56 +04:00
|
|
|
#include "emitterstate.h"
|
2012-05-26 02:28:35 +04:00
|
|
|
#include "yaml-cpp/ostream_wrapper.h"
|
2009-05-23 01:52:31 +04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace YAML
|
|
|
|
|
{
|
2012-01-21 11:18:37 +04:00
|
|
|
class Binary;
|
|
|
|
|
|
2012-05-22 04:07:56 +04:00
|
|
|
struct StringFormat { enum value { Plain, SingleQuoted, DoubleQuoted, Literal }; };
|
|
|
|
|
|
2009-05-23 01:52:31 +04:00
|
|
|
namespace Utils
|
|
|
|
|
{
|
2012-05-22 04:07:56 +04:00
|
|
|
StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, FlowType::value flowType, bool escapeNonAscii);
|
|
|
|
|
|
2012-05-26 02:28:35 +04:00
|
|
|
bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str);
|
|
|
|
|
bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, bool escapeNonAscii);
|
|
|
|
|
bool WriteLiteralString(ostream_wrapper& out, const std::string& str, int indent);
|
|
|
|
|
bool WriteChar(ostream_wrapper& out, char ch);
|
|
|
|
|
bool WriteComment(ostream_wrapper& out, const std::string& str, int postCommentIndent);
|
|
|
|
|
bool WriteAlias(ostream_wrapper& out, const std::string& str);
|
|
|
|
|
bool WriteAnchor(ostream_wrapper& out, const std::string& str);
|
|
|
|
|
bool WriteTag(ostream_wrapper& out, const std::string& str, bool verbatim);
|
|
|
|
|
bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix, const std::string& tag);
|
|
|
|
|
bool WriteBinary(ostream_wrapper& out, const Binary& binary);
|
2009-05-23 01:52:31 +04:00
|
|
|
}
|
|
|
|
|
}
|
2009-07-30 02:27:20 +04:00
|
|
|
|
|
|
|
|
#endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
|