summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/fileio.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-19 23:01:02 +0000
committerKarl Berry <karl@freefriends.org>2021-02-19 23:01:02 +0000
commit3a51e8f2c9453f4c9207f1a515b25e7fc158a51a (patch)
tree13d75243fd97dd968c5c3923e46536cff6f3a3a9 /Build/source/utils/asymptote/fileio.h
parent099071cc369e537c2dc2892dd3be17a9553ad78b (diff)
asy 2.69 sources
git-svn-id: svn://tug.org/texlive/trunk@57802 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/fileio.h')
-rw-r--r--Build/source/utils/asymptote/fileio.h13
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();