Go to the documentation of this file.
74 return ReadBytes(&out_data,
sizeof(T), cRead);
94 template<
class CHAR_T>
96 CHAR_T * out_pszString,
100 if (!Read<AkInt32>(cChars))
109 if (cChars < in_nMax)
111 ReadBytes(out_pszString, cChars *
sizeof(CHAR_T), cRead);
112 out_pszString[cChars] = 0;
114 bRet = cRead == (
AkInt32)(cChars *
sizeof(CHAR_T));
118 ReadBytes(out_pszString, in_nMax *
sizeof(CHAR_T), cRead);
119 out_pszString[in_nMax - 1] = 0;
121 bRet = cRead == (
AkInt32)(in_nMax *
sizeof(CHAR_T));
126 AkInt32 cRemaining = cChars - in_nMax;
128 CHAR_T * pTemp =
new CHAR_T[cRemaining];
130 ReadBytes(pTemp, cRemaining *
sizeof(CHAR_T), cRead);
132 bRet = cRead == (
AkInt32)(cRemaining *
sizeof(CHAR_T));
140 out_pszString[0] = 0;
162 const void * in_pData,
181 return WriteBytes(&in_data,
sizeof(T), cWritten);
187 const wchar_t * in_pszString)
189 if (in_pszString !=
NULL)
191 size_t cChars = wcslen(in_pszString);
192 if (!Write<AkUInt32>((
AkUInt32)cChars))
203 return cWritten == cToWrite;
205 return Write<AkUInt32>(0);
211 const char * in_pszString)
213 if (in_pszString !=
NULL)
215 size_t cChars = strlen(in_pszString);
216 if (!Write<AkUInt32>((
AkUInt32)cChars))
226 return cWritten == (
AkInt32)cChars;
228 return Write<AkUInt32>(0);
269 #endif // _AK_IBYTES_H
virtual AkUInt8 * Detach()=0
Return pointer to buffer and clear internal pointer.
bool ReadString(CHAR_T *out_pszString, AkInt32 in_nMax)
bool WriteString(const char *in_pszString)
virtual bool Reserve(AkInt32 in_cBytes)=0
virtual void SetCount(AkInt32 in_cBytes)=0
Set number of bytes written.
virtual bool WriteBytes(const void *in_pData, AkInt32 in_cBytes, AkInt32 &out_cWritten)=0
bool Write(const T &in_data)
virtual bool ReadBytes(void *in_pData, AkInt32 in_cBytes, AkInt32 &out_cRead)=0
bool WriteString(const wchar_t *in_pszString)
virtual AkInt32 Count() const =0
virtual AkUInt8 * Bytes() const =0
virtual void Clear()=0
Clear the buffer contents.
Tell us about your project. We're here to help.
Register your project and we'll help you get started with no strings attached!
Get started with Wwise