aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/vespa/searchcore/proton/create-base.sh
blob: 92d129425a2c659c0375ba1416acbad23597b921 (plain) (blame)
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
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
module="proton"

if [ $# -lt 1 ]; then
	echo "Code generation script for the $module module"
	echo ""
	echo "usage: $0 <class or interface name>"
	echo ""
	echo "Generates class files or interface files"
	echo "depending on which script was invoked."
	echo ""
	echo "The current directory is used to generate"
	echo "appropriate include guards."
	echo ""
	echo "Generated code is written to stdout."
	echo ""
	exit 1
fi

class=$1
name=`echo $class | tr 'A-Z' 'a-z'`
prefix=`pwd | sed -e "s|.*/${module}||" | tr '/' '_'`
guard=`echo H_${module}${prefix}_${class}_H | tr 'a-z' 'A-Z'`
ns_open="namespace $module {"
ns_close="} // namespace $module"

cat <<EOF
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

EOF