Index: /trunk/SophyaLib/BaseTools/gnumd5.c
===================================================================
--- /trunk/SophyaLib/BaseTools/gnumd5.c	(revision 1257)
+++ /trunk/SophyaLib/BaseTools/gnumd5.c	(revision 1258)
@@ -48,5 +48,5 @@
 /* 
 typedef struct {
-  uint_4 A,B,C,D;	  // chaining variables 
+  uint_4 A,B,C,D;	   chaining variables 
   uint_4  nblocks;
   uint_1 buf[64];
@@ -363,5 +363,5 @@
 static
 #endif
-const char * const gnupgext_version = "MD5 ($Revision: 1.3 $)";
+const char * const gnupgext_version = "MD5 ($Revision: 1.4 $)";
 
 static struct {
Index: /trunk/SophyaLib/SUtils/datacards.cc
===================================================================
--- /trunk/SophyaLib/SUtils/datacards.cc	(revision 1257)
+++ /trunk/SophyaLib/SUtils/datacards.cc	(revision 1258)
@@ -1,3 +1,3 @@
-/// $Id: datacards.cc,v 1.4 2000-09-22 10:37:44 ansari Exp $
+/// $Id: datacards.cc,v 1.5 2000-10-24 17:35:03 ansari Exp $
 //
 // Datacards, acquisition EROS II
@@ -191,12 +191,12 @@
 /*! Returns true if \b key is present in the list */
 bool
-DataCards::HasKey(string const& key)
-{
-  return FindKey(key) != NULL;
+DataCards::HasKey(string const& key) const
+{
+  return (FindKeyC(key) != cards.end());
 }
 
 //! Returns the total number of cards 
 int 
-DataCards::NbCards()
+DataCards::NbCards() const
 {
 return(cards.size());
@@ -205,24 +205,51 @@
 /*! Returns the number of parameters for card \b key. (-1) if \b key not present  */
 int 
-DataCards::NbParam(string const& key)
-{
-  DataCards::Card * p = FindKey(key);
-  if (!p) return(-1);
-  else return(p->tokens.size());
+DataCards::NbParam(string const& key) const
+{
+  DataCards::CardList::const_iterator it = FindKeyC(key);
+  if (it == cards.end()) return(-1);
+  else return((*it).tokens.size());
+}
+
+/*! Returns the key for card number \b num. */ 
+string 
+DataCards::GetKey(int num) const
+{
+  if ((num < 0) || (num >= cards.size()) )  return("");
+  int k = 0;
+  CardList::const_iterator i;
+  for(i=cards.begin(); i != cards.end(); i++) {
+    if (k == num)  return((*i).kw);
+    else k++;
+  }
+  return("");
+}
+
+/*! Returns the list of parameters for card \b key. */ 
+string 
+DataCards::GetParams(string const& key) const
+{
+  string rs;
+  DataCards::CardList::const_iterator it = FindKeyC(key);
+  if (it == cards.end()) return(rs);
+  for (int k=0; k<(*it).tokens.size(); k++) {
+    rs += ' ';  rs += (*it).tokens[k];
+  }
+  return(rs);
 }
 
 /*! Returns the parameter number \b numero for card \b key */
 string
-DataCards::SParam(string const& key, int numero, string def)
-{
-  DataCards::Card * p = FindKey(key);
-  if (!p) return def;
-  if ( (numero < 0) || (numero >= p->tokens.size()) )  return def;
-  return p->tokens[numero];
+DataCards::SParam(string const& key, int numero, string def) const
+{
+  DataCards::CardList::const_iterator it = FindKeyC(key);
+  if (it == cards.end()) return(def);
+  if ( (numero < 0) || (numero >= (*it).tokens.size()) )  return def;
+  return (*it).tokens[numero];
 }
 
 /*! Returns the parameter number \b numero for card \b key, converted to type long */
 long
-DataCards::IParam(string const& key, int numero, long def)
+DataCards::IParam(string const& key, int numero, long def) const
 {
   string p = SParam(key, numero, "");
@@ -236,5 +263,5 @@
 /*! Returns the parameter number \b numero for card \b key, converted to type double */
 double
-DataCards::DParam(string const& key, int numero, double def)
+DataCards::DParam(string const& key, int numero, double def) const
 {
   string p = SParam(key, numero, "");
@@ -327,5 +354,5 @@
 
 DataCards::Card *
-DataCards::FindKey(string const& key)
+DataCards::FindKey(string const& key) 
 {
 /*
@@ -335,5 +362,5 @@
   CardList::iterator i;
   for(i=cards.begin(); i != cards.end(); i++)
-    if ((*i).kw == key) return &*i;
+    if ((*i).kw == key) return &(*i);
 
   return NULL;
@@ -341,3 +368,10 @@
 
 
-
+DataCards::CardList::const_iterator
+DataCards::FindKeyC(string const& key) const
+{
+  CardList::const_iterator i;
+  for(i=cards.begin(); i != cards.end(); i++)
+    if ((*i).kw == key) return i;
+  return cards.end();
+}
Index: /trunk/SophyaLib/SUtils/datacards.h
===================================================================
--- /trunk/SophyaLib/SUtils/datacards.h	(revision 1257)
+++ /trunk/SophyaLib/SUtils/datacards.h	(revision 1258)
@@ -1,5 +1,5 @@
 // This may look like C code, but it is really -*- C++ -*-
 //
-// $Id: datacards.h,v 1.3 2000-09-22 10:37:44 ansari Exp $
+// $Id: datacards.h,v 1.4 2000-10-24 17:35:04 ansari Exp $
 //
 // Datacards, acquisition EROS II
@@ -47,10 +47,12 @@
    void    AppendCard(string const& line);
 
-   int     NbCards();
-   bool    HasKey(string const& key);
-   int     NbParam(string const& key);
-   string  SParam(string const& key, int numero = 0, string def="");
-   long    IParam(string const& key, int numero = 0, long def = 0);
-   double  DParam(string const& key, int numero = 0, double def = 0);
+   int     NbCards() const; 
+   bool    HasKey(string const& key) const;
+   int     NbParam(string const& key) const;
+   string  GetKey(int num) const;
+   string  GetParams(string const& key) const;
+   string  SParam(string const& key, int numero = 0, string def="") const;
+   long    IParam(string const& key, int numero = 0, long def = 0) const;
+   double  DParam(string const& key, int numero = 0, double def = 0) const;
    
    void    Print(ostream& s) const;
@@ -77,8 +79,11 @@
    void  RemoveCard(string const& key);
    
-   Card* FindKey(string const& key);
+   Card* FindKey(string const& key) ;
 
    typedef list<Card> CardList;
    typedef list<CrdPF> CrdPFList;
+
+   CardList::const_iterator FindKeyC(string const& key) const;
+
    CardList cards;
    CrdPFList cpfs;
