[openjk] 22/130: Rename classes and remove sg namespace

Simon McVittie smcv at debian.org
Fri Oct 28 11:09:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 0ce58cb6941481966601abeee14fa6ccb7b8863e
Author: bibendovsky <bibendovsky at hotmail.com>
Date:   Thu Jul 7 21:06:26 2016 +0300

    Rename classes and remove sg namespace
---
 code/CMakeLists.txt                                | 10 +--
 code/cgame/cg_main.cpp                             |  2 +-
 code/game/CMakeLists.txt                           |  6 +-
 code/game/G_Timer.cpp                              |  2 +-
 code/game/Q3_Interface.cpp                         |  2 +-
 code/game/g_main.cpp                               |  2 +-
 code/game/g_objectives.cpp                         |  2 +-
 code/game/g_roff.cpp                               |  2 +-
 code/game/g_savegame.cpp                           |  2 +-
 code/icarus/IcarusImplementation.cpp               |  2 +-
 code/qcommon/cm_load.cpp                           |  2 +-
 code/qcommon/q_shared.h                            |  2 +-
 code/rd-vanilla/CMakeLists.txt                     |  7 +-
 code/rd-vanilla/G2_misc.cpp                        |  2 +-
 code/server/sv_savegame.cpp                        |  2 +-
 codeJK2/cgame/cg_main.cpp                          |  2 +-
 codeJK2/game/CMakeLists.txt                        |  6 +-
 codeJK2/game/G_Timer.cpp                           |  2 +-
 codeJK2/game/Q3_Registers.cpp                      |  2 +-
 codeJK2/game/g_main.cpp                            |  2 +-
 codeJK2/game/g_objectives.cpp                      |  2 +-
 codeJK2/game/g_roff.cpp                            |  2 +-
 codeJK2/game/g_savegame.cpp                        |  2 +-
 codeJK2/icarus/Instance.cpp                        |  2 +-
 codeJK2/icarus/Sequence.cpp                        |  2 +-
 codeJK2/icarus/TaskManager.cpp                     |  2 +-
 .../{ojk_sg_archive.cpp => ojk_saved_game.cpp}     | 40 +++++------
 .../qcommon/{ojk_sg_archive.h => ojk_saved_game.h} | 81 +++++++++++-----------
 ..._exception.cpp => ojk_saved_game_exception.cpp} | 10 ++-
 shared/qcommon/ojk_saved_game_exception.h          | 34 +++++++++
 .../{ojk_sg_archive_fwd.h => ojk_saved_game_fwd.h} | 28 ++++----
 shared/qcommon/ojk_sg_archive_exception.h          | 36 ----------
 32 files changed, 145 insertions(+), 157 deletions(-)

diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index fcf9b47..709601a 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -179,11 +179,11 @@ if(BuildSPEngine OR BuildJK2SPEngine)
 		"${SharedDir}/qcommon/ojk_sg_wrappers_shared.h"
 		"${SharedDir}/qcommon/ojk_exception.h"
 		"${SharedDir}/qcommon/ojk_exception.cpp"
-		"${SharedDir}/qcommon/ojk_sg_archive.h"
-		"${SharedDir}/qcommon/ojk_sg_archive_fwd.h"
-		"${SharedDir}/qcommon/ojk_sg_archive.cpp"
-		"${SharedDir}/qcommon/ojk_sg_archive_exception.h"
-		"${SharedDir}/qcommon/ojk_sg_archive_exception.cpp"
+		"${SharedDir}/qcommon/ojk_saved_game.h"
+		"${SharedDir}/qcommon/ojk_saved_game_fwd.h"
+		"${SharedDir}/qcommon/ojk_saved_game.cpp"
+		"${SharedDir}/qcommon/ojk_saved_game_exception.h"
+		"${SharedDir}/qcommon/ojk_saved_game_exception.cpp"
 
 		${SharedCommonFiles}
 		)
