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

Method offsetExpr

tools/ipc_codegen/ipc_codegen.cpp:1044–1056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042 }
1043
1044 static std::string offsetExpr(const std::vector<Field>& fields,
1045 size_t index,
1046 const std::vector<Field>& sideFields,
1047 const std::vector<std::string>& external) {
1048 std::vector<std::string> terms;
1049 for (size_t i = 0; i < index; ++i) {
1050 if (fields[i].type == "bytes")
1051 terms.push_back(lengthExpr(fields[i], sideFields, external));
1052 else
1053 terms.push_back("sizeof(" + fields[i].type + ")");
1054 }
1055 return sumExpr(terms);
1056 }
1057
1058 static std::string sumExpr(const std::vector<Field>& fields,
1059 const std::vector<Field>& sideFields,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected