Moved the local structs from Emitter::Write(bool) to an anonymous namespace in the hopes that Visual Studio <= 2003 will be happy

This commit is contained in:
Jesse Beder
2011-03-02 05:21:25 +00:00
parent 75a2fbe564
commit 2faeb76e2d

View File

@@ -605,6 +605,12 @@ namespace YAML
m_stream << str.str(); m_stream << str.str();
PostAtomicWrite(); PostAtomicWrite();
} }
namespace {
struct BoolName { std::string trueName, falseName; };
struct BoolFormatNames { BoolName upper, lower, camel; };
struct BoolTypes { BoolFormatNames yesNo, trueFalse, onOff; };
}
Emitter& Emitter::Write(bool b) Emitter& Emitter::Write(bool b)
{ {
@@ -615,10 +621,6 @@ namespace YAML
EmitSeparationIfNecessary(); EmitSeparationIfNecessary();
// set up all possible bools to write // set up all possible bools to write
struct BoolName { std::string trueName, falseName; };
struct BoolFormatNames { BoolName upper, lower, camel; };
struct BoolTypes { BoolFormatNames yesNo, trueFalse, onOff; };
static const BoolTypes boolTypes = { static const BoolTypes boolTypes = {
{ { "YES", "NO" }, { "yes", "no" }, { "Yes", "No" } }, { { "YES", "NO" }, { "yes", "no" }, { "Yes", "No" } },
{ { "TRUE", "FALSE" }, { "true", "false" }, { "True", "False" } }, { { "TRUE", "FALSE" }, { "true", "false" }, { "True", "False" } },