#include "SvgWriter.h"

#include "SvgDocument.h"
#include "File.h"

std::string SvgWriter::toString(SvgDocument* document) const
{
    std::string content = "";
    if (auto root = document->getRoot())
    {
        content += root->toString();
    }
    return content;
}

void SvgWriter::toFile(const Path& path, SvgDocument* document) const
{
    File out_file(path);
    out_file.writeText(toString(document));
}
