* @brief Exports the generated .proto to the specified file path. */
| 170 | * @brief Exports the generated .proto to the specified file path. |
| 171 | */ |
| 172 | bool 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 |