1 (defun swg-comment-block ()
2 "Insert an empty comment block, in the Javadoc style."
6 (insert " * @param \n")
7 (insert " * @return \n")
11 (defun swg-single-line ()
12 "Insert a line of dashes, for separating functions or sections of a file."
14 (insert "// ----------------------------------------------------------------------\n"))
16 (defun swg-double-line ()
17 "Insert a line of equals, for separating functions or sections of a file."
19 (insert "// ======================================================================\n"))
21 (defun swg-new-source ()
22 "Add template for a new source file. Assumes filename ends in .cpp"
24 (let* ((bufname (buffer-name (current-buffer)))
25 (chopname (substring bufname
0 -
4)))
28 (insert (concat "// " (buffer-name (current-buffer)) "\n"))
29 (insert "// copyright (c) 2004 Sony Online Entertainment\n")
33 (insert "#include \"FirstGame.h\"\n")
34 (insert (concat "#include \"" chopname
".h\"\n"))
40 (defun swg-new-header ()
41 "Add template for a new header file. Assumes filename ends in .h"
43 (let* ((bufname (buffer-name (current-buffer)))
44 (chopname (substring bufname
0 -
2)))
47 (insert (concat "// " bufname
"\n"))
48 (insert "// copyright (c) 2004 Sony Online Entertainment\n")
52 (insert (concat "#ifndef INCLUDED_" chopname
"_H\n"))
53 (insert (concat "#define INCLUDED_" chopname
"_H\n"))
61 (defun swg-insert-classname ()
62 "Insert the likely classname (based on the current filename)"
64 (let* ((bufname (buffer-name (current-buffer)))
65 (chopname (substring bufname
0 -
4)))
68 (defun swg-new-class (classname)
69 "Template to create a new class declaration"
70 (interactive "sClassName: ")
71 (insert (concat "class " classname
"\n"))
79 "Run Lint on the current buffer."
81 (let (old-command compile-command
)
82 (compile (concat "swglint.sh " (buffer-file-name)))
83 (setq compile-command old-command
)))
85 (defun swg-perforce-comment (reviewedby keyfrom
)
86 "Create a Perforce checkin description with all the necessary tags"
87 (interactive "sReviewed by: \nsKey from: ")
88 (insert "\t[key-from ")
91 (call-process "getP4KeyFrom.pl" nil t nil keyfrom
)
92 (delete-backward-char 1)
94 (insert "\t[internal]\n")
96 (insert "\t[public]\n")
98 (insert "\t[testplan]\n")
100 (insert (concat "\t[reviewed-by " reviewedby
"]\n"))
101 (insert "\t[linted]\n")