Skip to content

Instantly share code, notes, and snippets.

@Fuyutsubaki
Created June 1, 2020 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fuyutsubaki/4b5420e445d0a18e677c13c50e59d4bc to your computer and use it in GitHub Desktop.
Save Fuyutsubaki/4b5420e445d0a18e677c13c50e59d4bc to your computer and use it in GitHub Desktop.
wandbox api sample
import wandbox
nlohmann_json_file_list = [
"json/include/nlohmann/adl_serializer.hpp",
"json/include/nlohmann/byte_container_with_subtype.hpp",
"json/include/nlohmann/detail/boolean_operators.hpp",
"json/include/nlohmann/detail/conversions/from_json.hpp",
"json/include/nlohmann/detail/conversions/to_chars.hpp",
"json/include/nlohmann/detail/conversions/to_json.hpp",
"json/include/nlohmann/detail/exceptions.hpp",
"json/include/nlohmann/detail/input/binary_reader.hpp",
"json/include/nlohmann/detail/input/input_adapters.hpp",
"json/include/nlohmann/detail/input/json_sax.hpp",
"json/include/nlohmann/detail/input/lexer.hpp",
"json/include/nlohmann/detail/input/parser.hpp",
"json/include/nlohmann/detail/input/position_t.hpp",
"json/include/nlohmann/detail/iterators/internal_iterator.hpp",
"json/include/nlohmann/detail/iterators/iter_impl.hpp",
"json/include/nlohmann/detail/iterators/iteration_proxy.hpp",
"json/include/nlohmann/detail/iterators/iterator_traits.hpp",
"json/include/nlohmann/detail/iterators/json_reverse_iterator.hpp",
"json/include/nlohmann/detail/iterators/primitive_iterator.hpp",
"json/include/nlohmann/detail/json_pointer.hpp",
"json/include/nlohmann/detail/json_ref.hpp",
"json/include/nlohmann/detail/macro_scope.hpp",
"json/include/nlohmann/detail/macro_unscope.hpp",
"json/include/nlohmann/detail/meta/cpp_future.hpp",
"json/include/nlohmann/detail/meta/detected.hpp",
"json/include/nlohmann/detail/meta/is_sax.hpp",
"json/include/nlohmann/detail/meta/type_traits.hpp",
"json/include/nlohmann/detail/meta/void_t.hpp",
"json/include/nlohmann/detail/output/binary_writer.hpp",
"json/include/nlohmann/detail/output/output_adapters.hpp",
"json/include/nlohmann/detail/output/serializer.hpp",
"json/include/nlohmann/detail/value_t.hpp",
"json/include/nlohmann/json.hpp",
"json/include/nlohmann/json_fwd.hpp",
"json/include/nlohmann/thirdparty/hedley/hedley.hpp",
"json/include/nlohmann/thirdparty/hedley/hedley_undef.hpp",
]
main_file="jsmain.cpp"
with wandbox.Wandbox() as w:
w.compiler('gcc-head')
w.options('warning,gnu++1y')
for x in ["-I","json/include/"]:
w.add_compiler_options(x)
with open(main_file) as f:
w.code(f.read())
for filename in nlohmann_json_file_list:
with open(filename) as f:
w.add_file(filename, f.read())
w.permanent_link(True)
print(w.run())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment