diff options
author | DaMichel <mw.pub@welter-4d.de> | 2016-07-29 11:36:21 +0200 |
---|---|---|
committer | DaMichel <mw.pub@welter-4d.de> | 2016-07-29 11:40:21 +0200 |
commit | 884b3f013045d60d586c55338a76feb4dfa30c9b (patch) | |
tree | 4ddfd6a4aa827d75be86afb1792b2375e491bc4b /opentrack-logic/tracklogger.cpp | |
parent | 7b3be452b6be528de753a1a633a3aacdb11be86c (diff) |
track logging: why not write proper csv with COMMA separated lists! Also write proper header.
Diffstat (limited to 'opentrack-logic/tracklogger.cpp')
-rw-r--r-- | opentrack-logic/tracklogger.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/opentrack-logic/tracklogger.cpp b/opentrack-logic/tracklogger.cpp index 5e4cf4f9..f007c2bc 100644 --- a/opentrack-logic/tracklogger.cpp +++ b/opentrack-logic/tracklogger.cpp @@ -1,22 +1,27 @@ #include "tracklogger.hpp" #include "tracker.h" - + +void TrackLoggerCSV::handle_first_col_sep() +{ + if (!first_col) + out.put(','); + first_col = false; +} void TrackLoggerCSV::write(const char *s) { + handle_first_col_sep(); out << s; } void TrackLoggerCSV::write(const double *p, int n) { - if (!first_col) - out.put(';'); - first_col = false; + handle_first_col_sep(); for (int i = 0; i < n-1; ++i) { out << p[i]; - out.put(';'); + out.put(','); } out << p[n-1]; } |