 |
Isis 3 Programmer Reference
|
14 using std::ostringstream;
16 #include "DbProfile.h"
31 DbProfile::DbProfile(
PvlContainer &pvl) : _name(
"Profile"), _keys() {
61 const QString &name) : _name(prof1.Name()),
63 for(
int nk = 0 ; nk < prof2.
_keys.
size() ; nk++) {
152 mess <<
"Error fetching value from key " <<
key;
154 mess <<
" (index=" << nth <<
")";
192 void DbProfile::printOn(std::ostream &o)
const {
197 DbProfileKeyList::CollectorConstIter keys;
198 for(keys = begin() ; keys != end() ; ++keys) {
199 const DbProfileKey &pk = keys->second;
200 okeys.
add(pk._index, &pk.key);
204 PvlGroup propGroup(_group);
205 OrderedKeys::CollectorConstIter okItr;
206 for(okItr = okeys.begin() ; okItr != okeys.end() ; ++okItr) {
207 propGroup.addKeyword(*(okItr->second));
210 o << propGroup << std::endl;
QString operator()(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
A single keyword-value pair.
T & getNth(int nth)
Returns the nth value in the collection.
void addValue(QString value, QString unit="")
Adds a value with units.
int count(const QString &key) const
Report number of values in keyword.
T & get(const K &key)
Returns the value associated with the name provided.
int size() const
Returns the size of the collection.
int remove(const K &key)
Removes and entry from the list.
KeyList _keys
List of keys in profile.
void replace(const QString &key, const QString &value="")
Adds a keyword and value pair to the profile.
void add(const QString &key, const QString &value="")
Adds a keyword and value pair to the profile.
bool exists(const K &key) const
Checks the existance of a particular key in the list.
QString _name
Name of this profile.
const K & key(int nth) const
Returns the nth key in the collection.
void loadkeys(PvlContainer &pvl)
Loads DbProfile keys from the given Pvl construct.
A DbProfile is a container for access parameters to a database.
void add(const K &key, const T &value)
Adds the element to the list.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Collector/container for arbitrary items.
int size() const
Returns the number of values stored in this keyword.
QList< PvlKeyword >::iterator PvlKeywordIterator
The keyword iterator.
void remove(const QString &key)
Removes a keyword from the profile.
PvlKeywordIterator end()
Return the ending iterator.
Contains more than one keyword-value pair.
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
QString key(int nth) const
Returns the nth key in the profile.
PvlKeywordIterator begin()
Return the beginning iterator.
This is free and unencumbered software released into the public domain.