Factor out an UpperMap for case-insensitive matching

This commit is contained in:
Rangi42
2025-07-27 23:14:52 -04:00
parent d16751f56a
commit 75aed1afd5
8 changed files with 87 additions and 84 deletions

View File

@@ -3,9 +3,23 @@
#ifndef RGBDS_UTIL_HPP
#define RGBDS_UTIL_HPP
#include <stddef.h>
#include <string>
#include <unordered_map>
#include "helpers.hpp"
bool startsIdentifier(int c);
bool continuesIdentifier(int c);
char const *printChar(int c);
struct Uppercase {
size_t operator()(std::string const &str) const;
bool operator()(std::string const &str1, std::string const &str2) const;
};
template<typename T>
using UpperMap = std::unordered_map<std::string, T, Uppercase, Uppercase>;
#endif // RGBDS_UTIL_HPP