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

Method composeRow

3rdparty/qtcsv-qt5/sources/contentiterator.cpp:107–132  ·  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

105// @output:
106// - QString - result row string
107QString ContentIterator::composeRow(const QStringList& values) const
108{
109 QStringList rowValues = values;
110 const QString twoDelimiters = m_textDelimiter + m_textDelimiter;
111 for (int i = 0; i < rowValues.size(); ++i)
112 {
113 rowValues[i].replace(m_textDelimiter, twoDelimiters);
114
115 QString delimiter = m_textDelimiter;
116 if (delimiter.isEmpty() &&
117 (rowValues.at(i).contains(m_separator) ||
118 rowValues.at(i).contains(CR) ||
119 rowValues.at(i).contains(LF)))
120 {
121 delimiter = DOUBLE_QUOTE;
122 }
123
124 rowValues[i].prepend(delimiter);
125 rowValues[i].append(delimiter);
126 }
127
128 QString result = rowValues.join(m_separator);
129 result.append(LF);
130
131 return result;
132}

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