Private(const std::string &filename, double _zoom, SvgWriter *parent) : p(parent), svgGzFile(filename, std::ios_base::out), zoom(_zoom), previousGroup(SvgWriter::InvalidGroup) { const size_t filename_len = filename.length(); if (filename[filename_len - 3] == '.' && filename[filename_len - 2] == 'g' && filename[filename_len - 1] == 'z') { /// Do compress SVG file if filename ends with '.gz' output.push(boost::iostreams::gzip_compressor()); } output.push(svgGzFile); output.setf(std::ofstream::fixed); output.precision(3); output << "<?xml version=\"1.0\" standalone=\"no\"?>" << std::endl; //output << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">" << std::endl << std::endl; output << "<svg width=\"" << (1000 * zoom) << "\" height=\"" << (2047 * zoom) << "\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:svg=\"http://www.w3.org/2000/svg\" version=\"1.1\">" << std::endl; }
icout_proxy() { stream_.push(cindent_filter(stream_)); stream_.push(std::cout); }
GzWriter(string s) {out.push(io::gzip_compressor()); out.push(io::file_descriptor_sink(s));};