Header Class Reference

Header Class Reference

#include <hikdump.h>

Class Description

Public Member Functions

 Header ()
 
void Init (const char *_Header)
 
template<typename HIKFile >
bool Write (HIKFile pFile) const
 
template<typename HIKFile >
bool Read (HIKFile pFile)
 
 Header ()
 
void Init (const char *_Header)
 
template<typename HIKFile >
bool Write (HIKFile pFile) const
 
template<typename HIKFile >
bool Read (HIKFile pFile)
 

Public Attributes

bool bSwap
 

Constructor & Destructor Documentation

Header ( )
inline

Definition at line 208 of file hikdump.h.

208 :bSwap(false) {}
bool bSwap
Definition: hikdump.h:206
Header ( )
inline

Definition at line 208 of file hikdump.h.

208 :bSwap(false) {}
bool bSwap
Definition: hikdump.h:206

Member Function Documentation

void Init ( const char *  _Header)
inline

Definition at line 209 of file hikdump.h.

209 { strcpy(HeaderStr, _Header); }
void Init ( const char *  _Header)
inline

Definition at line 209 of file hikdump.h.

210  {
211  #if (_MSC_VER == 1500)
212  strcpy(HeaderStr, _Header);
213  #else
214  strcpy_s(HeaderStr, HEADERLENGTH, _Header);
215  #endif
216  }
#define HEADERLENGTH
Definition: hikdump.h:192
int strcpy_s(char *dst, size_t, const char *src)
Definition: kaydara.h:252
bool Read ( HIKFile  pFile)
inline

Definition at line 45 of file hikdump_std.inl.

46 {
47  char ReadBuf[HEADERLENGTH];
48  if(fread( (void *)&ReadBuf[0], sizeof(char), HEADERLENGTH, pFile) == HEADERLENGTH)
49  {
50  if(strcmp(HeaderStr,ReadBuf) == 0)
51  {
52  int ReadMagicNumber;
53  if(fread( (void *)&ReadMagicNumber, sizeof(int), 1, pFile) == 1)
54  {
55  bSwap = !(ReadMagicNumber == MagicNumber);
56  return true;
57  }
58  }
59  }
60 
61  return false;
62 }
bool bSwap
Definition: hikdump.h:206
#define HEADERLENGTH
Definition: hikdump.h:192
const int MagicNumber
Definition: hikdump.h:199
bool Read ( HIKFile  pFile)
inline
bool Write ( HIKFile  pFile) const
inline

Definition at line 36 of file hikdump_std.inl.

37 {
38  bool status;
39  status = fwrite( (void *)&HeaderStr[0], sizeof(char), HEADERLENGTH, pFile) == HEADERLENGTH;
40  status = (status && (fwrite( (void *)&MagicNumber, sizeof(int), 1, pFile) == 1));
41  return status;
42 }
#define HEADERLENGTH
Definition: hikdump.h:192
const int MagicNumber
Definition: hikdump.h:199
bool Write ( HIKFile  pFile) const
inline

Member Data Documentation

bool bSwap

Definition at line 206 of file hikdump.h.


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