Commit d1774421ab561f98d0e0afc70c43b35c4f9ec9b7

Authored by Hacene SI HADJ MOHAND
1 parent 91128aae

Kernek ok

src/TimeTableCatalog/AsciiData.cc
... ... @@ -26,5 +26,11 @@ namespace TimeTableCatalog {
26 26 const char * AsciiData::ATTRIB_DESCRITION = "description";
27 27 const char * AsciiData::ATTRIB_UCD = "ucd";
28 28 const char * AsciiData::ATTRIB_UTYPE = "utype";
  29 +
  30 + const std::string AsciiData::DESCRIPTION_KEYWORD = "Description:";
  31 + const std::string AsciiData::LIST_START_DATE_KEYWORD = "ListStartDate:";
  32 + const std::string AsciiData::LIST_STOP_DATE_KEYWORD = "ListStopDate:";
  33 + const std::string AsciiData::CONTACT_KEYWORD = "Contact:";
  34 + const std::string AsciiData::MODIFY_DATE_KEYWORD = "ModifyDate:";
29 35 }
30 36  
... ...
src/TimeTableCatalog/AsciiData.hh
... ... @@ -20,7 +20,7 @@ public:
20 20  
21 21 // ASCII data
22 22 static const std::string SEPARATOR;
23   -
  23 + static const std::string DESCRIPTION_KEYWORD;
24 24 static const std::string NAME_KEYWORD;
25 25 static const std::string CREATION_DATE_KEYWORD;
26 26 static const std::string HISTORIC_KEYWORD;
... ... @@ -34,6 +34,11 @@ public:
34 34 static const char * ATTRIB_DESCRITION;
35 35 static const char * ATTRIB_UCD;
36 36 static const char * ATTRIB_UTYPE;
  37 +
  38 + static const std::string LIST_START_DATE_KEYWORD;
  39 + static const std::string LIST_STOP_DATE_KEYWORD;
  40 + static const std::string CONTACT_KEYWORD;
  41 + static const std::string MODIFY_DATE_KEYWORD;