diff --git a/code/cgame/cg_main.cpp b/code/cgame/cg_main.cpp
index 6360ce5..d93d4f7 100644
--- a/code/cgame/cg_main.cpp
+++ b/code/cgame/cg_main.cpp
@@ -29,7 +29,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "../qcommon/sstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 //NOTENOTE: Be sure to change the mirrored code in g_shared.h
 typedef	std::map< sstring_t, unsigned char  >	namePrecache_m;
diff --git a/code/game/CMakeLists.txt b/code/game/CMakeLists.txt
index 10d04fe..029b176 100644
--- a/code/game/CMakeLists.txt
+++ b/code/game/CMakeLists.txt
@@ -264,9 +264,9 @@ set(SPGameCommonFiles
 	"${SharedDir}/qcommon/ojk_sg_wrappers_fwd.h"
 	"${SharedDir}/qcommon/ojk_sg_wrappers_shared.h"
 	"${SharedDir}/qcommon/ojk_exception.h"
-	"${SharedDir}/qcommon/ojk_sg_archive.h"
-	"${SharedDir}/qcommon/ojk_sg_archive_fwd.h"
-	"${SharedDir}/qcommon/ojk_sg_archive_exception.h"
+	"${SharedDir}/qcommon/ojk_saved_game.h"
+	"${SharedDir}/qcommon/ojk_saved_game_fwd.h"
+	"${SharedDir}/qcommon/ojk_saved_game_exception.h"
 	
 	${SharedCommonFiles}
 	)
diff --git a/code/game/G_Timer.cpp b/code/game/G_Timer.cpp
index 4521e8b..2e97b40 100644
--- a/code/game/G_Timer.cpp
+++ b/code/game/G_Timer.cpp
@@ -23,7 +23,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_local.h"
 #include "../Rufl/hstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #define MAX_GTIMERS	16384
 
diff --git a/code/game/Q3_Interface.cpp b/code/game/Q3_Interface.cpp
index b9eb56a..e395e1f 100644
--- a/code/game/Q3_Interface.cpp
+++ b/code/game/Q3_Interface.cpp
@@ -41,7 +41,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_vehicles.h"
 #include "g_navigator.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern	cvar_t	*com_buildScript;
 
diff --git a/code/game/g_main.cpp b/code/game/g_main.cpp
index 60c05bf..e01516c 100644
--- a/code/game/g_main.cpp
+++ b/code/game/g_main.cpp
@@ -37,7 +37,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 //rww - RAGDOLL_END
 
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern void WP_SaberLoadParms( void );
 extern qboolean G_PlayerSpawned( void );
diff --git a/code/game/g_objectives.cpp b/code/game/g_objectives.cpp
index a55f3b6..4f0dd85 100644
--- a/code/game/g_objectives.cpp
+++ b/code/game/g_objectives.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "objectives.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 qboolean	missionInfo_Updated;
 
diff --git a/code/game/g_roff.cpp b/code/game/g_roff.cpp
index 47d4205..3ed0d3d 100644
--- a/code/game/g_roff.cpp
+++ b/code/game/g_roff.cpp
@@ -26,7 +26,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../cgame/cg_local.h"
 #include "g_functions.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 // The list of precached ROFFs
 roff_list_t	roffs[MAX_ROFFS];
diff --git a/code/game/g_savegame.cpp b/code/game/g_savegame.cpp
index c8e3dcf..f62c7ff 100644
--- a/code/game/g_savegame.cpp
+++ b/code/game/g_savegame.cpp
@@ -31,7 +31,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../cgame/cg_camera.h"
 #include "../qcommon/sstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern void OBJ_LoadTacticalInfo(void);
 
diff --git a/code/icarus/IcarusImplementation.cpp b/code/icarus/IcarusImplementation.cpp
index 076bd30..f404f51 100644
--- a/code/icarus/IcarusImplementation.cpp
+++ b/code/icarus/IcarusImplementation.cpp
@@ -34,7 +34,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../qcommon/q_shared.h"
 #include "../qcommon/qcommon.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #define STL_ITERATE( a, b )		for ( a = b.begin(); a != b.end(); ++a )
 #define STL_INSERT( a, b )		a.insert( a.end(), b );
