MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / main

Function main

bazel/cel_cc_embed.cc:63–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61} // namespace
62
63int main(int argc, char** argv) {
64 {
65 auto args = absl::ParseCommandLine(argc, argv);
66 ABSL_CHECK(args.empty() || args.size() == 1)
67 << "unexpected positional args: " << absl::StrJoin(args, ", ");
68 }
69 absl::InitializeLog();
70
71 auto in_buffer = ReadFile(absl::GetFlag(FLAGS_in));
72 std::string out_buffer;
73 out_buffer.reserve(in_buffer.size() * 6);
74 for (const auto& in_byte : in_buffer) {
75 absl::StrAppend(&out_buffer, "0x",
76 absl::Hex(in_byte, absl::PadSpec::kZeroPad2), ", ");
77 }
78 if (!in_buffer.empty()) {
79 // Replace last space with newline.
80 out_buffer.back() = '\n';
81 }
82 WriteFile(absl::GetFlag(FLAGS_out), out_buffer);
83
84 return EXIT_SUCCESS;
85}

Callers

nothing calls this directly

Calls 4

ReadFileFunction · 0.85
WriteFileFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected