aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
Diffstat (limited to 'butl')
-rw-r--r--butl/utility18
1 files changed, 18 insertions, 0 deletions
diff --git a/butl/utility b/butl/utility
index e2e9b37..cedfc3d 100644
--- a/butl/utility
+++ b/butl/utility
@@ -60,6 +60,24 @@ namespace butl
int casecmp (const char*, const char*, std::size_t = std::string::npos);
+ // Case-insensitive key comparators (i.e., to be used in sets, maps, etc).
+ //
+ struct case_compare_string
+ {
+ bool operator() (const std::string& x, const std::string& y) const
+ {
+ return casecmp (x, y) < 0;
+ }
+ };
+
+ struct case_compare_c_string
+ {
+ bool operator() (const char* x, const char* y) const
+ {
+ return casecmp (x, y) < 0;
+ }
+ };
+
bool
alpha (char);