diff --git a/code/qcommon/cm_load.cpp b/code/qcommon/cm_load.cpp
index 4566854..f2573e9 100644
--- a/code/qcommon/cm_load.cpp
+++ b/code/qcommon/cm_load.cpp
@@ -25,7 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "cm_local.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #ifdef BSPC
 void SetPlaneSignbits (cplane_t *out) {
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index c026a9b..d5c5534 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -161,7 +161,7 @@ float FloatSwap( const float *f );
 
 #include "qcommon/q_platform.h"
 #include "qcommon/ojk_sg_wrappers_fwd.h"
-#include "qcommon/ojk_sg_archive_fwd.h"
+#include "qcommon/ojk_saved_game_fwd.h"
 
 
 // ================================================================
diff --git a/code/rd-vanilla/CMakeLists.txt b/code/rd-vanilla/CMakeLists.txt
index 77c3fef..0bbc879 100644
--- a/code/rd-vanilla/CMakeLists.txt
+++ b/code/rd-vanilla/CMakeLists.txt
@@ -82,10 +82,9 @@ if(BuildSPRdVanilla OR BuildJK2SPRdVanilla)
 		"${SharedDir}/qcommon/ojk_sg_wrappers_fwd.h"
 		"${SharedDir}/qcommon/ojk_sg_wrappers_shared.h"
 		"${SharedDir}/qcommon/ojk_exception.h"
-		"${SharedDir}/qcommon/ojk_sg_archive.h"
-		"${SharedDir}/qcommon/ojk_sg_archive_fwd.h"
-		"${SharedDir}/qcommon/ojk_sg_archive_exception.h"
-
+		"${SharedDir}/qcommon/ojk_saved_game.h"
+		"${SharedDir}/qcommon/ojk_saved_game_fwd.h"
+		"${SharedDir}/qcommon/ojk_saved_game_exception.h"
 		${SharedCommonFiles}
 		)
 	source_group("common" FILES ${SPRDVanillaCommonFiles})
diff --git a/code/rd-vanilla/G2_misc.cpp b/code/rd-vanilla/G2_misc.cpp
index 7e319d0..9ce7074 100644
--- a/code/rd-vanilla/G2_misc.cpp
+++ b/code/rd-vanilla/G2_misc.cpp
@@ -51,7 +51,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #ifdef _G2_GORE
 #include "../ghoul2/ghoul2_gore.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #define GORE_TAG_UPPER (256)
 #define GORE_TAG_MASK (~255)
diff --git a/code/server/sv_savegame.cpp b/code/server/sv_savegame.cpp
index e4069d6..305a06b 100644
--- a/code/server/sv_savegame.cpp
+++ b/code/server/sv_savegame.cpp
@@ -38,7 +38,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include <map>
 
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 static char	saveGameComment[iSG_COMMENT_SIZE];
 
diff --git a/codeJK2/cgame/cg_main.cpp b/codeJK2/cgame/cg_main.cpp
index f6279e7..3ff00fb 100644
--- a/codeJK2/cgame/cg_main.cpp
+++ b/codeJK2/cgame/cg_main.cpp
@@ -29,7 +29,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "../../code/qcommon/sstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 //NOTENOTE: Be sure to change the mirrored code in g_shared.h
 typedef std::map< sstring_t, unsigned char, std::less<sstring_t>, std::allocator< unsigned char >  >	namePrecache_m;
