aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-12 16:34:11 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-12 16:34:11 +0000
commitcd1b733f8633ddc2c599bd7a84902c40720fddab (patch)
tree2a6d277c1912f23300157c846b2c40a98998190d /misc
parent18c1ceed03e53ce9273482867ef9697b46dcc9b0 (diff)
downloadpaludis-cd1b733f8633ddc2c599bd7a84902c40720fddab.tar.gz
paludis-cd1b733f8633ddc2c599bd7a84902c40720fddab.tar.xz
Let VersionMetadata interfaces access the base class
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/make_sr.bash70
1 files changed, 52 insertions, 18 deletions
diff --git a/misc/make_sr.bash b/misc/make_sr.bash
index 7193bce..20c7b75 100755
--- a/misc/make_sr.bash
+++ b/misc/make_sr.bash
@@ -40,6 +40,7 @@ while read a ; do
want_visible=
want_keys=( )
want_key_types=( )
+ want_inherit=( )
want_comparison_operators=
want_comparison_fields=( )
@@ -68,6 +69,11 @@ while read a ; do
:
}
+ inherit()
+ {
+ want_inherit=( "${want_inherit[@]}" "$1" )
+ }
+
key()
{
want_keys=( "${want_keys[@]}" "$1" )
@@ -102,6 +108,11 @@ while read a ; do
:
}
+ inherit()
+ {
+ :
+ }
+
comparison_operators()
{
:
@@ -130,10 +141,25 @@ while read a ; do
if [[ "${what_to_make}" == "--header" ]] ; then
if [[ -z ${want_visible} ]] ; then
- echo "class ${a}"
+ echo -n "class ${a}"
+ else
+ echo -n "class PALUDIS_VISIBLE ${a}"
+ fi
+
+ if [[ 0 != "${#want_inherit[@]}" ]] ; then
+ echo " :"
+ for (( k = 0 ; k < ${#want_inherit[@]} ; k++ )) ; do
+ echo -n " ${want_inherit[${k}]}"
+ if [[ ${k} == $(( ${#want_inherit[@]} - 1 )) ]] ; then
+ echo
+ else
+ echo ","
+ fi
+ done
else
- echo "class PALUDIS_VISIBLE ${a}"
+ echo
fi
+
echo "{"
echo " public:"
echo
@@ -282,7 +308,7 @@ while read a ; do
echo " */"
echo " template <"
for (( k = 0 ; k < ${#want_keys[@]} ; k++ )) ; do
- echo -n " bool has_${want_keys[${k}]}_"
+ echo -n " bool has_${want_keys[${k}]}_ = true"
if [[ $(( ${k} + 1 )) -lt ${#want_keys[@]} ]] ; then
echo ","
else
@@ -381,21 +407,6 @@ while read a ; do
echo " {"
echo " }"
echo
- echo " operator ${a} () const"
- echo " {"
- echo " return ${a}("
- for (( k = 0 ; k < ${#want_keys[@]} ; k++ )) ; do
- echo -n " this->${want_keys[${k}]}"
- if [[ $(( ${k} + 1 )) -lt ${#want_keys[@]} ]] ; then
- echo ", "
- else
- echo
- fi
- done
-
- echo " );"
- echo " }"
- echo
echo " ///\}"
echo
echo " };"
@@ -414,6 +425,29 @@ while read a ; do
echo "#endif"
fi
+ if [[ -n "${want_named_args}" ]] ; then
+ echo " ${a}(const Params<"
+ for (( k = 0 ; k < ${#want_keys[@]} ; k++ )) ; do
+ echo -n " true"
+ if [[ $(( ${k} + 1 )) -lt ${#want_keys[@]} ]] ; then
+ echo ","
+ else
+ echo "> & params) :"
+ fi
+ done
+ for (( k = 0 ; k < ${#want_keys[@]} ; k++ )) ; do
+ echo -n " ${want_keys[${k}]}(params.${want_keys[${k}]})"
+ if [[ $(( ${k} + 1 )) -lt ${#want_keys[@]} ]] ; then
+ echo ","
+ else
+ echo
+ fi
+ done
+ echo " {"
+ echo " }"
+ echo
+ fi
+
echo "};"
elif [[ "${what_to_make}" == "--source" ]] ; then