Changeset 1157 in Sophya for trunk/SophyaLib/BaseTools/dvlist.cc


Ignore:
Timestamp:
Aug 29, 2000, 6:11:42 PM (25 years ago)
Author:
ansari
Message:

Declaration sa_size_t ds machdefs.h - Amelioration/correction DVList et MuTyV - Reza 29/8/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/dvlist.cc

    r1080 r1157  
    195195/*! Returns the value corresponding to name \b key, converted to integer
    196196    Default value \b def is returned if name \b key not found */
    197 int_8       DVList::GetI(string const& key, int_8 def)
    198 {
    199 ValList::iterator it = mvlist.find(key);
     197int_8       DVList::GetI(string const& key, int_8 def) const
     198{
     199ValList::const_iterator it = mvlist.find(key);
    200200if (it == mvlist.end())  return(def);
    201201return((*it).second.elval.iv);
     
    205205/*! Returns the value corresponding to name \b key, converted to double
    206206    Default value \b def is returned if name \b key not found */
    207 r_8      DVList::GetD(string const& key, r_8 def)
    208 {
    209 ValList::iterator it = mvlist.find(key);
     207r_8      DVList::GetD(string const& key, r_8 def) const
     208{
     209ValList::const_iterator it = mvlist.find(key);
    210210if (it == mvlist.end())  return(def);
    211211return((*it).second.elval.dv);
     
    215215/*! Returns the value corresponding to name \b key, converted to complex
    216216    Default value \b def is returned if name \b key not found */
    217 complex<r_8>       DVList::GetZ(string const& key, complex<r_8> def)
    218 {
    219 ValList::iterator it = mvlist.find(key);
     217complex<r_8>       DVList::GetZ(string const& key, complex<r_8> def) const
     218{
     219ValList::const_iterator it = mvlist.find(key);
    220220if (it == mvlist.end())  return(def);
    221221return((*it).second.elval.dv);
     
    225225/*! Returns the value corresponding to name \b key, converted to string
    226226    Default value \b def is returned if name \b key not found */
    227 string      DVList::GetS(string const& key, char* def)
    228 {
    229 ValList::iterator it = mvlist.find(key);
     227string      DVList::GetS(string const& key, char* def) const
     228{
     229ValList::const_iterator it = mvlist.find(key);
    230230if (it == mvlist.end())  return(def);
    231231return(*((*it).second.elval.strv));
     
    234234/* --Methode-- */
    235235/*! Returns the comment associated with name \b key */
    236 string      DVList::GetComment(string const& key)
    237 {
    238 ValList::iterator it = mvlist.find(key);
     236string      DVList::GetComment(string const& key) const
     237{
     238ValList::const_iterator it = mvlist.find(key);
    239239if (it == mvlist.end())  return("");
    240240return((*it).second.elcomm);
     
    259259
    260260/* --Methode-- */
     261/*! Removes the definition and value associated with the name \b key.
     262  Return \c true if the \b key is found in the list, \c false otherwise. */
     263bool        DVList::DeleteKey(string const& key)
     264{
     265ValList::iterator it = mvlist.find(key);
     266if (it == mvlist.end())  return(false);
     267mvlist.erase(it);
     268return(true);
     269}
     270
     271/* --Methode-- */
     272/*!  Return \c true if the \b key is found in the list, \c false otherwise. */
     273bool        DVList::HasKey(string const& key) const
     274{
     275ValList::const_iterator it = mvlist.find(key);
     276if (it == mvlist.end())  return(false);
     277return(true);
     278}
     279
     280
     281/* --Methode-- */
    261282/*! Appends or sets the integer value \b val in the list with name \b key */
    262283void        DVList::SetI(string const& key, int_8 val)
     
    316337//      Renvoie une référence sur le champ commentaire de l'objet.
    317338//--
     339
     340/* --Methode-- */
     341/*!  Return the MuTyV value associated with name \b key .
     342     Integer 0 is returned if \b key is not present in the list   */
     343MuTyV       DVList::Get(string const& key) const
     344{
     345ValList::const_iterator it = mvlist.find(key);
     346if (it == mvlist.end()) return(MuTyV(0));
     347else return((*it).second.elval);
     348}
    318349
    319350/* --Methode-- */
Note: See TracChangeset for help on using the changeset viewer.