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

Method emitIPCInterfaceCall

tools/ipc_codegen/ipc_codegen.cpp:854–873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

852 }
853
854 void emitIPCInterfaceCall() {
855 out_ << "class IPCInterfaceCall {\n"
856 "public:\n"
857 " explicit IPCInterfaceCall(std::span<uint8> bytes) : bytes_(bytes) {}\n"
858 " bool ok() const { return bytes_.size() >= sizeof(detail::IPCInterfaceCallHeaderLayout) + sizeof(uint32); }\n"
859 " EIPCInterface interfaceID() const { return detail::Read<EIPCInterface>(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, interfaceID)); }\n"
860 " void set_interfaceID(EIPCInterface value) { detail::Write(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, interfaceID), value); }\n"
861 " uint32 hSteamUser() const { return detail::Read<uint32>(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, hSteamUser)); }\n"
862 " void set_hSteamUser(uint32 value) { detail::Write(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, hSteamUser), value); }\n"
863 " uint32 funcHash() const { return detail::Read<uint32>(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, funcHash)); }\n"
864 " void set_funcHash(uint32 value) { detail::Write(bytes_, offsetof(detail::IPCInterfaceCallHeaderLayout, funcHash), value); }\n"
865 " uint32 fencepost() const { return detail::Read<uint32>(bytes_, bytes_.size() >= sizeof(uint32) ? bytes_.size() - sizeof(uint32) : 0); }\n"
866 " void set_fencepost(uint32 value) { if (bytes_.size() >= sizeof(uint32)) detail::Write(bytes_, bytes_.size() - sizeof(uint32), value); }\n"
867 " std::span<uint8> body() { const size_t prefix = sizeof(detail::IPCInterfaceCallHeaderLayout); const size_t suffix = sizeof(uint32); return detail::Slice(bytes_, prefix, bytes_.size() >= prefix + suffix ? bytes_.size() - prefix - suffix : 0); }\n"
868 " std::span<const uint8> body() const { const size_t prefix = sizeof(detail::IPCInterfaceCallHeaderLayout); const size_t suffix = sizeof(uint32); return detail::Slice(std::span<const uint8>(bytes_), prefix, bytes_.size() >= prefix + suffix ? bytes_.size() - prefix - suffix : 0); }\n"
869 " std::string DebugString() const { std::ostringstream os; os << \"IPCInterfaceCall{\"; detail::AppendField(os, \"interfaceID\", interfaceID()); os << ' '; detail::AppendField(os, \"hSteamUser\", hSteamUser()); os << ' '; detail::AppendField(os, \"funcHash\", funcHash()); os << ' '; detail::AppendField(os, \"fencepost\", fencepost()); os << '}'; return os.str(); }\n"
870 "private:\n"
871 " std::span<uint8> bytes_;\n"
872 "};\n\n";
873 }
874
875 void emitIPCResponse() {
876 out_ << "class IPCResponse {\n"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected