Files
codeql/swift/extractor/main.cpp
Paolo Tranquilli 95dbf2d666 Swift: first skeleton extractor
This adds a first dummy extractor for swift.

Running `bazel run //swift:install` will create an `extractor_pack`
directory in `swift`. From that moment providing `--search-path=swift`
will pick up the extractor.
2022-04-12 12:40:59 +02:00

15 lines
324 B
C++

#include <fstream>
#include <iomanip>
#include <stdlib.h>
int main() {
if (auto trapDir = getenv("CODEQL_EXTRACTOR_SWIFT_TRAP_DIR")) {
std::string file = trapDir;
file += "/my_first.trap";
if (std::ofstream out{file}) {
out << "answer_to_life_the_universe_and_everything(42)\n";
}
}
return 0;
}