diff --git a/codeJK2/game/CMakeLists.txt b/codeJK2/game/CMakeLists.txt
index 9ca9ea7..9c8dc71 100644
--- a/codeJK2/game/CMakeLists.txt
+++ b/codeJK2/game/CMakeLists.txt
@@ -236,9 +236,9 @@ set(JK2SPGameCommonFiles
 	"${SharedDir}/qcommon/ojk_sg_wrappers_fwd.h"
 	"${SharedDir}/qcommon/ojk_sg_wrappers_shared.h"
 	"${SharedDir}/qcommon/ojk_exception.h"
-	"${SharedDir}/qcommon/ojk_sg_archive.h"
-	"${SharedDir}/qcommon/ojk_sg_archive_fwd.h"
-	"${SharedDir}/qcommon/ojk_sg_archive_exception.h"
+	"${SharedDir}/qcommon/ojk_saved_game.h"
+	"${SharedDir}/qcommon/ojk_saved_game_fwd.h"
+	"${SharedDir}/qcommon/ojk_saved_game_exception.h"
 
 	${SharedCommonFiles}
 	)
diff --git a/codeJK2/game/G_Timer.cpp b/codeJK2/game/G_Timer.cpp
index 6b5de3a..26197b2 100644
--- a/codeJK2/game/G_Timer.cpp
+++ b/codeJK2/game/G_Timer.cpp
@@ -24,7 +24,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_local.h"
 #include "../../code/Rufl/hstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #define MAX_GTIMERS	16384
 
diff --git a/codeJK2/game/Q3_Registers.cpp b/codeJK2/game/Q3_Registers.cpp
index 3ed0835..87c21a5 100644
--- a/codeJK2/game/Q3_Registers.cpp
+++ b/codeJK2/game/Q3_Registers.cpp
@@ -25,7 +25,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_local.h"
 #include "Q3_Registers.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern	void	Q3_DebugPrint( int level, const char *format, ... );
 
diff --git a/codeJK2/game/g_main.cpp b/codeJK2/game/g_main.cpp
index 9bb1260..76f6f96 100644
--- a/codeJK2/game/g_main.cpp
+++ b/codeJK2/game/g_main.cpp
@@ -36,7 +36,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "../cgame/cg_local.h"	// yeah I know this is naughty, but we're shipping soon...
 #include "time.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern CNavigator		navigator;
 
diff --git a/codeJK2/game/g_objectives.cpp b/codeJK2/game/g_objectives.cpp
index c5e2ae8..9fdbc4c 100644
--- a/codeJK2/game/g_objectives.cpp
+++ b/codeJK2/game/g_objectives.cpp
@@ -32,7 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include "objectives.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 qboolean	missionInfo_Updated;
 
diff --git a/codeJK2/game/g_roff.cpp b/codeJK2/game/g_roff.cpp
index 60ceed6..749c7e0 100644
--- a/codeJK2/game/g_roff.cpp
+++ b/codeJK2/game/g_roff.cpp
@@ -26,7 +26,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_roff.h"
 #include "g_icarus.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 // The list of precached ROFFs
 roff_list_t	roffs[MAX_ROFFS];
diff --git a/codeJK2/game/g_savegame.cpp b/codeJK2/game/g_savegame.cpp
index d3108fa..799c9e9 100644
--- a/codeJK2/game/g_savegame.cpp
+++ b/codeJK2/game/g_savegame.cpp
@@ -34,7 +34,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 #include "g_icarus.h"
 #include "../../code/qcommon/sstring.h"
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 extern void OBJ_LoadTacticalInfo(void);
 
diff --git a/codeJK2/icarus/Instance.cpp b/codeJK2/icarus/Instance.cpp
index 7888ee7..6a833f5 100644
--- a/codeJK2/icarus/Instance.cpp
+++ b/codeJK2/icarus/Instance.cpp
@@ -30,7 +30,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include <assert.h>
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 // Instance
 
