File: newclass

package info (click to toggle)
rosegarden 1%3A25.12-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 42,888 kB
  • sloc: cpp: 209,189; xml: 6,580; sh: 1,608; perl: 755; python: 416; ansic: 324; lisp: 139; ruby: 33; makefile: 20
file content (32 lines) | stat: -rwxr-xr-x 576 bytes parent folder | download | duplicates (9)
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
#!/bin/bash
#
# newclass
#
# Copyright (c) 2009  D. Michael McIntyre <rosegarden.trumpeter@gmail.com>
# Released under the GPL
#
# REQUIRES: having your butt plonked in a rosegarden/ directory
#
#
# PURPOSE: to automate copying the template files out to make a new class from
# scratch
#

cpp=$1.cpp
h=$1.h
name=$(basename $1)
NAME=$(echo $name | gawk '{print toupper($0)}')

cp -v templates/template.cpp $cpp

cp -v templates/template.h $h

replace TEMPLATE $NAME $cpp
replace TEMPLATE $NAME $h

replace Template $name $cpp
replace Template $name $h

svn add $cpp $h

exit 0