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

Method appendToFile

3rdparty/qtcsv/sources/writer.cpp:60–81  ·  view source on GitHub ↗

Append information to the file @input: - filePath - string with absolute path to csv-file - content - not empty handler of content for csv-file - codec - pointer to codec object that would be used for file writing @output: - bool - True if data was appended to the file, otherwise False

Source from the content-addressed store, hash-verified

58// @output:
59// - bool - True if data was appended to the file, otherwise False
60bool WriterPrivate::appendToFile(
61 const QString& filePath,
62 ContentIterator& content,
63 const QStringConverter::Encoding codec)
64{
65 if (filePath.isEmpty() || content.isEmpty()) {
66 qDebug() << __FUNCTION__ << "Error - invalid arguments";
67 return false;
68 }
69
70 QFile csvFile(filePath);
71 if (!csvFile.open(QIODevice::Append | QIODevice::Text)) {
72 qDebug() << __FUNCTION__ << "Error - can't open file:" <<
73 csvFile.fileName();
74 return false;
75 }
76
77 const auto result = writeToIODevice(csvFile, content, codec);
78 csvFile.close();
79
80 return result;
81}
82
83// Overwrite file with new information
84// @input:

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected