yaml-cpp/src/emitterutils.h

51 lines
1.8 KiB
C
Raw Normal View History

2009-07-30 02:27:20 +04:00
#ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2014-03-22 21:49:16 +04:00
#if defined(_MSC_VER) || \
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
#pragma once
#endif
2014-03-23 07:46:04 +04:00
#include <string>
#include "emitterstate.h"
2014-03-23 07:46:04 +04:00
#include "yaml-cpp/emittermanip.h"
2012-05-26 02:28:35 +04:00
#include "yaml-cpp/ostream_wrapper.h"
2014-03-23 07:46:04 +04:00
namespace YAML {
class ostream_wrapper;
} // namespace YAML
2014-03-22 21:49:16 +04:00
namespace YAML {
class Binary;
struct StringFormat {
2014-03-24 05:08:54 +04:00
enum value { Plain, SingleQuoted, DoubleQuoted, Literal };
2014-03-22 21:49:16 +04:00
};
2014-03-22 21:49:16 +04:00
namespace Utils {
StringFormat::value ComputeStringFormat(const std::string& str,
EMITTER_MANIP strFormat,
FlowType::value flowType,
bool escapeNonAscii);
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,
std::size_t indent);
2014-03-22 21:49:16 +04:00
bool WriteChar(ostream_wrapper& out, char ch);
bool WriteComment(ostream_wrapper& out, const std::string& str,
std::size_t postCommentIndent);
2014-03-22 21:49:16 +04:00
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-07-30 02:27:20 +04:00
2014-03-22 21:49:16 +04:00
#endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66