1 /* 2 This file is part of g810-led. 3 4 g810-led is free software: you can redistribute it and/or modify 5 it under the terms of the GNU General Public License as published by 6 the Free Software Foundation, version 3 of the License. 7 8 g810-led is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with g810-led. If not, see <https://www.gnu.org/licenses/>. 15 */ 16 17 #ifndef UTILS_HELPER 18 #define UTILS_HELPER 19 20 #include <chrono> 21 #include <iostream> 22 #include "../classes/Keyboard.h" 23 24 namespace utils { 25 26 std::string getCmdName(std::string cmd); 27 28 bool parseStartupMode(std::string val, LedKeyboard::StartupMode &startupMode); 29 bool parseOnBoardMode(std::string val, LedKeyboard::OnBoardMode &onBoardMode); 30 bool parseNativeEffect(std::string val, LedKeyboard::NativeEffect &nativeEffect); 31 bool parseNativeEffectPart(std::string val, LedKeyboard::NativeEffectPart &nativeEffectPart); 32 bool parseKey(std::string val, LedKeyboard::Key &key); 33 bool parseKeyGroup(std::string val, LedKeyboard::KeyGroup &keyGroup); 34 bool parseColor(std::string val, LedKeyboard::Color &color); 35 bool parsePeriod(std::string val, std::chrono::duration<uint16_t, std::milli> &period); 36 bool parseUInt8(std::string val, uint8_t &uint8); 37 bool parseUInt16(std::string val, uint16_t &uint16); 38 39 } 40 41 #endif 42