MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / exportToFile

Method exportToFile

app/src/API/GRPC/ProtoGenerator.cpp:172–184  ·  view source on GitHub ↗

* @brief Exports the generated .proto to the specified file path. */

Source from the content-addressed store, hash-verified

170 * @brief Exports the generated .proto to the specified file path.
171 */
172bool API::GRPC::ProtoGenerator::exportToFile(const QString& filePath)
173{
174 if (filePath.isEmpty())
175 return false;
176
177 QFile file(filePath);
178 if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
179 return false;
180
181 QTextStream out(&file);
182 out << generateProto();
183 return true;
184}
185
186//--------------------------------------------------------------------------------------------------
187// Private helpers

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected