-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.tpl
More file actions
753 lines (635 loc) · 14.2 KB
/
cpp.tpl
File metadata and controls
753 lines (635 loc) · 14.2 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
a::n0:
!= 0
a::nn:
!= NULL
a::#d:
#define
a::#e:
#else
a::#en:
#endif
a:#if 0 ... #endif:#if:
#if 0
$selected$$end$
#endif
readme:
VA Snippet used by Surround With #ifdef.
Delete this item to restore the default upon next use.
a:#ifdef (VA):#if:
#ifdef $condition=_DEBUG$$end$
$selected$
#endif // $condition$
a:#ifdef ... #endif:#if:
#ifdef $end$
$selected$
#endif
a:#ifdef guard in a header::
#ifndef $FILE_BASE$_h__
#define $FILE_BASE$_h__
$selected$
#endif // $FILE_BASE$_h__
a:#ifndef ... #endif:#ifn:
#ifndef $end$
$selected$
#endif
a::#im:
#import "$end$"
a::#im:
#import <$end$>
a::#in:
#include "$end$"
a:#include <stdio.h>:std:
#include <stdio.h>
$end$
a::#in:
#include <$end$>
a::#p:
#pragma
readme:
VA Snippet used by Surround With #region.
Delete this item to restore the default upon next use.
a:#region (VA):#r:
#pragma region $end$$regionName$
$selected$
#pragma endregion $regionName$
a::#u:
#undef
a::bas:
$BaseClassName$::$MethodName$($MethodArgs$);
readme:
Delete this item to restore the default when the IDE starts.
a:(...)::
($selected$)
a:/*Operation result*/:yx:
/*
ÔËÐнá¹û:
---------------------------------------------
$end$
---------------------------------------------
*/
a:/*time*/:time:
/*
$DATE$ $HOUR$:$MINUTE$:$SECOND$
ѧϰĿµÄ:
$end$
*/
a::/**:
/************************************************************************/
/* $end$ */
/************************************************************************/
a::/*-:
/*
* $end$
*/
a::///:
//////////////////////////////////////////////////////////////////////////
a:://-:
// $end$ [$MONTH$/$DAY$/$YEAR$ %USERNAME%]
a:_T():tc:
_T($end$)
a:_T(...)::
_T($selected$)$end$
a::sup:
__super::$MethodName$($MethodArgs$);
readme:
Delete this item to restore the default when the IDE starts.
a:{...}::
{
$end$$selected$
}
a::A:
ASSERT($end$)
a:atoi(...)::
atoi($selected$)$end$
a::b:
bool
a::class:
class $end$
{
public:
protected:
private:
};
a:class with prompt for name:class:
class $Class_name$
{
public:
$Class_name$();
~$Class_name$();
protected:
$end$
private:
};
a:DEFINE_GUID:guid:
// {$GUID_STRING$}
DEFINE_GUID($GUID_Name$,
$GUID_DEFINITION$);
a:Dialog procedure::
BOOL CALLBACK $end$ (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
{
}
return (TRUE);
case WM_CLOSE:
{
EndDialog(hDlg,0);
}
return (TRUE);
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDCANCEL:
{
SendMessage(hDlg, WM_CLOSE, 0, 0);
}
return (TRUE);
case IDOK:
{
}
return (TRUE);
}
return (FALSE);
}
return (FALSE);
}
a:do { ... } while ():do:
do
{
$selected$
} while ($end$);
a::DW:
DWORD
a:dynamic cast, run code on valid cast:dyna:
$New_type$ *$New_pointer$ = dynamic_cast<$New_type$ *>($Cast_this$);
if (NULL != $New_pointer$)
{
$end$
}
a::f:
false
a::F:
FALSE
a:File header detailed::
/********************************************************************
created: $DATE$
created: $DAY$:$MONTH$:$YEAR$ $HOUR$:$MINUTE$
filename: $FILE$
file path: $FILE_PATH$
file base: $FILE_BASE$
file ext: $FILE_EXT$
author: $Author$
purpose: $end$
*********************************************************************/
a::fl:
float
a:for(){***}:for:
for ($end$)
{
$selected$
}
a:for loop forward:forr:
for (int $Index$ = 0; $Index$ < $Length$ ; $Index$++)
{
$end$
}
a:for loop reverse:forr:
for (int $Index$ = $Length$ - 1; $Index$ >= 0 ; $Index$--)
{
$end$
}
a:getchar();:g:
getchar();
a:GUID IMPLEMENT_OLECREATE:guid:
// {$GUID_STRING$}
IMPLEMENT_OLECREATE($GUID_Class$, $GUID_ExternalName$,
$GUID_DEFINITION$);
a:GUID string:guid:
"{$GUID_STRING$}"
a:GUID struct instance:guid:
// {$GUID_STRING$}
static const GUID $GUID_InstanceName$ =
{ $GUID_STRUCT$ };
a::HA:
HANDLE
a::HI:
HINSTANCE
a::HR:
HRESULT
a::H:
HWND
a:IDL uuid:uuid:
uuid($GUID_STRING$)
a:if () { ... }:if:
if ($end$)
{
$selected$
}
a:if () { ... } else { }:if:
if ($end$)
{
$selected$
}
else
{
}
a:if () { } else { ... }::
if ($end$)
{
}
else
{
$selected$
}
a:int main(){...}:intm:
int main()
{
$end$
getchar();
return 0;
}
a::ll:
long long
a::LP:
LPARAM
a::LPB:
LPBYTE
a::LPC:
LPCTSTR
a::LPT:
LPTSTR
a::LR:
LRESULT
readme:
VA Snippet used by Surround With Namespace.
If you have modified this item, you may delete it to restore the default upon next use.
a:namespace (VA)::
namespace $end$
{
$selected$
}
a::N:
NULL
a:printf("");:p:
printf("$end$");
a:return 0;:r:
return 0;
a::struct:
struct $end$
{
};
a::switch:
switch ($end$)
{
case :
break;
}
a::switch:
switch ($end$)
{
$selected$
}
a::TC:
TCHAR
a::t:
true
a::T:
TRUE
a:try { ... } catch {} catch {} catch {}:try:
try
{
$selected$
}
catch (CMemoryException* e)
{
$end$
}
catch (CFileException* e)
{
}
catch (CException* e)
{
}
a:TRY { ... } CATCH {}:TRY:
TRY
{
$selected$
}
CATCH (CMemoryException, e)
{
$end$
}
END_CATCH
a::U:
UINT
a::UL:
ULONG
a::ui:
unsigned int
a::ul:
unsigned long
a::usi:
using namespace $end$;
a:while () { ... }:while:
while ($end$)
{
$selected$
}
a:Win32 standard application::
#include <windows.h>
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[] = TEXT ("$end$");
HWND hwnd;
MSG msg;
WNDCLASSEX wndclassex = {0};
wndclassex.cbSize = sizeof(WNDCLASSEX);
wndclassex.style = CS_HREDRAW | CS_VREDRAW;
wndclassex.lpfnWndProc = WndProc;
wndclassex.cbClsExtra = 0;
wndclassex.cbWndExtra = 0;
wndclassex.hInstance = hInstance;
wndclassex.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wndclassex.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclassex.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
wndclassex.lpszMenuName = NULL;
wndclassex.lpszClassName = szAppName;
wndclassex.hIconSm = wndclassex.hIcon;
if (!RegisterClassEx (&wndclassex))
{
MessageBox (NULL, TEXT ("RegisterClassEx failed!"), szAppName, MB_ICONERROR);
return 0;
}
hwnd = CreateWindowEx (WS_EX_OVERLAPPEDWINDOW,
szAppName,
TEXT ("WindowTitle"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
ShowWindow (hwnd, iCmdShow);
UpdateWindow (hwnd);
while (GetMessage (&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (message)
{
case WM_CREATE:
return (0);
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps);
TextOut (hdc, 0, 0, "A Window!", 27);
EndPaint (hwnd, &ps);
return (0);
case WM_DESTROY:
PostQuitMessage (0);
return (0);
}
return DefWindowProc (hwnd, message, wParam, lParam);
}
a:Window procedure::
LRESULT CALLBACK $end$ (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch (message)
{
case WM_CREATE:
return (0);
case WM_PAINT:
hdc = BeginPaint (hwnd, &ps);
EndPaint (hwnd, &ps);
return (0);
case WM_DESTROY:
PostQuitMessage (0);
return (0);
}
return DefWindowProc (hwnd, message, wParam, lParam);
}
a::W:
WORD
a::WP:
WPARAM
readme:
VA Snippet used for suggestions of type bool.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType bool::
true
false
readme:
VA Snippet used for suggestions of type BOOL.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType BOOL::
TRUE
FALSE
readme:
VA Snippet used for suggestions in class definitions.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType class::
public:
private:
protected:
virtual
void
bool
string
static
const
readme:
VA Snippet used for suggestions of type HANDLE.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType HANDLE::
INVALID_HANDLE_VALUE
NULL
readme:
VA Snippet used for suggestions of type HRESULT.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType HRESULT::
S_OK
S_FALSE
E_FAIL
E_NOTIMPL
E_OUTOFMEMORY
E_INVALIDARG
E_NOINTERFACE
E_UNEXPECTED
readme:
VA Snippet used for suggestions in loops.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType loop::
continue;
break;
readme:
VA Snippet used for suggestions in switch statements.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType switch::
case
default:
break;
readme:
VA Snippet used for suggestions of type VARIANT_BOOL.
If you have modified this item, you may delete it to restore the default upon next use.
a:SuggestionsForType VARIANT_BOOL::
VARIANT_TRUE
VARIANT_FALSE
readme:
VA Snippet used for refactoring: Create From Usage.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Class::
$end$class $ClassName$
{
public:
$ClassName$($ParameterList$) $colon$
$MemberInitializationList$
{
}
~$ClassName$()
{
}
protected:
private:
$MemberType$ m$MemberName$;
};
readme:
VA Snippet used for refactoring: Create From Usage.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Class (C)::
$end$struct $ClassName$
{
$ClassName$($ParameterList$)
{
$InitializeMember$;
}
$MemberType$ m$MemberName$;
};
readme:
VA Snippet used for refactoring: Create From Usage.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Class (Managed)::
$end$public ref class $ClassName$
{
public:
$ClassName$($ParameterList$) $colon$
$MemberInitializationList$
{
}
~$ClassName$()
{
}
protected:
private:
$MemberType$ m$MemberName$;
};
readme:
VA Snippet used for refactoring: Create From Usage.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Class (Platform)::
$end$namespace $NamespaceName$
{
public ref class $ClassName$
{
public:
$ClassName$($ParameterList$) $colon$
$MemberInitializationList$
{
}
~$ClassName$()
{
}
protected:
private:
$MemberType$ m$MemberName$;
};
}
readme:
VA Snippet used for refactoring: Create From Usage and Implement Interface.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Method Body::
throw std::logic_error("The method or operation is not implemented.");
readme:
VA Snippet used for refactoring: Create From Usage and Implement Interface.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Method Body (C)::
assert(!"The method or operation is not implemented.");
readme:
VA Snippet used for refactoring: Create From Usage and Implement Interface.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Method Body (Managed)::
throw gcnew System::NotImplementedException();
readme:
VA Snippet used for refactoring: Create From Usage and Implement Interface.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create From Usage Method Body (Platform)::
throw ref new Platform::NotImplementedException();
readme:
VA Snippet used for refactoring: Create File.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create Header File::
#pragma once
$body$$end$
readme:
VA Snippet used for refactoring: Change Signature, Create Implementation, and Move Implementation to Source File.
Delete this item to restore the default upon next use.
a:Refactor Create Implementation::
$SymbolType$ $SymbolContext$( $ParameterList$ ) $MethodQualifier$
{
$end$$MethodBody$
}
readme:
VA Snippet used for Create Implementation refactoring when used on member variables.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create Implementation for Member::
$SymbolType$ $SymbolContext$;
readme:
VA Snippet used for Create Implementation refactoring when used on member variables and the target is a header file.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create Implementation for Member (header file)::
__declspec(selectany) $SymbolType$ $SymbolContext$;
readme:
VA Snippet used for refactoring: Create File.
If you have modified this item, you may delete it to restore the default upon next use.
a:Refactor Create Source File::
#include "$FILE_BASE$.h"
$body$$end$
readme:
VA Snippet used for refactoring.
Delete this item to restore the default upon next use.
a:Refactor Document Method::
//************************************
// Method: $SymbolName$
// FullName: $SymbolContext$
// Access: $SymbolVirtual$$SymbolPrivileges$$SymbolStatic$
// Returns: $SymbolType$
// Qualifier: $MethodQualifier$
// Parameter: $MethodArg$
//************************************
readme:
VA Snippet used for refactoring.
Delete this item to restore the default upon next use.
a:Refactor Encapsulate Field::
$end$$SymbolType$ $GeneratedPropertyName$() const { return $SymbolName$; }
void $GeneratedPropertyName$($SymbolType$ val) { $SymbolName$ = val; }
readme:
VA Snippet used for refactoring.
Delete this item to restore the default upon next use.
a:Refactor Extract Method::
$end$$SymbolType$ $SymbolContext$( $ParameterList$ ) $MethodQualifier$
{
$MethodBody$
}