System documentation of the GNU Image-Finding Tool

CAttributeList.h
1 /* -*- mode: c++ -*-
2 */
3 /*
4 
5  GIFT, a flexible content based image retrieval system.
6  Copyright (C) 1998, 1999, 2000, 2001, 2002, CUI University of Geneva
7 
8  Copyright (C) 2003, 2004 Bayreuth University
9  2005 Bamberg University
10  This program is free software; you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation; either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 
24 */
25 #ifndef _CATTRIBUTELIST
26 #define _CATTRIBUTELIST
27 #include "libMRML/include/uses-declarations.h"
28 #include <map>
29 #include <list>
30 #include <string>
31 #include "libMRML/include/CMagic.h"
32 //#define _PRINTOUTS_AL
33 
36 class CAttributeList:public map<string,pair<char*,char*> >,public CMagic{
37 public:
39  void check()const;
41  list<string> getKeys()const;
43  typedef map<string,pair<char*,char*> > CBase;
45  CAttributeList(const char* const * const inAttributeList);
47  CAttributeList(const list<pair <string,string> >& inAttributes);
49  CAttributeList(const CAttributeList& inList);
51  const_iterator find(string inString)const;
53  void add(const string& inFirst,
54  const string& inSecond);
56  void add(const string& inAttribute,long inValue);
58  void add(const string& inAttribute,double inValue);
65  pair<bool,bool> boolReadAttribute(const string& inAttribute)const;
67  pair<bool,long> longReadAttribute(const string& inAttribute)const;
69  pair<bool,double> doubleReadAttribute(const string& inAttribute)const;
79  virtual pair<bool,string> stringReadAttribute(const string& inAttribute)const;
82  void toXML(string& outString)const;
87 };
88 #endif
void add(const string &inFirst, const string &inSecond)
adding an attribute
void toXML(string &outString) const
Outputting a string to XML.
pair< bool, double > doubleReadAttribute(const string &inAttribute) const
reading an attribute for doubles using stringReadAttribute
a simple class destined to contain attribute-value pairs in an easily accessible fashion ...
Definition: CAttributeList.h:36
pair< bool, bool > boolReadAttribute(const string &inAttribute) const
reading an attribute for booleans using stringReadAttribute it supports several pairs: yes/no true/fa...
pair< bool, long > longReadAttribute(const string &inAttribute) const
reading an attribute for integers using stringReadAttribute
CAttributeList(const char *const *const inAttributeList)
from expat
list< string > getKeys() const
Get the keys of all attributes in this list.
~CAttributeList()
the destructor in the case of char* as content it deletes the arrays of char.
const_iterator find(string inString) const
finding in this
This is a simple class for debugging.
Definition: CMagic.h:12
virtual pair< bool, string > stringReadAttribute(const string &inAttribute) const
reading an attribute for strings

Need for discussion? Want to contribute? Contact
help-gift@gnu.org Generated using Doxygen