MCPcopy Create free account
hub / github.com/Audio4Linux/JDSP4Linux / composeRow

Method composeRow

3rdparty/qtcsv/sources/contentiterator.cpp:95–116  ·  view source on GitHub ↗

Compose row string from values @input: - values - list of values in rows @output: - QString - result row string

Source from the content-addressed store, hash-verified

93// @output:
94// - QString - result row string
95QString ContentIterator::composeRow(const QList<QString>& values) const {
96 QList<QString> rowValues = values;
97 const QString twoDelimiters = m_textDelimiter + m_textDelimiter;
98 for (auto i = 0; i < rowValues.size(); ++i) {
99 rowValues[i].replace(m_textDelimiter, twoDelimiters);
100
101 QString delimiter = m_textDelimiter;
102 if (delimiter.isEmpty() &&
103 (rowValues.at(i).contains(m_separator) ||
104 rowValues.at(i).contains(CR) || rowValues.at(i).contains(LF)))
105 {
106 delimiter = DOUBLE_QUOTE;
107 }
108
109 rowValues[i].prepend(delimiter);
110 rowValues[i].append(delimiter);
111 }
112
113 QString result = rowValues.join(m_separator);
114 result.append(LF);
115 return result;
116}

Callers

nothing calls this directly

Calls 5

appendMethod · 0.80
sizeMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected