Index: /trunk/gsdl/src/recpt/infodbclass.cpp
===================================================================
--- /trunk/gsdl/src/recpt/infodbclass.cpp	(revision 7433)
+++ /trunk/gsdl/src/recpt/infodbclass.cpp	(revision 7434)
@@ -63,8 +63,20 @@
 }
 
+text_t *infodbclass::getinfo (const text_t &key, const text_t& slang) {
+  text_tarray *t = getmultinfo(key, slang);
+  if (t == NULL || t->empty()) return NULL;
+  return &((*t)[0]);
+}
+
 int infodbclass::getintinfo (const text_t &key) {
   text_t *t = getinfo (key);
   if (t == NULL) return 0;
   return t->getint();
+}
+
+int infodbclass::getintinfo (const text_t &key, const text_t& slang) {
+  text_tarray *t = getmultinfo(key, slang);
+  if (t == NULL || t->empty()) return 0;
+  return (*t)[0].getint();
 }
 
@@ -96,4 +108,20 @@
 text_tarray *infodbclass::getmultinfo (const text_t &key) {
   iterator here = info.find (key);
+  if (here == info.end()) return NULL;
+
+  return &((*here).second);
+}
+
+text_tarray *infodbclass::getmultinfo (const text_t &key, const text_t& slang) {
+  iterator here = info.end();
+  if (slang.empty()) {
+    here = info.find (key);
+  }
+  else {
+    here = info.find (key+":"+slang);
+    if (here == info.end()) {
+      here = info.find (key);
+    }
+  }
   if (here == info.end()) return NULL;
 
@@ -134,5 +162,5 @@
   } while (num_retrys>0 && gdbmfile==NULL &&
 	   (gdbm_errno==GDBM_CANT_BE_READER || gdbm_errno==GDBM_CANT_BE_WRITER));
-  delete namebuffer;
+  delete []namebuffer;
   
   if (gdbmfile == NULL && logout != NULL) {
@@ -181,5 +209,5 @@
 	subkey.push_back (*subkey_here);
       }
-      subkey_here++;
+      ++subkey_here;
     }
     subkey.push_back('>');
@@ -206,12 +234,12 @@
 	}
 	
-	thissubvalue_here++;
+	++thissubvalue_here;
       }
       
       data.push_back('\n');
-      subvalue_here++;
-    }
-
-    info_here++;
+      ++subvalue_here;
+    }
+
+    ++info_here;
   }
 
@@ -231,11 +259,12 @@
   if (data_data.dptr == NULL) {
     if (logout != NULL) (*logout) << "gdbmclass: out of memory\n";
-    delete key_data.dptr;
+    delete []key_data.dptr;
+    return false;
   }
   data_data.dsize = strlen (data_data.dptr);
 
   int ret = gdbm_store (gdbmfile, key_data, data_data, GDBM_REPLACE);
-  delete key_data.dptr;
-  delete data_data.dptr;
+  delete []key_data.dptr;
+  delete []data_data.dptr;
 
   return (ret == 0);
@@ -262,11 +291,12 @@
   if (data_data.dptr == NULL) {
     if (logout != NULL) (*logout) << "gdbmclass: out of memory\n";
-    delete key_data.dptr;
+    delete []key_data.dptr;
+    return false;
   }
   data_data.dsize = strlen (data_data.dptr);
 
   int ret = gdbm_store (gdbmfile, key_data, data_data, GDBM_REPLACE);
-  delete key_data.dptr;
-  delete data_data.dptr;
+  delete []key_data.dptr;
+  delete []data_data.dptr;
 
   return (ret == 0);
@@ -288,5 +318,5 @@
 
   // free up the key memory
-  delete key_data.dptr;
+  delete []key_data.dptr;
 }
 
@@ -297,9 +327,9 @@
 // an empty string is returned.
 text_t gdbmclass::getfirstkey () {
-  if (gdbmfile == NULL) return "";
+  if (gdbmfile == NULL) return g_EmptyText;
 
   // get the first key
   datum firstkey_data = gdbm_firstkey (gdbmfile);
-  if (firstkey_data.dptr == NULL) return "";
+  if (firstkey_data.dptr == NULL) return g_EmptyText;
 
   // convert it to text_t
@@ -311,10 +341,10 @@
 
 text_t gdbmclass::getnextkey (const text_t &key) {
-  if (gdbmfile == NULL || key.empty()) return "";
+  if (gdbmfile == NULL || key.empty()) return g_EmptyText;
 
   // get a utf-8 encoded c string of the unicode key
   datum key_data;
   key_data.dptr = (to_utf8(key)).getcstr();
-  if (key_data.dptr == NULL) return "";
+  if (key_data.dptr == NULL) return g_EmptyText;
   key_data.dsize = strlen (key_data.dptr);
   
@@ -322,6 +352,6 @@
   datum nextkey_data = gdbm_nextkey (gdbmfile, key_data);
   if (nextkey_data.dptr == NULL) {
-    delete key_data.dptr;
-    return "";
+    delete []key_data.dptr;
+    return g_EmptyText;
   }
 
@@ -330,5 +360,5 @@
   nextkey.setcarr (nextkey_data.dptr, nextkey_data.dsize);
   free (nextkey_data.dptr);
-  delete key_data.dptr;
+  delete []key_data.dptr;
   return to_uni(nextkey);  // convert to unicode
 }
@@ -371,5 +401,5 @@
       get_previous_sibling (OID, info);
     
-    here --;
+    --here;
   }
   return OID;