37 42 };
38 43  
39 44 } /* namespace TimeTableCatalog */
... ...
src/TimeTableCatalog/AsciiWriter.cc
... ... @@ -63,12 +63,35 @@ const std::string AsciiWriter::getExtension() const {
63 63  
64 64 void AsciiWriter::writeMetaData(const TimeTable& pTT,
65 65 std::ostream& pOut) {
  66 +
  67 + // -- write name
  68 + pOut << "# " << AsciiData::NAME_KEYWORD << " " << pTT._name << ";" << std::endl;
66 69 // -- write description
  70 + pOut << "# " << AsciiData::DESCRIPTION_KEYWORD <<std::endl ;
67 71 for (auto line : pTT._description) {
68 72 pOut << "# " << line << ";" << std::endl;
69 73 }
70   - // -- write name
71   - pOut << "# " << AsciiData::NAME_KEYWORD << " " << pTT._name << ";" << std::endl;
  74 + pOut << "# " <<std::endl;
  75 + //ListStartDate
  76 + pOut << "# " << AsciiData::LIST_START_DATE_KEYWORD << " ";
  77 + if(pTT._listStartDate == 0){
  78 + pOut <<"0001-01-01T00:00:00:00.000Z";
  79 + }else{
  80 + writeISOTime(pTT._listStartDate, pTT._timeFormat, pOut);
  81 + }
  82 + pOut << std::endl;
  83 +
  84 + //ListStopDate
  85 + pOut << "# " << AsciiData::LIST_STOP_DATE_KEYWORD << " ";
  86 + if(pTT._listStopDate == 0){
  87 + pOut <<"0001-01-01T00:00:00:00.000Z";
  88 + }else{
  89 + writeISOTime(pTT._listStopDate, pTT._timeFormat, pOut);
  90 + }
  91 + pOut << std::endl;
  92 +
  93 + // Contact:
  94 + pOut << "# " << AsciiData::CONTACT_KEYWORD << " " << pTT._contact << std::endl;
72 95  
73 96 // -- write historic
74 97 pOut << "# " << AsciiData::HISTORIC_KEYWORD << " " << pTT._history << ";" << std::endl;
... ...
src/TimeTableCatalog/InternalXMLReader.cc
... ... @@ -91,7 +91,11 @@ void InternalXMLReader::processNode(TimeTable&amp; pTT, xmlTextReaderPtr reader, int
91 91 || tagName == InternalXMLData::ELEM_STOP
92 92 || tagName == InternalXMLData::ELEM_PARAMETER
93 93 || tagName == InternalXMLData::ELEM_PARAM
94   - || tagName == InternalXMLData::ELEM_NB_INTERVALS)) {
  94 + || tagName == InternalXMLData::ELEM_NB_INTERVALS
  95 + ||tagName == InternalXMLData::ELEM_MODIFIED
  96 + || tagName == InternalXMLData::SURVEY_START_DATE
  97 + || tagName == InternalXMLData::SURVEY_STOP_DATE
  98 + || tagName == InternalXMLData::ELEM_CONTACT)) {
95 99 // yes, it is !
96 100 // save current tag to get its text value next process
97 101 _tmpCurrentTag = reinterpret_cast<const char*>(name);
... ...
src/TimeTableCatalog/InternalXMLWriter.cc
... ... @@ -34,7 +34,6 @@ InternalXMLWriter::~InternalXMLWriter() {
34 34 <name>FTE_c3</name>
35 35 <created>2013-07-14T09:09:32</created>
36 36 <modified>2013-07-14T09:09:32</modified>
37   - <modified>2013-07-14T09:09:32</modified>
38 37 <surveyStart>2013-07-14T09:09:32</surveyStart>
39 38 <surveyStop>2013-07-14T09:09:32</surveyStop>
40 39 <contact>tototiti<contact>
... ...
src/TimeTableCatalog/SpaceData.hh
... ... @@ -21,23 +21,23 @@ namespace TimeTableCatalog {
21 21  
22 22 // ASCII data
23 23 static const std::string SEPARATOR;
24   - static const std::string EVENT_TABLE_VERSION_KEYWORD;
25   - static const std::string LIST_TITLE_KEYWORD;
26   - static const std::string LIST_ID_KEYWORD;
27   - static const std::string CREATION_DATE_KEYWORD;
28   - static const std::string MODIFY_DATE_KEYWORD;
29   - static const std::string FIELD_NAMES_KEYWORD;
30   - static const std::string FIELD_UNIT_KEYWORD;
31   - static const std::string FIELD_TYPES_KEYWORD;
32   - static const std::string FIELD_NULLS_KEYWORD;
33   - static const std::string LIST_START_DATE_KEYWORD;
34   - static const std::string LIST_STOP_DATE_KEYWORD;
35   - static const std::string CONTACT_KEYWORD;
36   - static const std::string CONTACT_ID_KEYWORD;
37   - static const std::string DESCRIPTION_KEYWORD;
38   -
39   - static const std::string EVENT_TABLE_VERSION_DEFAULT;
40   - static const std::string LIST_ID_DEFAULT;
  24 + static const std::string EVENT_TABLE_VERSION_KEYWORD;
  25 + static const std::string LIST_TITLE_KEYWORD;
  26 + static const std::string LIST_ID_KEYWORD;
  27 + static const std::string CREATION_DATE_KEYWORD;
  28 + static const std::string MODIFY_DATE_KEYWORD;
  29 + static const std::string FIELD_NAMES_KEYWORD;
  30 + static const std::string FIELD_UNIT_KEYWORD;
  31 + static const std::string FIELD_TYPES_KEYWORD;
  32 + static const std::string FIELD_NULLS_KEYWORD;
  33 + static const std::string LIST_START_DATE_KEYWORD;
  34 + static const std::string LIST_STOP_DATE_KEYWORD;
  35 + static const std::string CONTACT_KEYWORD;
  36 + static const std::string CONTACT_ID_KEYWORD;
  37 + static const std::string DESCRIPTION_KEYWORD;
  38 +
  39 + static const std::string EVENT_TABLE_VERSION_DEFAULT;
  40 + static const std::string LIST_ID_DEFAULT;
41 41  
42 42 };
43 43 }
... ...
src/TimeTableCatalog/VOTableData.cc
... ... @@ -45,4 +45,9 @@ const std::string VOTableData::TABLEDATA_TAG = &quot;TABLEDATA&quot;;
45 45 const std::string VOTableData::TR_TAG = "TR";
46 46 const std::string VOTableData::TD_TAG = "TD";
47 47  
  48 +const std::string VOTableData::LIST_START_DATE_KEYWORD = "ListStartDate:";
  49 +const std::string VOTableData::LIST_STOP_DATE_KEYWORD = "ListStopDate:";
  50 +const std::string VOTableData::CONTACT_KEYWORD = "Contact:";
  51 +const std::string VOTableData::MODIFY_DATE_KEYWORD = "ModifyDate:";
  52 +
48 53 } /* namespace TimeTableCatalog */
... ...
src/TimeTableCatalog/VOTableData.hh
... ... @@ -46,6 +46,12 @@ public:
46 46 static const std::string DATA_TAG;
47 47 static const std::string TABLEDATA_TAG;
48 48 static const std::string TR_TAG;
  49 +
  50 + static const std::string LIST_START_DATE_KEYWORD;
  51 + static const std::string LIST_STOP_DATE_KEYWORD;
  52 + static const std::string CONTACT_KEYWORD;
  53 + static const std::string MODIFY_DATE_KEYWORD;
  54 +
49 55 };
50 56  
51 57 } /* namespace TimeTableCatalog */
... ...
src/TimeTableCatalog/VOTableWriter.cc
... ... @@ -79,9 +79,31 @@ void VOTableWriter::writeMetadata(const TimeTable&amp; pTT,
79 79 allMetadata << VOTableData::NAME_TAG << pTT._name << ";" << std::endl;
80 80 allMetadata << VOTableData::HISTORIC_TAG << pTT._history << ";"
81 81 << std::endl;
  82 + //ListStartDate
  83 + allMetadata << VOTableData::LIST_START_DATE_KEYWORD << " ";
  84 + if(pTT._listStartDate == 0){
  85 + allMetadata <<"0001-01-01T00:00:00:00.000Z";
  86 + }else{
  87 + writeISOTime(pTT._listStartDate, pTT._timeFormat, allMetadata);
  88 + }
  89 + allMetadata << ";"<< std::endl;
  90 +
  91 + //ListStopDate
  92 + allMetadata << VOTableData::LIST_STOP_DATE_KEYWORD << " ";
  93 + if(pTT._listStopDate == 0){
  94 + allMetadata <<"0001-01-01T00:00:00:00.000Z";
  95 + }else{
  96 + writeISOTime(pTT._listStopDate, pTT._timeFormat, allMetadata);
  97 + }
  98 + allMetadata << ";"<< std::endl;
  99 +
  100 + // Contact:
  101 + allMetadata << VOTableData::CONTACT_KEYWORD << " " << pTT._contact << ";"<< std::endl;
  102 +
82 103 allMetadata << VOTableData::CREATION_DATE_TAG;
83 104 writeISOTime(pTT._creationDate, pTT._timeFormat, allMetadata);
84 105 allMetadata << ";" << std::endl;
  106 +
85 107 writeElement(pTT, pWriter, VOTableData::DESCRIPTION_TAG, allMetadata.str());
86 108 }
87 109  
... ...