64 bool bReturn = (*((
char *) pchBuffer)) ?
true :
false;
65 pchBuffer +=
sizeof(char);
71 char chReturn = *((
char*)pchBuffer);
72 pchBuffer +=
sizeof(char);
78 int nLength =
ReadInt(pchBuffer);
80 if(nLength == 0)
return "";
91 memcpy(&nReturn, pchBuffer,
sizeof(
short));
92 pchBuffer +=
sizeof(short);
99 memcpy(&nReturn, pchBuffer,
sizeof(
int));
100 pchBuffer +=
sizeof(int);
107 memcpy(&fReturn, pchBuffer,
sizeof(
float));
108 pchBuffer +=
sizeof(float);
115 memcpy(&dReturn, pchBuffer,
sizeof(
double));
116 pchBuffer +=
sizeof(double);
122 memcpy(pDest,(
void*) pchBuffer,nSize);
133 char chValue = (char) bValue;
134 return fwrite(&chValue, 1, 1, fp) == 1;
139 return fwrite(&chValue, 1, 1, fp) == 1;
147 return WriteInt(fp, (
int) szValue.length()) && fwrite(szValue.data(), szValue.length(), 1, fp) == 1;
152 return fwrite(&nValue,
sizeof(
int), 1, fp) == 1;
157 return fwrite(&fValue,
sizeof(
float), 1, fp) == 1;
162 return fwrite(&dValue,
sizeof(
double), 1, fp) == 1;
167 return fwrite(pSrc, nSize, 1, fp) == 1;
173 const int nCurrentFilePos = ftell(fp);
174 fseek(fp, 0, SEEK_END);
175 const int nFileSize = ftell(fp);
176 fseek(fp, nCurrentFilePos, SEEK_SET);
static void ReadBytes(char *&pchBuffer, void *pDest, int nSize)
static std::string ReadString(char *&pchBuffer)
static short ReadShort(char *&pchBuffer)
static int GetFileSize(FILE *fp)
static float ReadFloat(char *&pchBuffer)
static double ReadDouble(char *&pchBuffer)
static bool ReadBool(char *&pchBuffer)
static bool WriteFloat(FILE *fp, float fValue)
static char ReadChar(char *&pchBuffer)
static bool WriteString(FILE *fp, std::string szValue)
static bool WriteInt(FILE *fp, int nValue)
GLsizei const GLchar ** string
static bool WriteDouble(FILE *fp, double dValue)
static bool WriteBool(FILE *fp, bool bValue)
static int ReadInt(char *&pchBuffer)
static bool WriteBytes(FILE *fp, void *pSrc, int nSize)
static bool WriteChar(FILE *fp, char chValue)