Line | |
---|
1 | #include "dxstdafx.h"
|
---|
2 | #include ".\l.h"
|
---|
3 |
|
---|
4 | L::L(void)
|
---|
5 | {
|
---|
6 | wide = NULL;
|
---|
7 | }
|
---|
8 |
|
---|
9 | L::~L(void)
|
---|
10 | {
|
---|
11 | }
|
---|
12 |
|
---|
13 | wchar_t* L::operator+(const char* multi)
|
---|
14 | {
|
---|
15 | if(wide)
|
---|
16 | delete wide;
|
---|
17 | wide = new wchar_t[nWide = MultiByteToWideChar(CP_ACP, 0, multi, -1, NULL, 0)];
|
---|
18 | MultiByteToWideChar(CP_ACP, 0, multi, -1, wide, nWide);
|
---|
19 | return wide;
|
---|
20 | }
|
---|
21 |
|
---|
22 | L L::l;
|
---|
23 |
|
---|
24 | wchar_t* L::clone(const char* multi)
|
---|
25 | {
|
---|
26 | l+multi;
|
---|
27 | wchar_t* ret = new wchar_t[wcslen(l.wide)+1];
|
---|
28 | wcscpy(ret, l.wide);
|
---|
29 | return ret;
|
---|
30 | }
|
---|
31 |
|
---|
32 | wchar_t* L::cloneW(const wchar_t* wide)
|
---|
33 | {
|
---|
34 | wchar_t* ret = new wchar_t[wcslen(wide)+1];
|
---|
35 | wcscpy(ret, wide);
|
---|
36 | return ret;
|
---|
37 | }
|
---|
38 |
|
---|
39 | LC::LC(void)
|
---|
40 | {
|
---|
41 | narrow = NULL;
|
---|
42 | }
|
---|
43 |
|
---|
44 | LC::~LC(void)
|
---|
45 | {
|
---|
46 | }
|
---|
47 |
|
---|
48 | char* LC::operator-(const wchar_t* wide)
|
---|
49 | {
|
---|
50 | if(narrow)
|
---|
51 | delete narrow;
|
---|
52 | narrow = new char[nNarrow = WideCharToMultiByte(CP_ACP, 0, wide, -1, NULL, 0, NULL, NULL)];
|
---|
53 | WideCharToMultiByte(CP_ACP, 0, wide, -1, narrow, nNarrow, NULL, NULL);
|
---|
54 | return narrow;
|
---|
55 | }
|
---|
56 |
|
---|
57 | LC LC::c;
|
---|
58 |
|
---|
59 | char* LC::clone(const wchar_t* wide)
|
---|
60 | {
|
---|
61 | c-wide;
|
---|
62 | char* ret = new char[strlen(c.narrow)+1];
|
---|
63 | strcpy(ret, c.narrow);
|
---|
64 | return ret;
|
---|
65 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.