Implemented the Write for scalars (including checking which type of scalar it should be)

This commit is contained in:
Jesse Beder
2012-05-21 19:07:56 -05:00
parent 65d80ebc11
commit d86cfc1c63
3 changed files with 88 additions and 15 deletions

View File

@@ -6,6 +6,7 @@
#endif
#include "emitterstate.h"
#include "yaml-cpp/ostream.h"
#include <string>
@@ -13,9 +14,12 @@ namespace YAML
{
class Binary;
struct StringFormat { enum value { Plain, SingleQuoted, DoubleQuoted, Literal }; };
namespace Utils
{
bool WriteString(ostream& out, const std::string& str, bool inFlow, bool escapeNonAscii);
StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, FlowType::value flowType, bool escapeNonAscii);
bool WriteSingleQuotedString(ostream& out, const std::string& str);
bool WriteDoubleQuotedString(ostream& out, const std::string& str, bool escapeNonAscii);
bool WriteLiteralString(ostream& out, const std::string& str, int indent);