TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TFileNameDatabasePtr Class Reference

#include <CascMndx.h>

Public Member Functions

 TFileNameDatabasePtr ()
 
 ~TFileNameDatabasePtr ()
 
int FindFileInDatabase (TMndxFindResult *pStruct1C)
 
int sub_1956CE0 (TMndxFindResult *pStruct1C, bool *pbFindResult)
 
int GetFileNameCount (PDWORD PtrFileNameCount)
 
int CreateDatabase (LPBYTE pbMarData, DWORD cbMarData)
 
int SetDatabase (TFileNameDatabase *pNewDB)
 

Public Attributes

TFileNameDatabasepDB
 

Constructor & Destructor Documentation

TFileNameDatabasePtr::TFileNameDatabasePtr ( )
2655 {
2656  pDB = NULL;
2657 }
arena_t NULL
Definition: jemalloc_internal.h:624
TFileNameDatabase * pDB
Definition: CascMndx.h:286
TFileNameDatabasePtr::~TFileNameDatabasePtr ( )
2660 {
2661  delete pDB;
2662 }
TFileNameDatabase * pDB
Definition: CascMndx.h:286

Member Function Documentation

int TFileNameDatabasePtr::CreateDatabase ( LPBYTE  pbMarData,
DWORD  cbMarData 
)
2715 {
2716  TFileNameDatabase * pDatabase;
2717  TByteStream ByteStream;
2718  int nError;
2719 
2720  if(pbMarData == NULL && cbMarData != 0)
2721  return ERROR_INVALID_PARAMETER;
2722 
2723  pDatabase = new TFileNameDatabase;
2724  if(pDatabase == NULL)
2725  return ERROR_NOT_ENOUGH_MEMORY;
2726 
2727  nError = ByteStream.SetByteBuffer(pbMarData, cbMarData);
2728  if(nError != ERROR_SUCCESS)
2729  return nError;
2730 
2731  // HOTS: 1956E11
2732  nError = pDatabase->LoadFromStream_Exchange(ByteStream);
2733  if(nError != ERROR_SUCCESS)
2734  return nError;
2735 
2736  pDB = pDatabase;
2737  return ERROR_SUCCESS;
2738 }
Definition: CascMndx.h:289
#define ERROR_NOT_ENOUGH_MEMORY
Definition: CascPort.h:208
arena_t NULL
Definition: jemalloc_internal.h:624
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:2624
TFileNameDatabase * pDB
Definition: CascMndx.h:286
#define ERROR_INVALID_PARAMETER
Definition: CascPort.h:210
Definition: CascMndx.h:68
int SetByteBuffer(LPBYTE pbNewMarData, DWORD cbNewMarData)
Definition: CascRootFile_Mndx.cpp:414
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TFileNameDatabasePtr::FindFileInDatabase ( TMndxFindResult pStruct1C)
2666 {
2667  int nError = ERROR_SUCCESS;
2668 
2669  if(pDB == NULL)
2670  return ERROR_INVALID_PARAMETER;
2671 
2672  nError = pStruct1C->CreateStruct40();
2673  if(nError != ERROR_SUCCESS)
2674  return nError;
2675 
2676  if(!pDB->FindFileInDatabase(pStruct1C))
2677  nError = ERROR_FILE_NOT_FOUND;
2678 
2679  pStruct1C->FreeStruct40();
2680  return nError;
2681 }
int CreateStruct40()
Definition: CascRootFile_Mndx.cpp:290
arena_t NULL
Definition: jemalloc_internal.h:624
#define ERROR_FILE_NOT_FOUND
Definition: CascPort.h:205
TFileNameDatabase * pDB
Definition: CascMndx.h:286
#define ERROR_INVALID_PARAMETER
Definition: CascPort.h:210
void FreeStruct40()
Definition: CascRootFile_Mndx.cpp:299
bool FindFileInDatabase(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2528
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TFileNameDatabasePtr::GetFileNameCount ( PDWORD  PtrFileNameCount)
2705 {
2706  if(pDB == NULL)
2707  return ERROR_INVALID_PARAMETER;
2708 
2709  PtrFileNameCount[0] = pDB->FileNameIndexes.ValidItemCount;
2710  return ERROR_SUCCESS;
2711 }
arena_t NULL
Definition: jemalloc_internal.h:624
TFileNameDatabase * pDB
Definition: CascMndx.h:286
#define ERROR_INVALID_PARAMETER
Definition: CascPort.h:210
TSparseArray FileNameIndexes
Definition: CascMndx.h:325
DWORD ValidItemCount
Definition: CascMndx.h:229
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the caller graph for this function:

int TFileNameDatabasePtr::SetDatabase ( TFileNameDatabase pNewDB)
2742 {
2743  if(pNewDB != NULL && pDB == pNewDB)
2744  return ERROR_INVALID_PARAMETER;
2745 
2746  if(pDB != NULL)
2747  delete pDB;
2748  pDB = pNewDB;
2749  return ERROR_SUCCESS;
2750 }
arena_t NULL
Definition: jemalloc_internal.h:624
TFileNameDatabase * pDB
Definition: CascMndx.h:286
#define ERROR_INVALID_PARAMETER
Definition: CascPort.h:210
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the caller graph for this function:

int TFileNameDatabasePtr::sub_1956CE0 ( TMndxFindResult pStruct1C,
bool pbFindResult 
)
2685 {
2686  int nError = ERROR_SUCCESS;
2687 
2688  if(pDB == NULL)
2689  return ERROR_INVALID_PARAMETER;
2690 
2691  // Create the pStruct40, if not initialized yet
2692  if(pStruct1C->pStruct40 == NULL)
2693  {
2694  nError = pStruct1C->CreateStruct40();
2695  if(nError != ERROR_SUCCESS)
2696  return nError;
2697  }
2698 
2699  *pbFindResult = pDB->sub_1959460(pStruct1C);
2700  return nError;
2701 }
int CreateStruct40()
Definition: CascRootFile_Mndx.cpp:290
TStruct40 * pStruct40
Definition: CascMndx.h:206
bool sub_1959460(TMndxFindResult *pStruct1C)
Definition: CascRootFile_Mndx.cpp:2245
arena_t NULL
Definition: jemalloc_internal.h:624
TFileNameDatabase * pDB
Definition: CascMndx.h:286
#define ERROR_INVALID_PARAMETER
Definition: CascPort.h:210
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

TFileNameDatabase* TFileNameDatabasePtr::pDB

The documentation for this class was generated from the following files: