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

Method emitIPCRequest

tools/ipc_codegen/ipc_codegen.cpp:765–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763 }
764
765 void emitIPCRequest() {
766 out_ << "class IPCRequest {\n"
767 "public:\n"
768 " explicit IPCRequest(CUtlBuffer* buffer) : IPCRequest(detail::BufferBytes(buffer)) {}\n"
769 " explicit IPCRequest(std::span<uint8> bytes) : bytes_(bytes) {}\n"
770 " bool ok() const { return bytes_.size() >= sizeof(detail::IPCRequestHeaderLayout); }\n"
771 " EIPCCommand command() const { return detail::Read<EIPCCommand>(bytes_, offsetof(detail::IPCRequestHeaderLayout, command)); }\n"
772 " void set_command(EIPCCommand value) { detail::Write(bytes_, offsetof(detail::IPCRequestHeaderLayout, command), value); }\n"
773 " std::span<uint8> body() { return detail::Slice(bytes_, sizeof(detail::IPCRequestHeaderLayout), bytes_.size() >= sizeof(detail::IPCRequestHeaderLayout) ? bytes_.size() - sizeof(detail::IPCRequestHeaderLayout) : 0); }\n"
774 " std::span<const uint8> body() const { return detail::Slice(std::span<const uint8>(bytes_), sizeof(detail::IPCRequestHeaderLayout), bytes_.size() >= sizeof(detail::IPCRequestHeaderLayout) ? bytes_.size() - sizeof(detail::IPCRequestHeaderLayout) : 0); }\n"
775 " std::string DebugString() const { std::ostringstream os; os << \"IPCRequest{\"; detail::AppendField(os, \"command\", command()); os << '}'; return os.str(); }\n"
776 "private:\n"
777 " std::span<uint8> bytes_;\n"
778 "};\n\n";
779 }
780
781 void emitProtocolCommandViews() {
782 for (const auto& protocol : file_.protocols) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected