diff options
Diffstat (limited to 'Build/source/utils/asymptote/fileio.h')
-rw-r--r-- | Build/source/utils/asymptote/fileio.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/fileio.h b/Build/source/utils/asymptote/fileio.h index 0e04088a9fd..de7090b4cb4 100644 --- a/Build/source/utils/asymptote/fileio.h +++ b/Build/source/utils/asymptote/fileio.h @@ -84,7 +84,7 @@ protected: bool standard; // Standard input/output bool binary; // Read in binary mode. - bool nullfield; // Used to detect null fields in line mode and cvs mode. + bool nullfield; // Used to detect a null field in cvs mode. string whitespace; size_t index; // Terminator index. @@ -217,6 +217,15 @@ public: void ignoreComment(char&) {} template<class T> + void setDefault(T& val) { + val=T(); + } + + void setDefault(Int& val) { + val=vm::Undefined; + } + + template<class T> void read(T& val) { if(binary) Read(val); else { @@ -224,7 +233,7 @@ public: if(errorstream::interrupt) throw interrupted(); else { ignoreComment(val); - val=vm::Undefined; + setDefault(val); if(!nullfield) Read(val); csv(); |