* Certain Steam macros break C++ AST parser, if left unprocessed. * This function preprocesses them in a very naive manner. Stupid, but works. */
| 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"; |