/*
* VOTableWriter.hh
*
* Created on: 7 août 2013
* Author: CS
*/
#ifndef VOTABLEWRITER_HH_
#define VOTABLEWRITER_HH_
#include "XMLWriter.hh"
namespace TimeTableCatalog {
/**
* Writes a TimeTable into an InternalXML formated file.
* Something like :
*
*
* Time Table generated by AMDA @ CDPP;
Conditions: Solar Proton Events Affecting the Earth Environment from http://www.swpc.noaa.gov/ftpdir/indices/SPE.txt
January 1976 - July 2007
PARTICLE EVENT
Start - Maximum;
Source: Upload Time Table;
Creation Date : 2009-04-07 12:26:52;
AMDA @ CDPP
time tag for beginning of interval
time tag for end of interval
1976-04-30T21:20:00 |
1976-05-01T17:00:00 |
1977-09-19T14:30:00 |
1977-09-19T21:30:00 |
*
*/
class VOTableWriter: public TimeTableCatalog::XMLWriter {
public:
static const std::string FORMAT;
VOTableWriter(const std::string& pPath, const std::string& pName = "");
virtual ~VOTableWriter();
/**
* Writes TimeTable into an InternalXML formated file.
*/
std::string write(const TimeTable& pTT);
/**
* Creates an instance of this.
*/
std::unique_ptr createInstance(const std::string& pPath, const std::string& pName = "");
/**
* Gets the tt file expected extension, starting with .
*/
const std::string getExtension() const;
std::string getTypeAsString(ParameterDescription::ParameterType type);
private:
/**
* Writes XML content (except header).
*/
void writeContent(const TimeTable& pTT, xmlTextWriterPtr& pWriter);
/**
* Writes all metadata tags as name, description, nbintervals etc.
*/
void writeMetadata(const TimeTable& pTT, xmlTextWriterPtr& pWriter);
/**
* Writes FIELD element in the file
*/
void writeField(const TimeTable& pTT,
xmlTextWriterPtr& pWriter,
const std::string &name,
const std::string &ID,
const std::string &ucd,
const std::string &datatype,
const std::string &xtype,
const std::string &utype,
const std::string &unit,
const std::string &description,
int arraysize);
/**
* Writes all intervals.
*/
void writeVOTable(const TimeTable& pTT, xmlTextWriterPtr& pWriter);
};
} /* namespace TimeTableCatalog */
#endif /* VOTABLEWRITER_HH_ */