Utilities.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. ** Command & Conquer Renegade(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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Installer *
  23. * *
  24. * $Archive:: /Commando/Code/Installer/Utilities.h $*
  25. * *
  26. * $Author:: Ian_l $*
  27. * *
  28. * $Modtime:: 1/11/02 10:18a $*
  29. * *
  30. * $Revision:: 8 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef _UTILITIES_H
  36. #define _UTILITIES_H
  37. // Includes.
  38. #include "Vector.h"
  39. #include "Win.h"
  40. // Defines.
  41. #define MAX_NUMBER_STRING_LENGTH 33 // Maximum length of string returned by ltoa().
  42. // Forward declarations.
  43. class StringClass;
  44. class WideStringClass;
  45. // Public prototypes.
  46. bool Prompt_Install_CD (const WideStringClass &volumelabal, char &sourcedriveletter);
  47. bool Validate_Install_CD (const WideStringClass &sourcepath, const WideStringClass &installvolumename);
  48. bool Get_Disk_Space_Available (const WideStringClass &path, __int64 &diskspace);
  49. __int64 Cluster_Padding (unsigned filecount);
  50. bool Validate_Path (const WideStringClass &path, int &errorcode);
  51. bool Valid_Install_Drive (const char *drive);
  52. bool Create_Directory (const WideStringClass &path, DynamicVectorClass <StringClass> *log = NULL);
  53. bool Is_Same_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize = true);
  54. bool Is_Sub_Path (const WideStringClass &path0, const WideStringClass &path1, bool standardize = true);
  55. WCHAR *Remove_Trailing_Name (WideStringClass &path);
  56. WCHAR *Extract_Suffix_Root (WideStringClass &path, const WideStringClass &prefixpath);
  57. WCHAR *Extract_Trailing_Name (WideStringClass &path);
  58. bool Directory_Exists (const WideStringClass &path);
  59. bool Is_System_Directory (const WideStringClass &path);
  60. void Get_Current_Directory (WideStringClass &path);
  61. bool Generate_Temporary_Pathname (const WideStringClass &path, StringClass &multibytetemporarypathname);
  62. void Message_Box (const WideStringClass &header, const WideStringClass &errormessage);
  63. #endif // _UTILITIES_H