mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Factor out an UpperMap for case-insensitive matching
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user