Revision control

Copy as Markdown

Other Tools

/*
* OID maps
*
* This file was automatically generated by %s on %s
*
* All manual edits to this file will be lost. Edit the script
* then regenerate this source file.
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/internal/oid_map.h>
#include <unordered_map>
namespace Botan {
namespace {
std::vector<std::pair<const char*, std::vector<uint32_t>>> oid_maps() {
// clang-format off
return {
%s
};
// clang-format on
}
} // namespace
std::unordered_map<OID, std::string> OID_Map::load_oid2str_map() {
std::pair<const char*, std::vector<uint32_t>> dup_oids[] = {
// clang-format off
%s
// clang-format on
};
std::unordered_map<OID, std::string> map;
for(auto& entry : oid_maps()) {
map.insert(std::make_pair(OID(std::move(entry.second)), std::string(entry.first)));
}
for(auto& entry : dup_oids) {
map.insert(std::make_pair(OID(std::move(entry.second)), std::string(entry.first)));
}
return map;
}
std::unordered_map<std::string, OID> OID_Map::load_str2oid_map() {
std::pair<const char*, std::vector<uint32_t>> aliases[] = {
// clang-format off
%s
// clang-format on
};
std::unordered_map<std::string, OID> map;
for(auto& entry : oid_maps()) {
map.insert(std::make_pair(std::string(entry.first), OID(std::move(entry.second))));
}
for(auto& entry : aliases) {
map.insert(std::make_pair(std::string(entry.first), OID(std::move(entry.second))));
}
return map;
}
} // namespace Botan