/[projects]/smsdaemon/plugins/createskeleton.sh
ViewVC logotype

Annotation of /smsdaemon/plugins/createskeleton.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (hide annotations) (download) (as text)
Wed Jun 11 11:05:03 2008 UTC (15 years, 11 months ago) by torben
File MIME type: application/x-sh
File size: 1212 byte(s)
Adopt skeleton creator to IGsmModem interface.

1 torben 37 #!/bin/bash
2    
3     if [ "$1" == "" ] ; then
4     echo "Usage: $0 <ClassName>"
5     exit
6     fi
7    
8     CLASS="$1Plugin"
9     CLASSUP=`echo $CLASS | tr [:lower:] [:upper:]`
10 torben 41 CLASSLO=`echo $1 | tr [:upper:] [:lower:]`
11 torben 37
12     HEADER="$CLASS.h"
13     CPP="$CLASS.cpp"
14    
15    
16     # create header file
17     echo -n "#ifndef __" > $HEADER
18     echo -n $CLASSUP >> $HEADER
19     echo "_H__" >> $HEADER
20     echo -n "#define __" >> $HEADER
21     echo -n $CLASSUP >> $HEADER
22     echo -e "_H__\n\n" >> $HEADER
23    
24     echo -e "#include \"Plugin.h\"\n\n" >> $HEADER
25     echo "class $CLASS : public Plugin" >> $HEADER
26     echo "{" >> $HEADER
27     echo "public:" >> $HEADER
28     echo -e "\t$CLASS();\n" >> $HEADER
29 torben 51 echo -e "\tvirtual void Execute(IGsmModem& modem, SMS& sms);\n" >> $HEADER
30 torben 37 echo -e "\tvirtual ~$CLASS() {}\n" >> $HEADER
31     echo -e "};\n\n" >> $HEADER
32     echo -n "#endif // __" >> $HEADER
33     echo -n $CLASSUP >> $HEADER
34     echo "_H__" >> $HEADER
35    
36     #create implementation file
37     echo "#include \"$HEADER\"" > $CPP
38     echo -e "#include \"GsmModem.h\"\n" >> $CPP
39    
40     echo "$CLASS::$CLASS()" >> $CPP
41     echo " : Plugin(\"$CLASSLO\", \"<insert description>\")" >> $CPP
42     echo "{" >> $CPP
43     echo -e "}\n" >> $CPP
44    
45 torben 51 echo "void $CLASS::Execute(IGsmModem& modem, SMS& sms)" >> $CPP
46 torben 37 echo "{" >> $CPP
47     echo -e "\t//Add Implementation" >> $CPP
48     echo "}" >> $CPP

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20