Added support for emitting and represeting null

This commit is contained in:
Jesse Beder
2009-07-30 04:42:27 +00:00
parent 72919adf55
commit ae41e58ca3
10 changed files with 576 additions and 514 deletions

View File

@@ -4,6 +4,7 @@
#define CONVERSION_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#include "null.h"
#include <string>
#include <sstream>
@@ -37,6 +38,9 @@ namespace YAML
template <>
bool Converter<bool>::Convert(const std::string& input, bool& output);
template <>
bool Converter<_Null>::Convert(const std::string& input, _Null& output);
template <>
bool Converter<std::wstring>::Convert(const std::string& input, std::wstring& output);
}

View File

@@ -6,6 +6,7 @@
#include "emittermanip.h"
#include "ostream.h"
#include "null.h"
#include <memory>
#include <string>
@@ -51,6 +52,7 @@ namespace YAML
Emitter& Write(const _Alias& alias);
Emitter& Write(const _Anchor& anchor);
Emitter& Write(const _Comment& comment);
Emitter& Write(const _Null& null);
private:
enum ATOMIC_TYPE { AT_SCALAR, AT_SEQ, AT_BLOCK_SEQ, AT_FLOW_SEQ, AT_MAP, AT_BLOCK_MAP, AT_FLOW_MAP };

13
include/null.h Normal file
View File

@@ -0,0 +1,13 @@
#pragma once
#ifndef NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
#define NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66
namespace YAML
{
struct _Null {};
extern _Null Null;
}
#endif // NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66