X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=jam.h;h=dddaa81fb3e669416b527d44a12fdc0fd73c7c9c;hb=33a127c6d1e89d83af157f260fb26f475603df6b;hp=d5db7c5e4754786d5addf92c70c9baf473f03097;hpb=233f87f9c95f14ef4ddd5ac36cb8c3389501f99b;p=paperjam.git diff --git a/jam.h b/jam.h index d5db7c5..dddaa81 100644 --- a/jam.h +++ b/jam.h @@ -15,6 +15,7 @@ struct cmd; enum arg_type { AT_STRING, + AT_INT, AT_DOUBLE, AT_DIMEN, AT_TYPE_MASK = 0xffff, @@ -30,10 +31,9 @@ struct arg_def { class arg_val { public: virtual bool given() { return false; } - explicit virtual operator double() { abort(); } - explicit virtual operator string() { abort(); } - double double_default(double def) { return given() ? (double) *this : def; } - const string string_default(const string def) { return given() ? (string) *this : def; } + int as_int(int def) { return def; } + double as_double(double def) { return def; } + const string as_string(const string def) { return def; } virtual string dump() { return ""; } };