Merged r295:305 from the tags branch to the trunk

This commit is contained in:
Jesse Beder
2009-10-29 15:48:06 +00:00
parent fe57829aca
commit a372bfdc60
27 changed files with 973 additions and 145 deletions

View File

@@ -293,6 +293,24 @@ namespace YAML
out << "&";
return WriteAliasName(out, str);
}
bool WriteTag(ostream& out, const std::string& str)
{
out << "!<";
StringCharSource buffer(str.c_str(), str.size());
while(buffer) {
int n = Exp::URI.Match(buffer);
if(n <= 0)
return false;
while(--n >= 0) {
out << buffer[0];
++buffer;
}
}
out << ">";
return true;
}
}
}