diff -r 6bb7abecbe5c65886310eb694c6dabe8cbb7aaf3 -r 7518b6265aa01bc33e8ad80cf578314593acab38 include/csvpp.h --- a/include/csvpp.h Tue Mar 25 22:21:46 2014 -0500 +++ b/include/csvpp.h Tue Mar 25 22:32:45 2014 -0500 @@ -18,13 +18,13 @@ private: std::vector header; bool skipheader; - char delimiter_char; + std::string delimiter_char; // this is a string because the split function helper is expecting a string, but really this is just a char public: const char * newline; // Adding support for custom delimiter character // Based on the patch by Hanifa // https://code.google.com/p/csvpp/issues/detail?id=2 - RowReader(char delimiter_char = ',', bool skipheader=false,const char * newline="\n") : skipheader(skipheader), newline(newline) { } + RowReader(std::string delimiter_char = ',', bool skipheader=false,const char * newline="\n") : skipheader(skipheader), newline(newline) { } void clear() { header.clear(); } friend std::istream & operator>>(std::istream & os, RowReader & r); friend std::ostream & operator<<(std::ostream & os, const RowWriter & r); diff -r 6bb7abecbe5c65886310eb694c6dabe8cbb7aaf3 -r 7518b6265aa01bc33e8ad80cf578314593acab38 src/csvpp.cpp --- a/src/csvpp.cpp Tue Mar 25 22:21:46 2014 -0500 +++ b/src/csvpp.cpp Tue Mar 25 22:32:45 2014 -0500 @@ -14,6 +14,7 @@ std::ostream & operator<<(std::ostream & os, const RowWriter & r) { + rowiterator it; if (r.size() == 0) return os; @@ -22,7 +23,7 @@ { for(unsigned int i = 0; i < r[0].header.size() - 1; i++) { - os << r[0].header[i] << this->delimiter_char; + os << r[0].header[i] << r[0].delimiter_char;; } os << r[0].header[r[0].header.size() - 1] << r[0].newline; } @@ -31,7 +32,7 @@ for(it = r[i].begin(); it != r[i].end(); it++) { if (distance(r[i].begin(), it) != (int)(r[i].size() - 1)) - os << it->second << this->delimiter_char; + os << it->second << r[i].delimiter_char; else os << it->second; } @@ -73,7 +74,7 @@ If we aren't inside of a quote - store the value using the current header 'pointer' and keep scanning */ - if (c == r.delimiter_char) + if (c == r.delimiter_char[0]) { if (startquote) {