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

Method sumExpr

tools/ipc_codegen/ipc_codegen.cpp:1058–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1056 }
1057
1058 static std::string sumExpr(const std::vector<Field>& fields,
1059 const std::vector<Field>& sideFields,
1060 const std::vector<std::string>& external,
1061 bool minimum) {
1062 std::vector<std::string> terms;
1063 for (const auto& field : fields) {
1064 if (field.type != "bytes") {
1065 terms.push_back("sizeof(" + field.type + ")");
1066 } else if (!minimum || !containsField(sideFields, field.lenRef)) {
1067 terms.push_back(lengthExpr(field, sideFields, external));
1068 }
1069 }
1070 return sumExpr(terms);
1071 }
1072
1073 static std::string sumExpr(const std::vector<std::string>& terms) {
1074 if (terms.empty()) return "0";

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected