summaryrefslogtreecommitdiff
path: root/graphics/asymptote/fileio.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/fileio.h')
-rw-r--r--graphics/asymptote/fileio.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/graphics/asymptote/fileio.h b/graphics/asymptote/fileio.h
index 0e04088a9f..de7090b4cb 100644
--- a/graphics/asymptote/fileio.h
+++ b/graphics/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();