From 915532bf8fbda9ba2a36e04fcd6acc67c6c68fa5 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Tue, 1 Oct 2024 14:54:37 +1300 Subject: Restructure --- util.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 util.cpp (limited to 'util.cpp') diff --git a/util.cpp b/util.cpp deleted file mode 100644 index 58116d0..0000000 --- a/util.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "util.h" - -#include -#include - -using std::string; - -std::vector split (const string &s, char delim) { - std::vector result; - std::stringstream ss (s); - string item; - - while (getline (ss, item, delim)) { - result.push_back (item); - } - - return result; -} - -const string evNames[] = {"", "", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease", "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut", "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify", "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest", "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify", "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify", "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify", "ClientMessage", "MappingNotify", "GenericEvent", "LASTEvent"}; - -string getEventName(int e) -{ - return evNames[e]; -} - -string lowercase(string s) -{ - string s2 = s; - std::transform(s2.begin(), s2.end(), s2.begin(), [](unsigned char c){ return std::tolower(c); }); - return s2; -} -- cgit v1.2.3