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

#include <CascMndx.h>

Public Member Functions

 TNameIndexStruct ()
 
 ~TNameIndexStruct ()
 
bool CheckNameFragment (TMndxFindResult *pStruct1C, DWORD dwFragOffs)
 
bool CheckAndCopyNameFragment (TMndxFindResult *pStruct1C, DWORD dwFragOffs)
 
void CopyNameFragment (TMndxFindResult *pStruct1C, DWORD dwFragOffs)
 
void ExchangeWith (TNameIndexStruct &Target)
 
int LoadFromStream (TByteStream &InStream)
 
int LoadFromStream_Exchange (TByteStream &InStream)
 

Public Attributes

TGenericArray NameFragments
 
TSparseArray Struct68
 

Constructor & Destructor Documentation

TNameIndexStruct::TNameIndexStruct ( )
1119 {}
TNameIndexStruct::~TNameIndexStruct ( )
1123 {}

Member Function Documentation

bool TNameIndexStruct::CheckAndCopyNameFragment ( TMndxFindResult pStruct1C,
DWORD  dwFragOffs 
)
1179 {
1180  TStruct40 * pStruct40 = pStruct1C->pStruct40;
1181  const char * szPathFragment;
1182  const char * szSearchMask;
1183 
1185  {
1186  // Get the offset of the fragment to compare. For convenience with pStruct40->CharIndex,
1187  // subtract the CharIndex from the fragment offset
1188  szPathFragment = (const char *)(NameFragments.CharArray + dwFragOffs - pStruct40->CharIndex);
1189  szSearchMask = pStruct1C->szSearchMask;
1190 
1191  // Keep copying as long as we don't reach the end of the search mask
1192  while(pStruct40->CharIndex < pStruct1C->cchSearchMask)
1193  {
1194  // HOTS: 195A5A0
1195  if(szPathFragment[pStruct40->CharIndex] != szSearchMask[pStruct40->CharIndex])
1196  return false;
1197 
1198  // HOTS: 195A5B7
1199  pStruct40->array_00.InsertOneItem_CHAR(szPathFragment[pStruct40->CharIndex]);
1200  pStruct40->CharIndex++;
1201 
1202  if(szPathFragment[pStruct40->CharIndex] == 0)
1203  return true;
1204  }
1205 
1206  // Fixup the address of the fragment
1207  szPathFragment += pStruct40->CharIndex;
1208 
1209  // HOTS: 195A660
1210  // Now we need to copy the rest of the fragment
1211  while(szPathFragment[0] != 0)
1212  {
1213  pStruct40->array_00.InsertOneItem_CHAR(szPathFragment[0]);
1214  szPathFragment++;
1215  }
1216  }
1217  else
1218  {
1219  // Get the offset of the fragment to compare
1220  // HOTS: 195A6B7
1221  szPathFragment = NameFragments.CharArray;
1222  szSearchMask = pStruct1C->szSearchMask;
1223 
1224  // Keep copying as long as we don't reach the end of the search mask
1225  while(dwFragOffs < pStruct1C->cchSearchMask)
1226  {
1227  if(szPathFragment[dwFragOffs] != szSearchMask[pStruct40->CharIndex])
1228  return false;
1229 
1230  pStruct40->array_00.InsertOneItem_CHAR(szPathFragment[dwFragOffs]);
1231  pStruct40->CharIndex++;
1232 
1233  // Keep going as long as the given bit is not set
1234  if(Struct68.IsItemPresent(dwFragOffs++))
1235  return true;
1236  }
1237 
1238  // Fixup the address of the fragment
1239  szPathFragment += dwFragOffs;
1240 
1241  // Now we need to copy the rest of the fragment
1242  while(Struct68.IsItemPresent(dwFragOffs++) == 0)
1243  {
1244  // HOTS: 195A7A6
1245  pStruct40->array_00.InsertOneItem_CHAR(szPathFragment[0]);
1246  szPathFragment++;
1247  }
1248  }
1249 
1250  return true;
1251 }
const char * szSearchMask
Definition: CascMndx.h:200
DWORD CharIndex
Definition: CascMndx.h:183
Definition: CascMndx.h:172
TStruct40 * pStruct40
Definition: CascMndx.h:206
void InsertOneItem_CHAR(char OneChar)
Definition: CascRootFile_Mndx.cpp:563
TSparseArray Struct68
Definition: CascMndx.h:251
TGenericArray NameFragments
Definition: CascMndx.h:250
TGenericArray array_00
Definition: CascMndx.h:180
DWORD IsItemPresent(DWORD ItemIndex)
Definition: CascMndx.h:220
DWORD TotalItemCount
Definition: CascMndx.h:228
size_t cchSearchMask
Definition: CascMndx.h:201

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool TNameIndexStruct::CheckNameFragment ( TMndxFindResult pStruct1C,
DWORD  dwFragOffs 
)
1127 {
1128  TStruct40 * pStruct40 = pStruct1C->pStruct40;
1129  const char * szPathFragment;
1130  const char * szSearchMask;
1131 
1133  {
1134  // Get the offset of the fragment to compare. For convenience with pStruct40->CharIndex,
1135  // subtract the CharIndex from the fragment offset
1136  szPathFragment = (NameFragments.CharArray + dwFragOffs - pStruct40->CharIndex);
1137  szSearchMask = pStruct1C->szSearchMask;
1138 
1139  // Keep searching as long as the name matches with the fragment
1140  while(szPathFragment[pStruct40->CharIndex] == szSearchMask[pStruct40->CharIndex])
1141  {
1142  // Move to the next character
1143  pStruct40->CharIndex++;
1144 
1145  // Is it the end of the fragment or end of the path?
1146  if(szPathFragment[pStruct40->CharIndex] == 0)
1147  return true;
1148  if(pStruct40->CharIndex >= pStruct1C->cchSearchMask)
1149  return false;
1150  }
1151 
1152  return false;
1153  }
1154  else
1155  {
1156  // Get the offset of the fragment to compare.
1157  szPathFragment = (const char *)(NameFragments.CharArray);
1158  szSearchMask = pStruct1C->szSearchMask;
1159 
1160  // Keep searching as long as the name matches with the fragment
1161  while(szPathFragment[dwFragOffs] == szSearchMask[pStruct40->CharIndex])
1162  {
1163  // Move to the next character
1164  pStruct40->CharIndex++;
1165 
1166  // Is it the end of the fragment or end of the path?
1167  if(Struct68.IsItemPresent(dwFragOffs++))
1168  return true;
1169  if(dwFragOffs >= pStruct1C->cchSearchMask)
1170  return false;
1171  }
1172 
1173  return false;
1174  }
1175 }
const char * szSearchMask
Definition: CascMndx.h:200
DWORD CharIndex
Definition: CascMndx.h:183
Definition: CascMndx.h:172
TStruct40 * pStruct40
Definition: CascMndx.h:206
TSparseArray Struct68
Definition: CascMndx.h:251
TGenericArray NameFragments
Definition: CascMndx.h:250
DWORD IsItemPresent(DWORD ItemIndex)
Definition: CascMndx.h:220
DWORD TotalItemCount
Definition: CascMndx.h:228
size_t cchSearchMask
Definition: CascMndx.h:201

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TNameIndexStruct::CopyNameFragment ( TMndxFindResult pStruct1C,
DWORD  dwFragOffs 
)
1255 {
1256  TStruct40 * pStruct40 = pStruct1C->pStruct40;
1257  const char * szPathFragment;
1258 
1259  // HOTS: 195A3FA
1261  {
1262  // HOTS: 195A40C
1263  szPathFragment = NameFragments.CharArray + dwFragOffs;
1264  while(szPathFragment[0] != 0)
1265  {
1266  // Insert the character to the path being built
1267  pStruct40->array_00.InsertOneItem_CHAR(*szPathFragment++);
1268  }
1269  }
1270  else
1271  {
1272  // HOTS: 195A4B3
1273  for(;;)
1274  {
1275  // Insert the character to the path being built
1276  pStruct40->array_00.InsertOneItem_CHAR(NameFragments.CharArray[dwFragOffs]);
1277 
1278  // Keep going as long as the given bit is not set
1279  if(Struct68.IsItemPresent(dwFragOffs++))
1280  break;
1281  }
1282  }
1283 }
Definition: CascMndx.h:172
TStruct40 * pStruct40
Definition: CascMndx.h:206
void InsertOneItem_CHAR(char OneChar)
Definition: CascRootFile_Mndx.cpp:563
TSparseArray Struct68
Definition: CascMndx.h:251
TGenericArray NameFragments
Definition: CascMndx.h:250
TGenericArray array_00
Definition: CascMndx.h:180
DWORD IsItemPresent(DWORD ItemIndex)
Definition: CascMndx.h:220
DWORD TotalItemCount
Definition: CascMndx.h:228

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TNameIndexStruct::ExchangeWith ( TNameIndexStruct Target)
1287 {
1288  TNameIndexStruct WorkBuff;
1289 
1290  WorkBuff = *this;
1291  *this = Target;
1292  Target = WorkBuff;
1293 }
Definition: CascMndx.h:235

