mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-10 04:51:17 +00:00

* Add compilation flags: -Wshadow -Weffc++ -pedantic -pedantic-errors * Delete implicit copy & move constructors & assignment operators in classes with pointer data members. * An exception to the above: Add default copy & move constructors & assignment operators for the Binary class. * Convert boolean RegEx operators to binary operators. * Initialize all members in all classes in ctors. * Let default ctor delegate to the converting ctor in Binary and RegEx * Don't change any tests except regex_test (as a result of the change to binary operators). Note: https://bugzilla.redhat.com/show_bug.cgi?id=1544675 makes -Weffc++ report a false positive in "include/yaml-cpp/node/impl.h".
18 lines
420 B
C++
18 lines
420 B
C++
#include "directives.h"
|
|
|
|
namespace YAML {
|
|
Directives::Directives() : version{true, 1, 2}, tags{} {}
|
|
|
|
const std::string Directives::TranslateTagHandle(
|
|
const std::string& handle) const {
|
|
std::map<std::string, std::string>::const_iterator it = tags.find(handle);
|
|
if (it == tags.end()) {
|
|
if (handle == "!!")
|
|
return "tag:yaml.org,2002:";
|
|
return handle;
|
|
}
|
|
|
|
return it->second;
|
|
}
|
|
} // namespace YAML
|