Browse Source

Added IO info print

Ivan Arkhipov 6 years ago
parent
commit
9f191c60d7
2 changed files with 17 additions and 0 deletions
  1. 2 0
      include/DatSubsystems/DatIO.h
  2. 15 0
      src/DatSubsystems/DatIO.cpp

+ 2 - 0
include/DatSubsystems/DatIO.h

@@ -38,6 +38,8 @@ namespace LOTRO_DAT {
 
         DatOperationResult<std::string> GetFilename();
 
+        void PrintInformaion(FILE* file);
+
         DatOperationResult<> DeInit();
 
     private:

+ 15 - 0
src/DatSubsystems/DatIO.cpp

@@ -245,5 +245,20 @@ namespace LOTRO_DAT {
     DatOperationResult<std::string> DatIO::GetFilename() {
         return DatOperationResult<std::string>(filename_, SUCCESS);
     }
+
+    void DatIO::PrintInformaion(FILE *file) {
+        fprintf(file, "========== IO info ==========\n");
+        fprintf(file, "File header data:\n");
+        fprintf(file, "constant1 = %lld\n", constant1);
+        fprintf(file, "constant2 = %lld\n", constant2);
+        fprintf(file, "file_size = %lld\n", file_size);
+        fprintf(file, "version1 = %lld\n", version1);
+        fprintf(file, "version2 = %lld\n", version2);
+        fprintf(file, "fragment_journal_offset = %lld\n", fragmentation_journal_offset);
+        fprintf(file, "fragment_journal_end = %lld\n", fragmentation_journal_end);
+        fprintf(file, "fragment_journal_size = %lld\n", fragmentation_journal_size);
+        fprintf(file, "root_dir_offset = %lld\n", root_directory_offset);
+        fprintf(file, "free_dat_size = %lld\n", free_dat_size);
+    }
 }
 }