diff options
author | Gilles Moris <gilles.moris@free.fr> | 2019-05-15 07:33:38 +0200 |
---|---|---|
committer | Gilles Moris <gilles.moris@free.fr> | 2019-05-15 07:33:38 +0200 |
commit | f9d08a6b6bf0bae229f45eeebeeacc64d4369151 (patch) | |
tree | ebecf4d6799394c59283f7930594b11083acb53c /support.cc | |
parent | 522273e3db5823aedf6af8786cb01a316367ed32 (diff) | |
download | sgdisk-f9d08a6b6bf0bae229f45eeebeeacc64d4369151.tar.gz |
Perform case insensitive search of partition types
Diffstat (limited to 'support.cc')
-rw-r--r-- | support.cc | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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() |