assetdatabase.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : leveledit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/assetdatabase.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 1/29/02 4:31p $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __ASSETDATABASE_H
  39. #define __ASSETDATABASE_H
  40. //////////////////////////////////////////////////////////////////////
  41. // Forward declarations
  42. //////////////////////////////////////////////////////////////////////
  43. class StringClass;
  44. class FileClass;
  45. //////////////////////////////////////////////////////////////////////
  46. //
  47. // AssetDatabaseClass
  48. //
  49. //////////////////////////////////////////////////////////////////////
  50. class AssetDatabaseClass
  51. {
  52. public:
  53. ///////////////////////////////////////////////////////////////////
  54. // Public data types
  55. ///////////////////////////////////////////////////////////////////
  56. typedef enum
  57. {
  58. UNKNOWN = -1,
  59. CHECKED_OUT_TO_ME = 0,
  60. CHECKED_OUT,
  61. NOT_CHECKED_OUT
  62. } FILE_STATUS;
  63. ///////////////////////////////////////////////////////////////////
  64. // Public constructors/destructors
  65. ///////////////////////////////////////////////////////////////////
  66. AssetDatabaseClass (void) {}
  67. virtual ~AssetDatabaseClass (void) {}
  68. ///////////////////////////////////////////////////////////////////
  69. // Public methods
  70. ///////////////////////////////////////////////////////////////////
  71. //
  72. // Database methods
  73. //
  74. virtual bool Open_Database (LPCTSTR ini_filename, LPCTSTR username = NULL, LPCTSTR password = NULL) = 0;
  75. //
  76. // File manipulation methods
  77. //
  78. virtual bool Add_File (LPCTSTR local_filename, LPCTSTR comment = NULL) = 0;
  79. virtual bool Check_In (LPCTSTR local_filename, LPCTSTR comment = NULL) = 0;
  80. virtual bool Check_Out (LPCTSTR local_filename, bool get_locally = true) = 0;
  81. virtual bool Undo_Check_Out (LPCTSTR local_filename) = 0;
  82. virtual bool Get (LPCTSTR local_filename) = 0;
  83. virtual bool Get_Subproject (LPCTSTR local_filename) = 0;
  84. virtual bool Get_All (LPCTSTR dest_path, LPCTSTR search_mask) { return false; }
  85. virtual FileClass * Get_File (LPCTSTR local_filename) = 0;
  86. //
  87. // Extended methods which provide UI
  88. //
  89. virtual bool Check_Out_Ex (LPCTSTR local_filename, HWND parent_wnd) = 0;
  90. virtual bool Check_In_Ex (LPCTSTR local_filename, HWND parent_wnd) = 0;
  91. //
  92. // Retry methods
  93. //
  94. virtual bool Retry_Check_Out (LPCTSTR local_filename, int attempts = 1, int delay = 250) = 0;
  95. virtual bool Retry_Check_In (LPCTSTR local_filename, int attempts = 1, int delay = 250) = 0;
  96. //
  97. // File information methods
  98. //
  99. virtual FILE_STATUS Get_File_Status (LPCTSTR local_filename, StringClass *checked_out_user_name = NULL) = 0;
  100. virtual bool Is_File_Different (LPCTSTR local_filename) = 0;
  101. virtual bool Does_File_Exist (LPCTSTR local_filename) = 0;
  102. //
  103. // User information
  104. //
  105. virtual BOOL Is_Read_Only (void) const { return TRUE; }
  106. protected:
  107. ///////////////////////////////////////////////////////////////////
  108. // Protected methods
  109. ///////////////////////////////////////////////////////////////////
  110. ///////////////////////////////////////////////////////////////////
  111. // Protected member data
  112. ///////////////////////////////////////////////////////////////////
  113. };
  114. #endif //__ASSETDATABASE_H