InternalXMLWriter.hh
2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
* InternalXMLWriter.hh
*
* Created on: 6 août 2013
* Author: CS
*/
#ifndef INTERNALXMLWRITER_HH_
#define INTERNALXMLWRITER_HH_
#include "XMLWriter.hh"
#include <string>
namespace TimeTableCatalog {
/**
* Writes TimeTable into an InternalXML formated file.
* Something like :
* <?xml version="1.0" encoding="UTF-8"?>
* <timetable>
* <name>FTE_c3</name>
* <created>2013-07-14T09:09:32</created>
* <description>Uploaded Time Table
* Time Table generated by AMDA @ CDPP;Description: FTE list from Cluster 3 data. From \"A new multivariate time series data analysis technique: Automated detection of flux transfer events using Cluster data\" by Karimabadi et al., JOURNAL OF GEOPHYSICAL RESEARCH, VOL. 114, A06216, doi:10.1029/2009JA014202, 2009 http://www.agu.org/journals/ja/ja0906/2009JA014202/The list is available as Auxiliary material \"Data Set S3\"Transformation into AMDA Time Table by V. Genot, CESR, Toulouse, France 29/06/2009 : - millisec have been omitted - the original event corresponds to the StartTime of the Time Table - if StopTime-StartTime = 1 sec then the event is a magnetosheath FTE - if StopTime-StartTime = 2 sec then the event is a magnetospheric FTE;Source: Upload Time Table;Creation Date : 2009-07-01 17:16:46 shared by Vincent Genot on 2009-11-24 18:52:50;</description>
* <history>created from another TT</history>
* <nbIntervals>738</nbIntervals>
* <intervals>
* <start>2001-02-02T16:27:12</start>
* <stop>2001-02-02T16:27:13</stop>
* </intervals>
* <!--[...]-->
* </timetable>
*
*/
class InternalXMLWriter: public TimeTableCatalog::XMLWriter {
public:
static const std::string FORMAT;
InternalXMLWriter(const std::string& pPath, const std::string& pName = "");
virtual ~InternalXMLWriter();
/**
* Writes TimeTable into an InternalXML formated file.
*/
std::string write(const TimeTable& pTT);
/**
* Creates an instance of this.
*/
std::unique_ptr<AbstractWriter> createInstance(const std::string& pPath, const std::string& pName = "");
/**
* Gets the tt file expected extension, starting with .
*/
const std::string getExtension() const;
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 all intervals.
*/
void writeIntervals(const TimeTable& pTT, xmlTextWriterPtr& pWriter);
};
} /* namespace TimeTableCatalog */
#endif /* INTERNALXMLWRITER_HH_ */