miscutil.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. //
  19. // Filename: miscutil.h
  20. // Project: wwutil
  21. // Author: Tom Spencer-Smith
  22. // Date: June 1998
  23. // Description:
  24. //
  25. //-----------------------------------------------------------------------------
  26. #if defined(_MSV_VER)
  27. #pragma once
  28. #endif
  29. #ifndef MISCUTIL_H
  30. #define MISCUTIL_H
  31. #ifndef ALWAYS_H
  32. #include "always.h"
  33. #endif
  34. #include "bittype.h"
  35. #include "wwstring.h"
  36. const float MISCUTIL_EPSILON = 0.0001f;
  37. class cMiscUtil
  38. {
  39. public:
  40. static LPCSTR Get_Text_Time(void);
  41. static void Seconds_To_Hms(float seconds, int & h, int & m, int & s);
  42. static bool Is_String_Same(LPCSTR str1, LPCSTR str2);
  43. static bool Is_String_Different(LPCSTR str1, LPCSTR str2);
  44. static void Get_File_Id_String(LPCSTR filename, StringClass & str);
  45. static bool File_Exists(LPCSTR filename);
  46. static bool File_Is_Read_Only(LPCSTR filename);
  47. static bool Is_Alphabetic(char c);
  48. static bool Is_Numeric(char c);
  49. static bool Is_Alphanumeric(char c);
  50. static bool Is_Whitespace(char c);
  51. static void Trim_Trailing_Whitespace(char * text);
  52. static void Remove_File(LPCSTR filename);
  53. private:
  54. };
  55. #endif // MISCUTIL_H
  56. //static int Get_Exe_Key(void);