-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.json
More file actions
70 lines (69 loc) · 2.22 KB
/
cpp.json
File metadata and controls
70 lines (69 loc) · 2.22 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
{
"Orthodox Canonical Form Header": {
"prefix": "ocfh",
"body": [
"#ifndef ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_HPP",
"# define ${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_HPP",
"",
"# include <iostream>",
"# include <string>",
"",
"class ${TM_FILENAME_BASE}",
"{",
" private:",
" /*args*/",
" public:",
" ${TM_FILENAME_BASE}();",
" ~${TM_FILENAME_BASE}();",
" ${TM_FILENAME_BASE}(const ${TM_FILENAME_BASE}& copy);",
" ${TM_FILENAME_BASE}& operator=(const ${TM_FILENAME_BASE}& copy);",
"};",
"",
"#endif /*${TM_FILENAME_BASE/(.*)/${1:/upcase}/}_HPP*/"
],
"description": "Orthodox Canonical Form for a headerfile"
},
"Orthodox Canonical Form CPP": {
"prefix": "ocfp",
"body": [
"#include \"${TM_FILENAME_BASE}.hpp\"",
"",
"/* -------------------------------------------------------------------------- */",
"/* Orthodox Canonical Form */",
"/* -------------------------------------------------------------------------- */",
"",
"${TM_FILENAME_BASE}::${TM_FILENAME_BASE}()",
"{",
" std::cout << \"${TM_FILENAME_BASE} Default Constructor called\" << std::endl;",
"}",
"",
"${TM_FILENAME_BASE}::~${TM_FILENAME_BASE}()",
"{",
" std::cout << \"${TM_FILENAME_BASE} Default Destructor called\" << std::endl;",
"}",
"",
"${TM_FILENAME_BASE}::${TM_FILENAME_BASE}(const ${TM_FILENAME_BASE}& copy)",
"{",
" std::cout << \"${TM_FILENAME_BASE} Copy Constructor called\" << std::endl;",
" if (this != ©)",
" {",
" }",
"}",
"",
"${TM_FILENAME_BASE}&\t${TM_FILENAME_BASE}::operator=(const ${TM_FILENAME_BASE} ©)",
"{",
" std::cout << \"${TM_FILENAME_BASE} Copy Assignment called\" << std::endl;",
" if (this != ©)",
" {",
" }",
" return (*this);",
"}",
"",
"/* -------------------------------------------------------------------------- */",
"/* Functions */",
"/* -------------------------------------------------------------------------- */",
""
],
"description": "Orthodox Canonical Form for a cpp file"
}
}