mirror of
https://github.com/muccc/WomoLIN.git
synced 2026-03-24 09:46:50 +01:00
51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
#include "include/enums.h"
|
|
#include <iostream>
|
|
|
|
namespace womolin::lib::enums
|
|
{
|
|
|
|
std::string ESetResetToString( const ESetReset enumValue )
|
|
{
|
|
auto strValue { "UNKNOWN" };
|
|
|
|
switch( enumValue ) {
|
|
case ESetReset::SET :
|
|
strValue = "SET";
|
|
break;
|
|
case ESetReset::RESET :
|
|
strValue = "RESET";
|
|
break;
|
|
case ESetReset::GET :
|
|
strValue = "GET";
|
|
break;
|
|
case ESetReset::UNKNOWN :
|
|
strValue = "UNKNOWN";
|
|
break;
|
|
}
|
|
|
|
return strValue;
|
|
}
|
|
|
|
|
|
ESetReset StringToESetReset( const std::string & stringValue )
|
|
{
|
|
auto enumValue { ESetReset::UNKNOWN };
|
|
|
|
if ( 0 == stringValue.compare("SET") ){
|
|
enumValue = ESetReset::SET;
|
|
}
|
|
else if ( 0 == stringValue.compare("RESET") ){
|
|
enumValue = ESetReset::RESET;
|
|
}
|
|
else if ( 0 == stringValue.compare("GET") ){
|
|
enumValue = ESetReset::GET;
|
|
}
|
|
else {
|
|
enumValue = ESetReset::UNKNOWN;
|
|
}
|
|
|
|
return enumValue;
|
|
}
|
|
|
|
}
|