]> mj.ucw.cz Git - paperjam.git/blobdiff - jam.h
Arg reform
[paperjam.git] / jam.h
diff --git a/jam.h b/jam.h
index d5db7c5e4754786d5addf92c70c9baf473f03097..dddaa81fb3e669416b527d44a12fdc0fd73c7c9c 100644 (file)
--- 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 "<undef>"; }
 };