lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6145] Use versioned schemata


From: Greg Chicares
Subject: [lmi-commits] [6145] Use versioned schemata
Date: Thu, 19 Mar 2015 20:06:16 +0000

Revision: 6145
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6145
Author:   chicares
Date:     2015-03-19 20:06:15 +0000 (Thu, 19 Mar 2015)
Log Message:
-----------
Use versioned schemata

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/multiple_cell_document.cpp
    lmi/trunk/single_cell_document.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2015-03-19 15:10:42 UTC (rev 6144)
+++ lmi/trunk/ChangeLog 2015-03-19 20:06:15 UTC (rev 6145)
@@ -35886,3 +35886,24 @@
   single_cell_document.cpp
 Remove disused headers.
 
+20150319T1427Z <address@hidden> [516]
+
+  input_test.cpp
+  multiple_cell_document.cpp
+  multiple_cell_document.hpp
+  single_cell_document.cpp
+  single_cell_document.hpp
+Refactor, preparing for schema to depend on version.
+
+20150319T1510Z <address@hidden> [516]
+
+  multiple_cell_document.cpp
+  single_cell_document.cpp
+Make version available for schema selection.
+
+20150319T2006Z <address@hidden> [516]
+
+  multiple_cell_document.cpp
+  single_cell_document.cpp
+Use versioned schemata.
+

Modified: lmi/trunk/multiple_cell_document.cpp
===================================================================
--- lmi/trunk/multiple_cell_document.cpp        2015-03-19 15:10:42 UTC (rev 
6144)
+++ lmi/trunk/multiple_cell_document.cpp        2015-03-19 20:06:15 UTC (rev 
6145)
@@ -39,9 +39,11 @@
 #include <xmlwrapp/schema.h>
 #include <xsltwrapp/stylesheet.h>
 
+#include <iomanip>
 #include <istream>
 #include <iterator>                     // std::distance()
 #include <ostream>
+#include <sstream>
 #include <stdexcept>
 
 //============================================================================
@@ -448,9 +450,19 @@
 //============================================================================
 std::string multiple_cell_document::xsd_schema_name(int version) const
 {
-(void)&version; // Not used yet.
     static std::string const s("multiple_cell_document.xsd");
-    return s;
+    if(class_version() == version)
+        {
+        return s;
+        }
+
+    std::ostringstream oss;
+    oss
+        << "multiple_cell_document"
+        << '_' << std::setfill('0') << std::setw(2) << version
+        << ".xsd"
+        ;
+    return oss.str();
 }
 
 //============================================================================

Modified: lmi/trunk/single_cell_document.cpp
===================================================================
--- lmi/trunk/single_cell_document.cpp  2015-03-19 15:10:42 UTC (rev 6144)
+++ lmi/trunk/single_cell_document.cpp  2015-03-19 20:06:15 UTC (rev 6145)
@@ -38,8 +38,10 @@
 #include <xmlwrapp/schema.h>
 #include <xsltwrapp/stylesheet.h>
 
+#include <iomanip>
 #include <istream>
 #include <ostream>
+#include <sstream>
 
 //============================================================================
 single_cell_document::single_cell_document()
@@ -204,9 +206,19 @@
 //============================================================================
 std::string single_cell_document::xsd_schema_name(int version) const
 {
-(void)&version; // Not used yet.
     static std::string const s("single_cell_document.xsd");
-    return s;
+    if(class_version() == version)
+        {
+        return s;
+        }
+    std::ostringstream oss;
+
+    oss
+        << "single_cell_document"
+        << '_' << std::setfill('0') << std::setw(2) << version
+        << ".xsd"
+        ;
+    return oss.str();
 }
 
 //============================================================================




reply via email to

[Prev in Thread] Current Thread [Next in Thread]