diff --git a/stepmania/src/RageUtil.cpp b/stepmania/src/RageUtil.cpp index a02e3483f0..982890cfd8 100644 --- a/stepmania/src/RageUtil.cpp +++ b/stepmania/src/RageUtil.cpp @@ -43,6 +43,19 @@ bool IsAnInt( const CString &s ) return true; } +bool IsHexVal( const CString &s ) +{ + if( s[0] == '\0' ) + return false; + + for( int i=0; s[i]; i++ ) + if( !(s[i] >= '0' && s[i] <= '9') && + !(toupper(s[i]) >= 'A' && toupper(s[i]) <= 'F')) + return false; + + return true; +} + float TimeToSeconds( CString sHMS ) { CStringArray arrayBits; diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index befea337db..16e2abf9aa 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -114,6 +114,7 @@ inline float froundf( const float f, const float fRoundInterval ) int power_of_two(int input); bool IsAnInt( const CString &s ); +bool IsHexVal( const CString &s ); float TimeToSeconds( CString sHMS ); CString SecondsToTime( float fSecs );