14using std::ostringstream;
46 DbAccess::DbAccess(
const QString &dbaccFile,
47 const QString &defProfileName) : DbProfile(
"Database"),
62 DbAccess::DbAccess(PvlObject &pvl,
const QString &defProfileName) :
93 QString defName(name);
94 if(defName.isEmpty()) {
99 return (DbProfile(defName));
106 return(DbProfile(*
this,
_profiles.get(defName), defName));
110 return (DbProfile(*
this, DbProfile(), defName));
127 const DbProfile &p =
_profiles.getNth(nth);
128 return(DbProfile(*
this, p, p.
Name()));
144 PvlObject db = pvl.findObject(
"Database");
167 PvlObject::PvlGroupIterator group = pvl.findGroup(
"Profile",
170 while(group != pvl.endGroup()) {
171 DbProfile dbgroup(*group);
173 group = pvl.findGroup(
"Profile", ++group, pvl.endGroup());
193 else if(
exists(
"DefaultProfile")) {
194 return (
value(
"DefaultProfile"));
ProfileList _profiles
List of profiles.
const DbProfile getProfile(const QString &name="") const
Retrieves the specified access profile.
QString _defProfileName
Name of default profile.
QString getDefaultProfileName() const
Determine the name of the default profile.
void load(const QString &filename)
Loads a Database access configuration file.
QString value(const QString &key, int nth=0) const
Returns the specified value for the given keyword.
bool exists(const QString &key) const
Checks for the existance of a keyword.
QString Name() const
Returns the name of this property.
void loadkeys(PvlContainer &pvl)
Loads DbProfile keys from the given Pvl construct.
This is free and unencumbered software released into the public domain.