parserstate.cpp 465 Bytes
Newer Older
1
2
3
4
5
6
7
8
#include "parserstate.h"

namespace YAML
{
	void ParserState::Reset()
	{
		// version
		version.major = 1;
Jesse Beder's avatar
Jesse Beder committed
9
		version.minor = 2;
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

		// and tags
		tags.clear();
		tags["!"] = "!";
		tags["!!"] = "tag:yaml.org,2002:";
	}

	std::string ParserState::TranslateTag(const std::string& handle) const
	{
		std::map <std::string, std::string>::const_iterator it = tags.find(handle);
		if(it == tags.end())
			return handle;

		return it->second;
	}
}