#include "jsfile.h" #include "settings.h" #include "glrender.h" #include "drawelement.h" using namespace settings; namespace camp { jsfile::jsfile() : finished(false), fileName("") { } jsfile::jsfile(string name) : finished(false), fileName(name) { open(name); } jsfile::~jsfile() { if (!finished) { finish(fileName); } } void jsfile::close() { if (!finished) { finish(fileName); } } void jsfile::copy(string name, bool header) { std::ifstream fin(locateFile(name).c_str()); string s; if(header) getline(fin,s); while(getline(fin,s)) out << s << newl; } void jsfile::header(string name) { out.open(name); out << "" << newl << newl; } void jsfile::meta(string name, bool svg) { out << "" << newl << newl << "
" << newl << "