diff --git a/codeJK2/icarus/Sequence.cpp b/codeJK2/icarus/Sequence.cpp
index 2b9a56f..7f2cbba 100644
--- a/codeJK2/icarus/Sequence.cpp
+++ b/codeJK2/icarus/Sequence.cpp
@@ -29,7 +29,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include <assert.h>
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 CSequence::CSequence( void )
 {
diff --git a/codeJK2/icarus/TaskManager.cpp b/codeJK2/icarus/TaskManager.cpp
index 9fb06d0..3b32e53 100644
--- a/codeJK2/icarus/TaskManager.cpp
+++ b/codeJK2/icarus/TaskManager.cpp
@@ -32,7 +32,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 #include <assert.h>
 #include "qcommon/ojk_sg_wrappers.h"
-#include "qcommon/ojk_sg_archive.h"
+#include "qcommon/ojk_saved_game.h"
 
 #define ICARUS_VALIDATE(a) if ( a == false ) return TASK_FAILED;
 
diff --git a/shared/qcommon/ojk_sg_archive.cpp b/shared/qcommon/ojk_saved_game.cpp
similarity index 91%
rename from shared/qcommon/ojk_sg_archive.cpp
rename to shared/qcommon/ojk_saved_game.cpp
index 2446717..1ccca78 100644
--- a/shared/qcommon/ojk_sg_archive.cpp
+++ b/shared/qcommon/ojk_saved_game.cpp
@@ -5,10 +5,9 @@
 
 
 namespace ojk {
-namespace sg {
 
 
-Archive::Archive() :
+SavedGame::SavedGame() :
         file_handle_(),
         io_buffer_(),
         io_buffer_offset_(),
@@ -17,12 +16,12 @@ Archive::Archive() :
 {
 }
 
-Archive::~Archive()
+SavedGame::~SavedGame()
 {
     close();
 }
 
-bool Archive::open(
+bool SavedGame::open(
     const std::string& base_file_name)
 {
     auto&& file_path = generate_path(
@@ -75,7 +74,7 @@ bool Archive::open(
     return is_succeed;
 }
 
-bool Archive::create(
+bool SavedGame::create(
     const std::string& base_file_name)
 {
     remove(
@@ -108,7 +107,7 @@ bool Archive::create(
     return true;
 }
 
-void Archive::close()
+void SavedGame::close()
 {
     if (file_handle_ != 0) {
         ::FS_FCloseFile(file_handle_);
@@ -119,21 +118,21 @@ void Archive::close()
     io_buffer_offset_ = 0;
 }
 
-bool Archive::read_chunk(
-    const Archive::ChunkId chunk_id)
+bool SavedGame::read_chunk(
+    const SavedGame::ChunkId chunk_id)
 {
-    throw ArchiveException(
+    throw SavedGameException(
         "Not implemented.");
 }
 
-bool Archive::write_chunk(
-    const Archive::ChunkId chunk_id)
+bool SavedGame::write_chunk(
+    const SavedGame::ChunkId chunk_id)
 {
-    throw ArchiveException(
+    throw SavedGameException(
         "Not implemented.");
 }
 
-void Archive::rename(
+void SavedGame::rename(
     const std::string& old_base_file_name,
     const std::string& new_base_file_name)
 {
@@ -154,7 +153,7 @@ void Archive::rename(
     }
 }
 
-void Archive::remove(
+void SavedGame::remove(
     const std::string& base_file_name)
 {
     auto path = generate_path(
@@ -164,13 +163,13 @@ void Archive::remove(
         path.c_str());
 }
 
-Archive& Archive::get_instance()
+SavedGame& SavedGame::get_instance()
 {
-    static Archive result;
+    static SavedGame result;
     return result;
 }
 
-int Archive::compress()
+int SavedGame::compress()
 {
     auto src_size = static_cast<int>(io_buffer_.size());
 
@@ -228,7 +227,7 @@ int Archive::compress()
     return dst_index;
 }
 
-void Archive::decompress(
+void SavedGame::decompress(
     int dst_size)
 {
     rle_buffer_.resize(
@@ -263,7 +262,7 @@ void Archive::decompress(
     }
 }
 
-std::string Archive::generate_path(
+std::string SavedGame::generate_path(
     const std::string& base_file_name)
 {
     auto normalized_file_name = base_file_name;
@@ -279,7 +278,7 @@ std::string Archive::generate_path(
     return path;
 }
 
-std::string Archive::get_failed_to_open_message(
+std::string SavedGame::get_failed_to_open_message(
     const std::string& file_name,
     bool is_open)
 {
@@ -311,5 +310,4 @@ std::string Archive::get_failed_to_open_message(
 }
 
 
-} // sg
 } // ojk
diff --git a/shared/qcommon/ojk_sg_archive.h b/shared/qcommon/ojk_saved_game.h
similarity index 91%
rename from shared/qcommon/ojk_sg_archive.h
rename to shared/qcommon/ojk_saved_game.h
index a9aa961..d6664f3 100644
--- a/shared/qcommon/ojk_sg_archive.h
+++ b/shared/qcommon/ojk_saved_game.h
@@ -1,11 +1,10 @@
 //
-// Saved game archive.
-// (forward declaration)
+// Saved game.
 //
 
 
-#ifndef OJK_SG_ARCHIVE_INCLUDED
-#define OJK_SG_ARCHIVE_INCLUDED
+#ifndef OJK_SAVED_GAME_INCLUDED
+#define OJK_SAVED_GAME_INCLUDED
 
 
 #include <cstdint>
@@ -15,35 +14,34 @@
 
 
 namespace ojk {
-namespace sg {
 
 
 // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 // I/O buffer manipulation.
 
 template<typename T>
-void Archive::check_io_buffer(
+void SavedGame::check_io_buffer(
     int count)
 {
     if (count <= 0) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Zero or negative count.");
     }
 
     const auto data_size = sizeof(T) * count;
 
     if ((io_buffer_offset_ + data_size) > io_buffer_.size()) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Not enough data.");
     }
 }
 
 template<typename T>
-void Archive::accomodate_io_buffer(
+void SavedGame::accomodate_io_buffer(
     int count)
 {
     if (count <= 0) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Zero or negative count.");
     }
 
@@ -56,17 +54,17 @@ void Archive::accomodate_io_buffer(
 }
 
 template<typename T>
-T Archive::cast_io_buffer()
+T SavedGame::cast_io_buffer()
 {
     return reinterpret_cast<T>(io_buffer_[io_buffer_offset_]);
 }
 
 template<typename T>
-void Archive::advance_io_buffer(
+void SavedGame::advance_io_buffer(
     int count)
 {
     if (count <= 0) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Zero or negative count.");
     }
 
@@ -82,7 +80,7 @@ void Archive::advance_io_buffer(
 // read_chunk
 
 template<typename TSrc, typename TDst>
-bool Archive::read_chunk(
+bool SavedGame::read_chunk(
     const ChunkId chunk_id,
     TDst& dst_value)
 {
@@ -96,7 +94,7 @@ bool Archive::read_chunk(
 }
 
 template<typename TSrc, typename TDst>
-bool Archive::read_chunk(
+bool SavedGame::read_chunk(
     const ChunkId chunk_id,
     TDst* dst_values,
     int dst_count)
@@ -119,7 +117,7 @@ bool Archive::read_chunk(
 // write_chunk
 
 template<typename TDst, typename TSrc>
-bool Archive::write_chunk(
+bool SavedGame::write_chunk(
     const ChunkId chunk_id,
     const TSrc& src_value)
 {
@@ -133,7 +131,7 @@ bool Archive::write_chunk(
 }
 
 template<typename TDst, typename TSrc>
-bool Archive::write_chunk(
+bool SavedGame::write_chunk(
     const ChunkId chunk_id,
     const TSrc* src_values,
     int src_count)
@@ -156,7 +154,7 @@ bool Archive::write_chunk(
 // read
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst& dst_value)
 {
     using Tag = typename std::conditional<
@@ -191,7 +189,7 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst& dst_value,
     BooleanTag)
 {
@@ -208,7 +206,7 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst& dst_value,
     NumericTag)
 {
@@ -223,7 +221,7 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst*& dst_value,
     PointerTag)
 {
@@ -248,16 +246,16 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst& dst_value,
     ClassTag)
 {
-    throw ArchiveException(
+    throw SavedGameException(
         "Not implemented.");
 }
 
 template<typename TSrc, typename TDst, int TCount>
-void Archive::read(
+void SavedGame::read(
     TDst (&dst_values)[TCount],
     Array1dTag)
 {
@@ -274,7 +272,7 @@ void Archive::read(
 // read (C-array)
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst* dst_values,
     int dst_count)
 {
@@ -286,12 +284,12 @@ void Archive::read(
         "Unsupported types.");
 
     if (!dst_values) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Null pointer.");
     }
 
     if (dst_count < 0) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Negative count.");
     }
 
@@ -335,7 +333,7 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst* dst_values,
     int dst_count,
     InplaceTag)
@@ -356,7 +354,7 @@ void Archive::read(
 }
 
 template<typename TSrc, typename TDst>
-void Archive::read(
+void SavedGame::read(
     TDst* dst_values,
     int dst_count,
     CastTag)
@@ -386,7 +384,7 @@ void Archive::read(
 // write
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc& src_value)
 {
     using Tag = typename std::conditional<
@@ -417,7 +415,7 @@ void Archive::write(
 }
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc& src_value,
     NumericTag)
 {
@@ -432,7 +430,7 @@ void Archive::write(
 }
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc*& src_value,
     PointerTag)
 {
@@ -450,16 +448,16 @@ void Archive::write(
 }
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc& src_value,
     ClassTag)
 {
-    throw ArchiveException(
+    throw SavedGameException(
         "Not implemented.");
 }
 
 template<typename TDst, typename TSrc, int TCount>
-void Archive::write(
+void SavedGame::write(
     const TSrc (&src_values)[TCount],
     Array1dTag)
 {
@@ -476,7 +474,7 @@ void Archive::write(
 // write (C-array)
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc* src_values,
     int src_count)
 {
@@ -488,12 +486,12 @@ void Archive::write(
         "Unsupported types.");
 
     if (!src_values) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Null pointer.");
     }
 
     if (src_count < 0) {
-        throw ArchiveException(
+        throw SavedGameException(
             "Negative count.");
     }
 
@@ -537,7 +535,7 @@ void Archive::write(
 }
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc* src_values,
     int src_count,
     InplaceTag)
@@ -558,7 +556,7 @@ void Archive::write(
 }
 
 template<typename TDst, typename TSrc>
-void Archive::write(
+void SavedGame::write(
     const TSrc* src_values,
     int src_count,
     CastTag)
@@ -584,8 +582,7 @@ void Archive::write(
 // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
 
-} // sg
 } // ojk
 
 
-#endif // OJK_SG_ARCHIVE_INCLUDED
+#endif // OJK_SAVED_GAME_INCLUDED
diff --git a/shared/qcommon/ojk_sg_archive_exception.cpp b/shared/qcommon/ojk_saved_game_exception.cpp
similarity index 55%
rename from shared/qcommon/ojk_sg_archive_exception.cpp
rename to shared/qcommon/ojk_saved_game_exception.cpp
index a582836..23e948e 100644
--- a/shared/qcommon/ojk_sg_archive_exception.cpp
+++ b/shared/qcommon/ojk_saved_game_exception.cpp
@@ -1,5 +1,5 @@
 //
-// Saved game archive exception.
+// Saved game exception.
 //
 
 
@@ -7,25 +7,23 @@
 
 
 namespace ojk {
-namespace sg {
 
 
-ArchiveException::ArchiveException(
+SavedGameException::SavedGameException(
     const char* message) :
         Exception(message)
 {
 }
 
-ArchiveException::ArchiveException(
+SavedGameException::SavedGameException(
     const std::string& message) :
         Exception(message)
 {
 }
 
-ArchiveException::~ArchiveException()
+SavedGameException::~SavedGameException()
 {
 }
 
 
-} // sg
 } // ojk
diff --git a/shared/qcommon/ojk_saved_game_exception.h b/shared/qcommon/ojk_saved_game_exception.h
new file mode 100644
index 0000000..45c6708
--- /dev/null
+++ b/shared/qcommon/ojk_saved_game_exception.h
@@ -0,0 +1,34 @@
+//
+// Saved game exception.
+//
+
+
+#ifndef OJK_SAVED_GAME_EXCEPTION_INCLUDED
+#define OJK_SAVED_GAME_EXCEPTION_INCLUDED
+
+
+#include "ojk_exception.h"
+
+
+namespace ojk {
+
+
+class SavedGameException :
+    public Exception
+{
+public:
+    explicit SavedGameException(
+        const char* message);
+
+    explicit SavedGameException(
+        const std::string& message);
+
+    virtual ~SavedGameException();
+}; // SavedGameException
+
+
+} // ojk
+
+
+#endif // OJK_SAVED_GAME_EXCEPTION_INCLUDED
+
diff --git a/shared/qcommon/ojk_sg_archive_fwd.h b/shared/qcommon/ojk_saved_game_fwd.h
similarity index 94%
rename from shared/qcommon/ojk_sg_archive_fwd.h
rename to shared/qcommon/ojk_saved_game_fwd.h
index 03868fd..1342ae5 100644
--- a/shared/qcommon/ojk_sg_archive_fwd.h
+++ b/shared/qcommon/ojk_saved_game_fwd.h
@@ -1,11 +1,11 @@
 //
-// Saved game archive.
+// Saved game.
 // (forward declaration)
 //
 
 
-#ifndef OJK_SG_ARCHIVE_FWD_INCLUDED
-#define OJK_SG_ARCHIVE_FWD_INCLUDED
+#ifndef OJK_SAVED_GAME_FWD_INCLUDED
+#define OJK_SAVED_GAME_FWD_INCLUDED
 
 
 #include <cstdint>
@@ -15,24 +15,23 @@
 
 
 namespace ojk {
-namespace sg {
 
 
-class Archive
+class SavedGame
 {
 public:
     using ChunkId = uint32_t;
 
 
-    Archive();
+    SavedGame();
 
-    Archive(
-        const Archive& that) = delete;
+    SavedGame(
+        const SavedGame& that) = delete;
 
-    Archive& operator=(
-        const Archive& that) = delete;
+    SavedGame& operator=(
+        const SavedGame& that) = delete;
 
-    ~Archive();
+    ~SavedGame();
 
 
     // Creates a new saved game file for writing.
@@ -121,7 +120,7 @@ public:
         const std::string& base_file_name);
 
     // Returns a default instance of the class.
-    static Archive& get_instance();
+    static SavedGame& get_instance();
 
 
 private:
@@ -264,11 +263,10 @@ private:
         const TSrc* src_values,
         int src_count,
         CastTag);
-}; // Archive
+}; // SavedGame
 
 
-} // sg
 } // ojk
 
 
-#endif // OJK_SG_ARCHIVE_FWD_INCLUDED
+#endif // OJK_SAVED_GAME_FWD_INCLUDED
diff --git a/shared/qcommon/ojk_sg_archive_exception.h b/shared/qcommon/ojk_sg_archive_exception.h
deleted file mode 100644
index a709724..0000000
--- a/shared/qcommon/ojk_sg_archive_exception.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Saved game archive exception.
-//
-
-
-#ifndef OJK_SG_ARCHIVE_EXCEPTION_INCLUDED
-#define OJK_SG_ARCHIVE_EXCEPTION_INCLUDED
-
-
-#include "ojk_exception.h"
-
-
-namespace ojk {
-namespace sg {
-
-
-class ArchiveException :
-    public Exception
-{
-public:
-    explicit ArchiveException(
-        const char* message);
-
-    explicit ArchiveException(
-        const std::string& message);
-
-    virtual ~ArchiveException();
-}; // ArchiveException
-
-
-} // sg
-} // ojk
-
-
-#endif // OJK_SG_ARCHIVE_EXCEPTION_INCLUDED
-

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list