[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [4966] Write '.database' elements in name order
From: |
Greg Chicares |
Subject: |
[lmi-commits] [4966] Write '.database' elements in name order |
Date: |
Mon, 31 May 2010 00:02:47 +0000 |
Revision: 4966
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=4966
Author: chicares
Date: 2010-05-31 00:02:47 +0000 (Mon, 31 May 2010)
Log Message:
-----------
Write '.database' elements in name order
Modified Paths:
--------------
lmi/trunk/dbdict.cpp
Modified: lmi/trunk/dbdict.cpp
===================================================================
--- lmi/trunk/dbdict.cpp 2010-05-30 22:43:19 UTC (rev 4965)
+++ lmi/trunk/dbdict.cpp 2010-05-31 00:02:47 UTC (rev 4966)
@@ -86,9 +86,21 @@
static void to_xml(xml::element& e, dict_map const& t)
{
e.erase(e.begin(), e.end());
+ // Eventually the map key will be a string, not an integer.
+ // Anticipatorily sort output in the eventual order.
+ std::map<std::string,database_entity> m;
typedef dict_map::const_iterator tci;
for(tci i = t.begin(); i != t.end(); ++i)
{
+ db_names const& n = GetDBNames()[i->first];
+ LMI_ASSERT(i->first == n.Idx);
+ LMI_ASSERT(i->first == i->second.key());
+ LMI_ASSERT(n.ShortName == db_name_from_key(i->first));
+ m[n.ShortName] = i->second;
+ }
+ typedef std::map<std::string,database_entity>::const_iterator mci;
+ for(mci i = m.begin(); i != m.end(); ++i)
+ {
// This is not equivalent to calling set_element():
// multiple <item> elements are expressly permitted.
xml::element z("item");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [4966] Write '.database' elements in name order,
Greg Chicares <=