-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunicode_log.cpp
More file actions
66 lines (53 loc) · 1.09 KB
/
unicode_log.cpp
File metadata and controls
66 lines (53 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "unicode_log.h"
#include <qtextcodec.h>
// -------------------------------------------------------
// -------- WGUnicodeLog
// -------------------------------------------------------
WGUnicodeLog::WGUnicodeLog(): QStringList()
{
}
WGUnicodeLog::~WGUnicodeLog()
{
unicode_clear();
}
unsigned int WGUnicodeLog::unicode_count() const
{
return size();
}
QString& WGUnicodeLog::unicode_at( unsigned int index )
{
return *at( index );
}
QString& WGUnicodeLog::unicode_last()
{
return back();
}
QString& WGUnicodeLog::native_at( unsigned int index )
{
return *native.at( index );
}
QString& WGUnicodeLog::native_last()
{
return native.back();
}
void WGUnicodeLog::unicode_append( QString str )
{
push_back( QTextCodec::codecForLocale()->toUnicode( str ) );
native.push_back( str );
}
void WGUnicodeLog::unicode_append( const char* str )
{
QString s = str;
unicode_append( s );
}
void WGUnicodeLog::unicode_remove_last()
{
if ( !unicode_count() ) return;
erase( at(size()-1) );
native.erase( native.at(native.size()-1) );
}
void WGUnicodeLog::unicode_clear()
{
clear();
native.clear();
}