summaryrefslogtreecommitdiff
path: root/support.cc
diff options
context:
space:
mode:
Diffstat (limited to 'support.cc')
-rw-r--r--support.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/support.cc b/support.cc
index d47965a..c80cb2d 100644
--- a/support.cc
+++ b/support.cc
@@ -16,6 +16,8 @@
#include <string.h>
#include <sys/stat.h>
#include <string>
+#include <cctype>
+#include <algorithm>
#include <iostream>
#include <sstream>
#include "support.h"
@@ -357,3 +359,11 @@ void WinWarning(void) {
exit(0);
#endif
} // WinWarning()
+
+// Returns the input string in lower case
+string ToLower(const string& input) {
+ string lower = input; // allocate correct size through copy
+
+ transform(input.begin(), input.end(), lower.begin(), ::tolower);
+ return lower;
+} // ToLower()