14using std::ostringstream;
33 if(
_keys.exists(
"Name")) {
60 DbProfile::DbProfile(
const DbProfile &prof1,
const DbProfile &prof2,
61 const QString &name) :
_name(prof1.
Name()),
63 for(
int nk = 0 ; nk < prof2.
_keys.
size() ; nk++) {
60 DbProfile::DbProfile(
const DbProfile &prof1,
const DbProfile &prof2, {
…}
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;
Collector/container for arbitrary items.
const K & key(int nth) const
Returns the nth key in the collection.
int size() const
Returns the size of the collection.
T & getNth(int nth)
Returns the nth value in the collection.
QString _name
Name of this profile.
void add(const QString &key, const QString &value="")
Adds a keyword and value pair to the profile.
KeyList _keys
List of keys in profile.
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
QString operator()(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
void remove(const QString &key)
Removes a keyword from the profile.
QString Name() const
Returns the name of this property.
void loadkeys(PvlContainer &pvl)
Loads DbProfile keys from the given Pvl construct.
QString key(int nth) const
Returns the nth key in the profile.
void replace(const QString &key, const QString &value="")
Adds a keyword and value pair to the profile.
int count(const QString &key) const
Report number of values in keyword.
@ Programmer
This error is for when a programmer made an API call that was illegal.
Contains more than one keyword-value pair.
QList< PvlKeyword >::iterator PvlKeywordIterator
The keyword iterator.
PvlKeywordIterator begin()
Return the beginning iterator.
PvlKeywordIterator end()
Return the ending iterator.
A single keyword-value pair.
This is free and unencumbered software released into the public domain.