MCPcopy Create free account
hub / github.com/ddsggcs/cv_learning_resnet50 / write

Function write

practice/cpp/5th_codegen/example/main.cc:10–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <string>
9
10static inline void write(const std::string& filename, const std::ostringstream& content) {
11 std::ofstream file(filename, std::ios::out | std::ios::trunc);
12 if (file.is_open()) {
13 file << content.str();
14 file.close();
15 std::cout << "GenCode to " << filename << std::endl;
16 } else {
17 std::cout << "Fail to open" << filename << std::endl;
18 }
19}
20
21int main() {
22 std::ostringstream os;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected