12#include "detray/io/utils/file_handle.hpp"
15#include "actsvg/core.hpp"
23namespace detray::svgtools {
26template <
typename container_t>
27inline void write_svg(
const std::string& path,
const container_t& svgs,
28 bool replace =
true) {
29 actsvg::svg::file file;
30 for (
const actsvg::svg::object& obj : svgs) {
33 std::ios_base::openmode io_mode =
34 replace ? std::ios::out | std::ios::trunc : std::ios::out;
36 detray::io::file_handle stream{path,
".svg", io_mode};
42inline void write_svg(
const std::string& path,
const actsvg::svg::object& svg,
43 bool replace =
true) {
44 write_svg(path, std::array{svg}, replace);
49inline void write_svg(
const std::string& path,
50 const std::initializer_list<actsvg::svg::object>& svgs,
51 bool replace =
true) {
52 std::vector<actsvg::svg::object> arg = svgs;
53 write_svg(path, arg, replace);