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

@@ -294,12 +294,13 @@ namespace YAML
return WriteAliasName(out, str);
}
bool WriteTag(ostream& out, const std::string& str)
bool WriteTag(ostream& out, const std::string& str, bool verbatim)
{
out << "!<";
out << (verbatim ? "!<" : "!");
StringCharSource buffer(str.c_str(), str.size());
const RegEx& reValid = verbatim ? Exp::URI() : Exp::Tag();
while(buffer) {
int n = Exp::URI().Match(buffer);
int n = reValid.Match(buffer);
if(n <= 0)
return false;
@@ -308,7 +309,8 @@ namespace YAML
++buffer;
}
}
out << ">";
if (verbatim)
out << ">";
return true;
}
}