OpenBarnyard
Loading...
Searching...
No Matches
TError.cpp
Go to the documentation of this file.
1
#include "ToshiPCH.h"
2
#include "
TError.h
"
3
4
//-----------------------------------------------------------------------------
5
// Enables memory debugging.
6
// Note: Should be the last include!
7
//-----------------------------------------------------------------------------
8
#include "
Core/TMemoryDebugOn.h
"
9
10
Toshi::TError::TError(
TUINT32
size1,
TUINT32
size2 )
11
{
12
m_size1
= size1;
13
m_size2
= size2;
14
m_Buffer1
=
new
TCHAR
[ size1 ];
15
m_Buffer2
=
new
TINT
[ size2 ];
16
m_currentSize
= 0;
17
m_currentSize2
= 0;
18
}
19
20
Toshi::TError::~TError()
21
{
22
delete
[]
m_Buffer1
;
23
delete
[]
m_Buffer2
;
24
}
25
26
void
Toshi::TError::AddError(
const
TCHAR
* error, ... )
27
{
28
if
(
m_currentSize2
<
m_size2
&&
m_currentSize
<
m_size1
)
29
{
30
m_Buffer2
[
m_currentSize2
] =
m_currentSize
;
31
32
va_list args;
33
34
va_start( args, error );
35
36
TCHAR
str[ 0x400 ];
37
38
T2String8::Format
( str,
sizeof
( str ), error, args );
39
40
TSIZE
size = strlen( str );
41
42
if
( size +
m_currentSize
<=
m_size1
&&
TUtil::MemCopy
(
m_Buffer1
+
m_currentSize
, str, size ) )
43
{
44
m_currentSize2
++;
45
m_currentSize
+= size + 1;
46
}
47
}
48
}
TMemoryDebugOn.h
TError.h
TSIZE
size_t TSIZE
Definition
Typedefs.h:9
TCHAR
char TCHAR
Definition
Typedefs.h:20
TUINT32
uint32_t TUINT32
Definition
Typedefs.h:13
TINT
int TINT
Definition
Typedefs.h:7
T2String8::Format
static TINT Format(TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat,...)
Definition
T2String8.cpp:41
TError::m_size1
TUINT32 m_size1
Definition
TError.h:15
TError::m_currentSize2
TUINT32 m_currentSize2
Definition
TError.h:19
TError::m_Buffer2
TINT * m_Buffer2
Definition
TError.h:16
TError::m_currentSize
TUINT32 m_currentSize
Definition
TError.h:18
TError::m_Buffer1
TCHAR * m_Buffer1
Definition
TError.h:14
TError::m_size2
TUINT32 m_size2
Definition
TError.h:17
TUtil::MemCopy
static void * MemCopy(void *dst, const void *src, TSIZE size)
Definition
TUtil.h:90
D:
_dev
OpenBarnyard
Source
Toshi
Source
Toshi
TError.cpp
Generated by
1.13.2