+ Here is the caller graph for this function:

int TNameIndexStruct::LoadFromStream ( TByteStream InStream)
1297 {
1298  int nError;
1299 
1300  nError = NameFragments.LoadStringsWithCopy(InStream);
1301  if(nError != ERROR_SUCCESS)
1302  return nError;
1303 
1304  return Struct68.LoadFromStream_Exchange(InStream);
1305 }
int LoadStringsWithCopy(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:814
TSparseArray Struct68
Definition: CascMndx.h:251
int LoadFromStream_Exchange(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:1020
TGenericArray NameFragments
Definition: CascMndx.h:250
#define ERROR_SUCCESS
Definition: CascPort.h:204

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int TNameIndexStruct::LoadFromStream_Exchange ( TByteStream InStream)
1309 {
1310  TNameIndexStruct TempIndexStruct;
1311  int nError;
1312 
1313  nError = TempIndexStruct.LoadFromStream(InStream);
1314  if(nError != ERROR_SUCCESS)
1315  return nError;
1316 
1317  ExchangeWith(TempIndexStruct);
1318  return ERROR_SUCCESS;
1319 }
void ExchangeWith(TNameIndexStruct &Target)
Definition: CascRootFile_Mndx.cpp:1286
Definition: CascMndx.h:235
#define ERROR_SUCCESS
Definition: CascPort.h:204
int LoadFromStream(TByteStream &InStream)
Definition: CascRootFile_Mndx.cpp:1296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

TGenericArray TNameIndexStruct::NameFragments
TSparseArray TNameIndexStruct::Struct68

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