CCINI.H (6982B)
1 // 2 // Copyright 2020 Electronic Arts Inc. 3 // 4 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free 5 // software: you can redistribute it and/or modify it under the terms of 6 // the GNU General Public License as published by the Free Software Foundation, 7 // either version 3 of the License, or (at your option) any later version. 8 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* $Header: /CounterStrike/CCINI.H 1 3/03/97 10:24a Joe_bostic $ */ 17 /*********************************************************************************************** 18 *** 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 *** 19 *********************************************************************************************** 20 * * 21 * Project Name : Command & Conquer * 22 * * 23 * File Name : CCINI.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : 05/24/96 * 28 * * 29 * Last Update : May 24, 1996 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 #ifndef CCINI_H 36 #define CCINI_H 37 38 #include "ini.h" 39 #include "fixed.h" 40 #include "pk.h" 41 42 class TriggerTypeClass; 43 44 /* 45 ** The advanced version of the INI database manager. It handles the C&C expansion types and 46 ** identifiers. In addition, it automatically stores a message digest with the INI data 47 ** so that verification can occur. 48 */ 49 class CCINIClass : public INIClass 50 { 51 public: 52 CCINIClass(void) : IsDigestPresent(false) {} 53 54 bool Load(FileClass & file, bool withdigest); 55 int Load(Straw & file, bool withdigest); 56 int Save(FileClass & file, bool withdigest) const; 57 int Save(Pipe & pipe, bool withdigest) const; 58 59 long Get_Buildings(char const * section, char const * entry, long defvalue) const; 60 UnitType Get_UnitType(char const * section, char const * entry, UnitType defvalue) const; 61 AnimType Get_AnimType(char const * section, char const * entry, AnimType defvalue) const; 62 ArmorType Get_ArmorType(char const * section, char const * entry, ArmorType defvalue) const; 63 BulletType Get_BulletType(char const * section, char const * entry, BulletType defvalue) const; 64 HousesType Get_HousesType(char const * section, char const * entry, HousesType defvalue) const; 65 LEPTON Get_Lepton(char const * section, char const * entry, LEPTON defvalue) const; 66 MPHType Get_MPHType(char const * section, char const * entry, MPHType defvalue) const; 67 OverlayType Get_OverlayType(char const * section, char const * entry, OverlayType defvalue) const; 68 SourceType Get_SourceType(char const * section, char const * entry, SourceType defvalue) const; 69 TerrainType Get_TerrainType(char const * section, char const * entry, TerrainType defvalue) const; 70 TheaterType Get_TheaterType(char const * section, char const * entry, TheaterType defvalue) const; 71 ThemeType Get_ThemeType(char const * section, char const * entry, ThemeType defvalue) const; 72 TriggerTypeClass * Get_TriggerType(char const * section, char const * entry) const; 73 VQType Get_VQType(char const * section, char const * entry, VQType defvalue) const; 74 VocType Get_VocType(char const * section, char const * entry, VocType defvalue) const; 75 WarheadType Get_WarheadType(char const * section, char const * entry, WarheadType defvalue) const; 76 WeaponType Get_WeaponType(char const * section, char const * entry, WeaponType defvalue) const; 77 long Get_Owners(char const * section, char const * entry, long defvalue) const; 78 CrateType Get_CrateType(char const * section, char const * entry, CrateType defvalue) const; 79 80 81 bool Put_Buildings(char const * section, char const * entry, long value); 82 bool Put_AnimType(char const * section, char const * entry, AnimType value); 83 bool Put_UnitType(char const * section, char const * entry, UnitType value); 84 bool Put_ArmorType(char const * section, char const * entry, ArmorType value); 85 bool Put_BulletType(char const * section, char const * entry, BulletType value); 86 bool Put_HousesType(char const * section, char const * entry, HousesType value); 87 bool Put_Lepton(char const * section, char const * entry, LEPTON value); 88 bool Put_MPHType(char const * section, char const * entry, MPHType value); 89 bool Put_VQType(char const * section, char const * entry, VQType value); 90 bool Put_OverlayType(char const * section, char const * entry, OverlayType value); 91 bool Put_Owners(char const * section, char const * entry, long value); 92 bool Put_SourceType(char const * section, char const * entry, SourceType value); 93 bool Put_TerrainType(char const * section, char const * entry, TerrainType value); 94 bool Put_TheaterType(char const * section, char const * entry, TheaterType value); 95 bool Put_ThemeType(char const * section, char const * entry, ThemeType value); 96 bool Put_TriggerType(char const * section, char const * entry, TriggerTypeClass * value); 97 bool Put_VocType(char const * section, char const * entry, VocType value); 98 bool Put_WarheadType(char const * section, char const * entry, WarheadType value); 99 bool Put_WeaponType(char const * section, char const * entry, WeaponType value); 100 bool Put_CrateType(char const * section, char const * entry, CrateType value); 101 102 int Get_Unique_ID(void) const; 103 104 private: 105 void Calculate_Message_Digest(void); 106 void Invalidate_Message_Digest(void); 107 108 bool IsDigestPresent:1; 109 110 /* 111 ** This is the message digest (SHA) of the INI database that was embedded as part of 112 ** the INI file. 113 */ 114 unsigned char Digest[20]; 115 }; 116 117 #endif