MCPcopy Create free account
hub / github.com/acidicoala/SmokeAPI / manually_preprocess_header

Function manually_preprocess_header

tools/src/steamworks_parser.cpp:135–143  ·  view source on GitHub ↗

* Certain Steam macros break C++ AST parser, if left unprocessed. * This function preprocesses them in a very naive manner. Stupid, but works. */

Source from the content-addressed store, hash-verified

133 * This function preprocesses them in a very naive manner. Stupid, but works.
134 */
135 std::string manually_preprocess_header(const fs::path& header_path) {
136 const auto header_contents = kb::io::read_file(header_path);
137
138 // language=RegExp
139 const std::regex re(R"(STEAM_PRIVATE_API\s*\(\s*([^)]+)\s*\))");
140 const auto processed_contents = std::regex_replace(header_contents, re, "$1");
141
142 return processed_contents;
143 }
144
145 void parse_sdk(const fs::path& sdk_path, nlohmann::ordered_json& lookup, BS::thread_pool<>& pool) {
146 const auto headers_dir = sdk_path / "headers" / "steam";

Callers 1

parse_sdkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected