CsvStringWriter.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// Qore CsvStringWriter class definition
/* CsvStringWriter.qc Copyright 2012 - 2018 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// assume local var scope, do not use "$" for vars, members, and method calls
namespace CsvUtil {
class CsvStringWriter : public AbstractCsvWriter {
public:
protected:
// a csv content
string content;
public:
constructor(*hash opts) ;
constructor(hash spec, hash opts) ;
protected:
initContent();
public:
protected:
writeRawLine(list values);
public:
string write(Qore::AbstractIterator iterator);
string write(list l);
string getContent();
}; // CsvStringWriter class
}; // CsvUtil namespace
CsvUtil::CsvStringWriter::getContent
string getContent()
Get the current in-memory content as a string.
CsvUtil::CsvStringWriter
The CsvStringWriter class for in-memory string CSV creation.
Definition: CsvStringWriter.qc.dox.h:34
CsvUtil::CsvStringWriter::write
string write(list l)
Stream the contents of the list and return CSV-formatted output as a string.
CsvUtil
the CsvUtil namespace. All classes used in the CsvUtil module should be inside this namespace
Definition: AbstractCsvIterator.qc.dox.h:28
CsvUtil::AbstractCsvWriter
The AbstractCsvWriter class provides a parent for all CSV writers.
Definition: AbstractCsvWriter.qc.dox.h:139
CsvUtil::CsvStringWriter::constructor
constructor(hash spec, hash opts)
creates the CsvStringWriter single-type mode with content in the memory
list
list< auto > list(...)
hash
hash< auto > hash(object obj)
CsvUtil::CsvStringWriter::write
string write(Qore::AbstractIterator iterator)
Stream iterator and return a CSV-formatted output string.
Qore::AbstractIterator
CsvUtil::CsvStringWriter::constructor
constructor(*hash opts)
creates the CsvStringWriter single-type mode with content in the memory