Merged the other-tags branch into the trunk (this wasn't an rX:Y merge, since the branch wasn't branched directly from the head of the trunk)

This commit is contained in:
Jesse Beder
2010-10-19 06:46:55 +00:00
parent 18a805e46c
commit 51c84f1c02
8 changed files with 64 additions and 21 deletions

View File

@@ -78,6 +78,8 @@ namespace YAML
void EmitEndMap();
void EmitKey();
void EmitValue();
void EmitKindTag();
void EmitTag(bool verbatim, const _Tag& tag);
private:
ostream m_stream;

View File

@@ -11,6 +11,7 @@ namespace YAML
enum EMITTER_MANIP {
// general manipulators
Auto,
TagByKind,
// output character set
EmitNonAscii,
@@ -82,14 +83,24 @@ namespace YAML
}
struct _Tag {
_Tag(const std::string& content_): content(content_), verbatim(true) {}
explicit _Tag(const std::string& content_)
: content(content_), verbatim(true)
{
}
std::string content;
bool verbatim;
};
inline _Tag VerbatimTag(const std::string& content) {
return _Tag(content);
}
typedef _Tag VerbatimTag;
struct LocalTag : public _Tag
{
explicit LocalTag(const std::string& content_)
: _Tag(content_)
{
verbatim = false;
}
};
struct _Comment {
_Comment(const std::string& content_): content(content_) {}