Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / etc / srecode / cpp.srt
blobc75fafcabd7563253d4ffa1b838203fe5a41210e
1 ;;; cpp.srt --- SRecode templates for c++-mode
3 ;; Copyright (C) 2007-2014 Free Software Foundation, Inc.
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
7 ;; This file is part of GNU Emacs.
9 ;; GNU Emacs is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; GNU Emacs is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
22 set mode "c++-mode"
24 set comment_start  "/**"
25 set comment_end    " */"
26 set comment_prefix " *"
28 context declaration
30 template class :indent :blank
31 "Insert a C++ class.  For use by user insertion.
32 Override this template to change contents of a class.
33 Override `class-tag' to override the outer structure of the class."
34 ----
35 {{<A:class-tag}}
36    public:
37      {{>CONSTRUCTOR:classdecl:constructor-tag}}
38      {{>DESTRUCTOR:classdecl:destructor-tag}}
39    private:
40    {{^}}
42 {{/A}}
43 ----
45 template subclass :indent :blank
46 "Insert a C++ subclass of some other class."
47 sectiondictionary "PARENTS"
48 set NAME "?PARENTNAME"
49 ----
50 {{>A:class}}
51 ----
53 template class-tag :indent :blank
54 "Insert a C++ class with the expectation of it being used by a tag inserter.
55 Override this to affect applications, or the outer class structure for
56 the user-facing template."
57 ----
58 class {{?NAME}} {{#PARENTS}}{{#FIRST}}: {{/FIRST}}public {{NAME}}{{/PARENTS}}
59 {     
60    {{^}}
62 ----
63 bind "c"
65 template method :indent :blank
66 "Method belonging to some class, declared externally."
67 ----
68 {{?TYPE}} {{?PARENT}}::{{?NAME}}{{>:misc:arglist}}
69 {{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
71 {{^}}
73 ----
75 context classdecl
77 template constructor-tag :indent :blank
78 ----
79 {{?NAME}}{{>:misc:arglist}}
80 { {{^}} }
81 ----
83 ;; This one really sucks.  How can I finish it?
84 template initializers :indent
85 ----
86 {{#FIRST}}:
87 {{/FIRST}}{{INITNAME}}(){{#NOTLAST}},{{/NOTLAST}}
88 ----
90 template destructor-tag :indent :blank
91 ----
92 ~{{?NAME}}{{>:misc:arglist}}
93 { {{^}} }
94 ----
96 ;;; Base Comment functions for overriding.
97 context classdecl
99 template comment-function-group-start :indent :blank
100 "Used for putting comments in front of a functional group of declarations.
101 Override this with your own preference to avoid using doxygen."
102 ----
103 {{>A:classdecl:doxygen-function-group-start}}
104 ----
106 template comment-function-group-end :indent :blank
107 "Used for putting comments in front of a functional group of declarations.
108 Override this with your own preference to avoid using doxygen."
109 ----
110 {{>A:classdecl:doxygen-function-group-end}}
111 ----
113 ;;; DOXYGEN FEATURES
114 ;; 
116 context classdecl
118 prompt GROUPNAME "Name of declaration group: "
120 template doxygen-function-group-start :indent :blank
121 ----
123  * {{?GROUPNAME}}
124  * @{
125  */
127 ----
129 template doxygen-function-group-end :indent :blank
130 ----
132  * @}
133  */
135 ----
137 ;; end