Factor out an UpperMap for case-insensitive matching

This commit is contained in:
Rangi42 committed 2025-07-28 00:00:24 -04:00
1 parent d16751f56a
commit 75aed1afd5
8 files changed
+87 -84

No files matched your search

+14
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