MCPcopy Create free account
hub / github.com/OpenSteam001/OpenSteamTool / emitIPCResponse

Method emitIPCResponse

tools/ipc_codegen/ipc_codegen.cpp:875–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

873 }
874
875 void emitIPCResponse() {
876 out_ << "class IPCResponse {\n"
877 "public:\n"
878 " explicit IPCResponse(CUtlBuffer* buffer) : IPCResponse(detail::BufferBytes(buffer)) {}\n"
879 " explicit IPCResponse(std::span<uint8> bytes) : bytes_(bytes) {}\n"
880 " bool ok() const { return bytes_.size() >= sizeof(detail::IPCResponseHeaderLayout); }\n"
881 " EIPCResult result() const { return detail::Read<EIPCResult>(bytes_, offsetof(detail::IPCResponseHeaderLayout, result)); }\n"
882 " void set_result(EIPCResult value) { detail::Write(bytes_, offsetof(detail::IPCResponseHeaderLayout, result), value); }\n"
883 " std::span<uint8> body() { return detail::Slice(bytes_, sizeof(detail::IPCResponseHeaderLayout), bytes_.size() >= sizeof(detail::IPCResponseHeaderLayout) ? bytes_.size() - sizeof(detail::IPCResponseHeaderLayout) : 0); }\n"
884 " std::span<const uint8> body() const { return detail::Slice(std::span<const uint8>(bytes_), sizeof(detail::IPCResponseHeaderLayout), bytes_.size() >= sizeof(detail::IPCResponseHeaderLayout) ? bytes_.size() - sizeof(detail::IPCResponseHeaderLayout) : 0); }\n"
885 " std::string DebugString() const { std::ostringstream os; os << \"IPCResponse{\"; detail::AppendField(os, \"result\", result()); os << '}'; return os.str(); }\n"
886 "private:\n"
887 " std::span<uint8> bytes_;\n"
888 "};\n\n";
889 }
890
891 void emitInterface(const Interface& iface) {
892 out_ << "namespace " << iface.name << " {\n"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected