1 ;;; cpp.srt --- SRecode templates for c++-mode
3 ;; Copyright (C) 2007-2012 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/>.
24 set comment_start "/**"
26 set comment_prefix " *"
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."
37 {{>CONSTRUCTOR:classdecl:constructor-tag}}
38 {{>DESTRUCTOR:classdecl:destructor-tag}}
45 template subclass :indent :blank
46 "Insert a C++ subclass of some other class."
47 sectiondictionary "PARENTS"
48 set NAME "?PARENTNAME"
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."
58 class {{?NAME}} {{#PARENTS}}{{#FIRST}}: {{/FIRST}}public {{NAME}}{{/PARENTS}}
65 template method :indent :blank
66 "Method belonging to some class, declared externally."
68 {{?TYPE}} {{?PARENT}}::{{?NAME}}{{>:misc:arglist}}
69 {{#INITIALIZERS}}{{>B:initializers}}{{/INITIALIZERS}}
77 template constructor-tag :indent :blank
79 {{?NAME}}{{>:misc:arglist}}
83 ;; This one really sucks. How can I finish it?
84 template initializers :indent
87 {{/FIRST}}{{INITNAME}}(){{#NOTLAST}},{{/NOTLAST}}
90 template destructor-tag :indent :blank
92 ~{{?NAME}}{{>:misc:arglist}}
96 ;;; Base Comment functions for overriding.
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."
103 {{>A:classdecl:doxygen-function-group-start}}
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."
110 {{>A:classdecl:doxygen-function-group-end}}
118 prompt GROUPNAME "Name of declaration group: "
120 template doxygen-function-group-start :indent :blank
129 template doxygen-function-group-end :indent :blank