@@ -424,5 +454,5 @@
 	  break;
 	}
-	here ++;
+	++here;
       }
     }
@@ -449,5 +479,5 @@
 	  break;
 	}
-	here ++;
+	++here;
       }
     }
@@ -456,5 +486,5 @@
 
 // returns true on success
-bool gdbmclass::getinfo (text_t key, infodbclass &info) {
+bool gdbmclass::getinfo (const text_t& key, infodbclass &info) {
   text_t data;
   
@@ -474,5 +504,5 @@
 
 // returns true if exists
-bool gdbmclass::exists (text_t key) {
+bool gdbmclass::exists (const text_t& key) {
   text_t data;
   return getkeydata (key, data);
@@ -480,5 +510,5 @@
 
 // returns true on success
-bool gdbmclass::getkeydata (text_t key, text_t &data) {
+bool gdbmclass::getkeydata (const text_t& key, text_t &data) {
   datum key_data;
   datum return_data;
@@ -496,5 +526,5 @@
   // fetch the result
   return_data = gdbm_fetch (gdbmfile, key_data);
-  delete key_data.dptr;
+  delete []key_data.dptr;
   
   if (return_data.dptr == NULL) return false;
@@ -514,19 +544,19 @@
 
   // ignore white space
-  while (here != end && is_unicode_space (*here)) here++;
+  while (here != end && is_unicode_space (*here)) ++here;
 
   // get the '<'
   if (here == end || *here != '<') return false;
-  here++;
+  ++here;
   
   // get the key
   while (here != end && *here != '>') {
     key.push_back(*here);
-    here++;
+    ++here;
   }
   
   // get the '>'
   if (here == end || *here != '>') return false;
-  here++;
+  ++here;
   
   // get the value
@@ -534,5 +564,5 @@
     if (*here == '\\') { 
       // found escape character
-      here++;
+      ++here;
       if (here != end) {
 	if (*here == 'n') value.push_back ('\n');
@@ -546,5 +576,5 @@
     }
 
-    here++;
+    ++here;
   }
 
Index: /trunk/gsdl/src/recpt/infodbclass.h
===================================================================
--- /trunk/gsdl/src/recpt/infodbclass.h	(revision 7433)
+++ /trunk/gsdl/src/recpt/infodbclass.h	(revision 7434)
@@ -46,5 +46,5 @@
 
 #ifdef __cplusplus
-extern "C" {
+  extern "C" {
 #endif
 #include "autoconf.h"
@@ -53,5 +53,5 @@
 #include "gdbm.h"
 #ifdef __cplusplus
-}
+  }
 #endif
 
@@ -68,4 +68,5 @@
 protected:
   text_tarraymap info;
+  text_t lang;
 
 public:
@@ -100,4 +101,8 @@
   void clear () {info.erase(info.begin(),info.end());}
 
+  // set default language
+  void set_language(const text_t& str_lang) { lang = str_lang; }
+  const text_t &get_language() const { return lang; }
+
   // the following functions deal with keys that can only
   // have one value for compatibility
@@ -111,5 +116,9 @@
   void setcinfo (const text_t &key, unsigned short c);
   text_t *getinfo (const text_t &key);
+  // get info overriding language set on this object
+  text_t *getinfo (const text_t &key, const text_t& lang);
   int getintinfo (const text_t &key);
+  // get info overriding language set on this object
+  int getintinfo (const text_t &key, const text_t& lang);
   text_t &operator[] (const text_t &key);
 
@@ -124,4 +133,6 @@
   void addcinfo (const text_t &key, unsigned short c);
   text_tarray *getmultinfo (const text_t &key);
+  // get info overriding language set on this object
+  text_tarray *getmultinfo (const text_t &key, const text_t& lang);
 };
 
@@ -143,9 +154,9 @@
 
   // returns true on success
-  bool getinfo (text_t key, infodbclass &info);
+  bool getinfo (const text_t& key, infodbclass &info);
   void setlogout (ostream *thelogout) {logout = thelogout;}
 
   // returns true if exists
-  bool exists (text_t key);
+  bool exists (const text_t& key);
 
   // returns true on success
@@ -164,5 +175,5 @@
 
     // returns true on success
-  bool getkeydata (text_t key, text_t &data);
+  bool getkeydata (const text_t& key, text_t &data);
 
 protected:
