author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /scripts/q_add_class | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
-rwxr-xr-x | scripts/q_add_class | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/scripts/q_add_class b/scripts/q_add_class new file mode 100755 index 0000000..6146e1e --- a/dev/null +++ b/scripts/q_add_class | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Script to add a new class to an existing application | ||
4 | # | ||
5 | # Copyright 1999-2000 Trolltech AS. All rights reserved. | ||
6 | # | ||
7 | |||
8 | |||
9 | # load the helper functions | ||
10 | . q_functions | ||
11 | |||
12 | |||
13 | if [ $# -lt 2 ] | ||
14 | then | ||
15 | echo "Usage: q_add_class ExistingAppName NewClassName" | ||
16 | print_example_usage | ||
17 | exit | ||
18 | fi | ||
19 | |||
20 | |||
21 | EXISTING_APP_NAME=$1 | ||
22 | NEW_CLASS_NAME=$2 | ||
23 | |||
24 | |||
25 | NEW_CLASS_NAME_LOWER=`echo $NEW_CLASS_NAME | tr [A-Z] [a-z]` | ||
26 | NEW_CLASS_HEADER_FILE="$NEW_CLASS_NAME_LOWER".h | ||
27 | NEW_CLASS_SOURCE_FILE="$NEW_CLASS_NAME_LOWER".cpp | ||
28 | NEW_CLASS_HEADER_DEFINE=__`echo $NEW_CLASS_NAME | tr [a-z] [A-Z]`_H__ | ||
29 | EXISTING_PRO_FILE="$EXISTING_APP_NAME".pro | ||
30 | |||
31 | |||
32 | print_source_file>> $NEW_CLASS_SOURCE_FILE | ||
33 | print_header_file>> $NEW_CLASS_HEADER_FILE | ||
34 | add_class_to_pro_file>> $EXISTING_PRO_FILE | ||
35 | |||
36 | |||