blob: 88583265fd226bec9e08256bcab38fa06349d787 (
plain) (
blame)
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
|
#include "precomp_wasabi_bfc.h"
#include "playstring.h"
#define USE_TABLE
Playstring::Playstring(const wchar_t *_val) {
val = NULL;
setValue(_val);
}
Playstring::Playstring(const Playstring &ps) {
val = NULL;
setValue(ps.getValue());
}
Playstring::~Playstring() {
setValue(NULL);
}
void Playstring::setValue(const wchar_t *newval) {
_setValue(newval, 0);
}
void Playstring::_setValue(const wchar_t *newval, int tablenum)
{
#ifdef USE_TABLE
#ifdef WASABI_COMPILE_METADB
if (val != NULL) WASABI_API_METADB->metadb_releasePlaystring(val, tablenum);
#else
FREE((void*)val);
#endif
#else
FREE((void*)val);
#endif
val = NULL;
if (newval != NULL /*&& *newval != 0*/) {
#ifdef USE_TABLE
#ifdef WASABI_COMPILE_METADB
val = WASABI_API_METADB->metadb_dupPlaystring(newval, tablenum);
#else
val = WCSDUP(newval);
#endif
#else
val = STRDUP(newval);
#endif
}
}
Playstring& Playstring::operator =(const Playstring &ps) {
if (this != &ps) {
setValue(ps.getValue());
}
return *this;
}
|