-
Notifications
You must be signed in to change notification settings - Fork 1
/
stdafx.h
134 lines (113 loc) · 3.04 KB
/
stdafx.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#pragma once
#define WIN32_LEAN_AND_MEAN
#define VC_EXTRALEAN
#include <windows.h>
#include <stdint.h>
#include <algorithm>
#include <cstring>
#include <direct.h>
#include <fstream>
#include <iostream>
#include <map>
#include <set>
#include <shellapi.h>
#include <sstream>
#include <stdio.h>
#include <string>
#include <sys/stat.h>
#include <sys/timeb.h>
#include <sys/types.h>
#include <time.h>
#include <vector>
#include <regex>
#include <wx/wx.h>
#include <wx/msw/private.h>
#include <wx/artprov.h>
#include <wx/bitmap.h>
#include <wx/bmpbuttn.h>
#include <wx/button.h>
#include <wx/clipbrd.h>
#include <wx/cmdline.h>
#include <wx/dnd.h>
#include <wx/evtloop.h>
#include <wx/image.h>
#include <wx/msw/dialog.h>
#include <wx/msw/private.h>
#include <wx/panel.h>
#include <wx/ptr_scpd.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/taskbar.h>
#include <wx/toplevel.h>
#include <wx/stdpaths.h>
#include <wx/filename.h>
#include <wx/xml/xml.h>
#ifdef PROFILE
#include "Superluminal/PerformanceAPI.h"
#define SCOPE_EVENT(STR) PERFORMANCEAPI_INSTRUMENT(STR)
#else
#define SCOPE_EVENT(STR)
#endif // PROFILE
#ifdef _UNICODE
typedef wchar_t tchar_t;
#else
typedef char tchar_t;
#endif
typedef std::basic_string< tchar_t > tstring;
typedef std::basic_istream< tchar_t, std::char_traits< tchar_t > > tistream;
typedef std::basic_ostream< tchar_t, std::char_traits< tchar_t > > tostream;
typedef std::basic_iostream< tchar_t, std::char_traits< tchar_t > > tiostream;
typedef std::basic_ifstream< tchar_t, std::char_traits< tchar_t > > tifstream;
typedef std::basic_ofstream< tchar_t, std::char_traits< tchar_t > > tofstream;
typedef std::basic_fstream< tchar_t, std::char_traits< tchar_t > > tfstream;
typedef std::basic_istringstream< tchar_t, std::char_traits< tchar_t >, std::allocator< tchar_t > > tistringstream;
typedef std::basic_ostringstream< tchar_t, std::char_traits< tchar_t >, std::allocator< tchar_t > > tostringstream;
typedef std::basic_stringstream< tchar_t, std::char_traits< tchar_t >, std::allocator< tchar_t > > tstringstream;
typedef std::basic_regex<tchar_t, std::regex_traits<tchar_t> > tregex;
typedef std::match_results<const tchar_t*> tcmatch;
typedef std::match_results<tstring::const_iterator> tsmatch;
typedef std::regex_token_iterator< const tchar_t*> tcregex_token_iterator;
typedef std::regex_token_iterator< tstring::const_iterator> tsregex_token_iterator;
typedef std::regex_iterator< const tchar_t* > tcregex_iterator;
typedef std::regex_iterator< tstring::const_iterator > tsregex_iterator;
int OutputDebugFormat(const char* format, ...);
int OutputDebugFormat(const wchar_t* format, ...);
template< class T >
class AutoFreePointer
{
public:
AutoFreePointer()
: m_Pointer(nullptr)
{
}
AutoFreePointer(T* pointer)
: m_Pointer(pointer)
{
}
~AutoFreePointer()
{
if (m_Pointer)
{
free(m_Pointer);
}
}
T* operator=(T* pointer)
{
if (m_Pointer)
{
free(m_Pointer);
}
m_Pointer = pointer;
return m_Pointer;
}
T* operator->()
{
return m_Pointer;
}
operator T* ()
{
return m_Pointer;
}
private:
T* m_Pointer;
};