Fixed namespace decls issues

This commit is contained in:
Jean-Francois Dockes 2018-04-18 09:34:58 +02:00
parent 2176d81e60
commit ea3bd23d7c
5 changed files with 115 additions and 109 deletions

View File

@ -3752,6 +3752,13 @@ alink="#0000FF">
problems with the Qt HTML display, you can uncheck problems with the Qt HTML display, you can uncheck
it to display the plain text version instead.</p> it to display the plain text version instead.</p>
</li> </li>
<li class="listitem">
<p><span class="guilabel">Activate links in
preview</span> if set, Recoll will turn HTTP links
found inside plain text into proper HTML anchors,
and clicking a link inside a preview window will
start the default browser on the link target.</p>
</li>
<li class="listitem"> <li class="listitem">
<p><span class="guilabel">Plain text to HTML line <p><span class="guilabel">Plain text to HTML line
style</span>: when displaying plain text inside the style</span>: when displaying plain text inside the

View File

@ -18,7 +18,6 @@
#define _beaglequeue_h_included_ #define _beaglequeue_h_included_
#include <list> #include <list>
using std::list;
/** /**
* Process the Beagle indexing queue. * Process the Beagle indexing queue.
@ -56,11 +55,11 @@ public:
/** Index a list of files. No db cleaning or stemdb updating. /** Index a list of files. No db cleaning or stemdb updating.
* Used by the real time monitor */ * Used by the real time monitor */
bool indexFiles(list<string>& files); bool indexFiles(std::list<std::string>& files);
/** Purge a list of files. No way to do this currently and dont want /** Purge a list of files. No way to do this currently and dont want
* to do anything as this is mostly called by the monitor when *I* delete * to do anything as this is mostly called by the monitor when *I* delete
* files inside the queue dir */ * files inside the queue dir */
bool purgeFiles(list<string>& files) {return true;} bool purgeFiles(std::list<std::string>& files) {return true;}
/** Called when indexing data from the cache, and from internfile for /** Called when indexing data from the cache, and from internfile for
* search result preview */ * search result preview */

View File

@ -37,6 +37,10 @@
#include "rclaspell.h" #include "rclaspell.h"
#endif #endif
using std::list;
using std::string;
using std::vector;
// This would more logically live in recollindex.cpp, but then librecoll would // This would more logically live in recollindex.cpp, but then librecoll would
// have an undefined symbol // have an undefined symbol
ConfSimple idxreasons; ConfSimple idxreasons;
@ -182,9 +186,8 @@ bool ConfIndexer::indexFiles(list<string>& ifiles, int flag)
{ {
list<string> myfiles; list<string> myfiles;
string origcwd = m_config->getOrigCwd(); string origcwd = m_config->getOrigCwd();
for (list<string>::const_iterator it = ifiles.begin(); for (const auto& entry : ifiles) {
it != ifiles.end(); it++) { myfiles.push_back(path_canon(entry, &origcwd));
myfiles.push_back(path_canon(*it, &origcwd));
} }
myfiles.sort(); myfiles.sort();
@ -229,7 +232,7 @@ bool ConfIndexer::indexFiles(list<string>& ifiles, int flag)
// Update index for specific documents. The docs come from an index // Update index for specific documents. The docs come from an index
// query, so the udi, backend etc. fields are filled. // query, so the udi, backend etc. fields are filled.
bool ConfIndexer::updateDocs(std::vector<Rcl::Doc> &docs, IxFlag flag) bool ConfIndexer::updateDocs(vector<Rcl::Doc> &docs, IxFlag flag)
{ {
vector<string> paths; vector<string> paths;
docsToPaths(docs, paths); docsToPaths(docs, paths);
@ -240,13 +243,12 @@ bool ConfIndexer::updateDocs(std::vector<Rcl::Doc> &docs, IxFlag flag)
return true; return true;
} }
bool ConfIndexer::purgeFiles(std::list<string> &files, int flag) bool ConfIndexer::purgeFiles(list<string> &files, int flag)
{ {
list<string> myfiles; list<string> myfiles;
string origcwd = m_config->getOrigCwd(); string origcwd = m_config->getOrigCwd();
for (list<string>::const_iterator it = files.begin(); for (const auto& entry : files) {
it != files.end(); it++) { myfiles.push_back(path_canon(entry, &origcwd));
myfiles.push_back(path_canon(*it, &origcwd));
} }
myfiles.sort(); myfiles.sort();

View File

@ -158,7 +158,7 @@ public:
int getMaxExp() {return m_maxexp;} int getMaxExp() {return m_maxexp;}
int getMaxCl() {return m_maxcl;} int getMaxCl() {return m_maxcl;}
int getSoftMaxExp() {return m_softmaxexpand;} int getSoftMaxExp() {return m_softmaxexpand;}
void dump(ostream& o) const; void dump(std::ostream& o) const;
friend class ::AdvSearch; friend class ::AdvSearch;
@ -292,7 +292,7 @@ public:
virtual Relation getrel() { virtual Relation getrel() {
return m_rel; return m_rel;
} }
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
friend class SearchData; friend class SearchData;
protected: protected:
@ -342,7 +342,7 @@ public:
virtual void setfield(const string& field) { virtual void setfield(const string& field) {
m_field = field; m_field = field;
} }
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
protected: protected:
std::string m_text; // Raw user entry text. std::string m_text; // Raw user entry text.
@ -384,7 +384,7 @@ public:
} }
virtual ~SearchDataClauseRange() {} virtual ~SearchDataClauseRange() {}
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
virtual const std::string& gettext2() const { virtual const std::string& gettext2() const {
return m_t2; return m_t2;
} }
@ -413,7 +413,7 @@ public:
virtual ~SearchDataClauseFilename() {} virtual ~SearchDataClauseFilename() {}
virtual bool toNativeQuery(Rcl::Db &, void *); virtual bool toNativeQuery(Rcl::Db &, void *);
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
}; };
@ -448,7 +448,7 @@ public:
virtual ~SearchDataClausePath() {} virtual ~SearchDataClausePath() {}
virtual bool toNativeQuery(Rcl::Db &, void *); virtual bool toNativeQuery(Rcl::Db &, void *);
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
}; };
/** /**
@ -470,7 +470,7 @@ public:
virtual void setslack(int slack) { virtual void setslack(int slack) {
m_slack = slack; m_slack = slack;
} }
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
private: private:
int m_slack; int m_slack;
}; };
@ -493,7 +493,7 @@ public:
virtual std::shared_ptr<SearchData> getSub() { virtual std::shared_ptr<SearchData> getSub() {
return m_sub; return m_sub;
} }
virtual void dump(ostream& o) const; virtual void dump(std::ostream& o) const;
protected: protected:
std::shared_ptr<SearchData> m_sub; std::shared_ptr<SearchData> m_sub;

View File

@ -65,20 +65,14 @@
#include "pathut.h" #include "pathut.h"
using std::string;
using std::vector;
using std::map;
using std::istream;
using std::ostream;
/** Internal class used for storing presentation information */ /** Internal class used for storing presentation information */
class ConfLine { class ConfLine {
public: public:
enum Kind {CFL_COMMENT, CFL_SK, CFL_VAR, CFL_VARCOMMENT}; enum Kind {CFL_COMMENT, CFL_SK, CFL_VAR, CFL_VARCOMMENT};
Kind m_kind; Kind m_kind;
string m_data; std::string m_data;
string m_aux; std::string m_aux;
ConfLine(Kind k, const string& d, string a = string()) ConfLine(Kind k, const std::string& d, std::string a = std::string())
: m_kind(k), m_data(d), m_aux(a) { : m_kind(k), m_data(d), m_aux(a) {
} }
bool operator==(const ConfLine& o) { bool operator==(const ConfLine& o) {
@ -93,18 +87,19 @@ class ConfNull {
public: public:
enum StatusCode {STATUS_ERROR = 0, STATUS_RO = 1, STATUS_RW = 2}; enum StatusCode {STATUS_ERROR = 0, STATUS_RO = 1, STATUS_RW = 2};
virtual ~ConfNull() {}; virtual ~ConfNull() {};
virtual int get(const string& name, string& value, virtual int get(const std::string& name, std::string& value,
const string& sk = string()) const = 0; const std::string& sk = std::string()) const = 0;
virtual bool hasNameAnywhere(const string& nm) const = 0; virtual bool hasNameAnywhere(const std::string& nm) const = 0;
virtual int set(const string& nm, const string& val, virtual int set(const std::string& nm, const std::string& val,
const string& sk = string()) = 0; const std::string& sk = std::string()) = 0;
virtual bool ok() const = 0; virtual bool ok() const = 0;
virtual vector<string> getNames(const string& sk, const char* = 0)const = 0; virtual std::vector<std::string> getNames(const std::string& sk,
virtual int erase(const string&, const string&) = 0; const char* = 0)const = 0;
virtual int eraseKey(const string&) = 0; virtual int erase(const std::string&, const std::string&) = 0;
virtual int eraseKey(const std::string&) = 0;
virtual void showall() const {}; virtual void showall() const {};
virtual vector<string> getSubKeys() const = 0; virtual std::vector<std::string> getSubKeys() const = 0;
virtual vector<string> getSubKeys(bool) const = 0; virtual std::vector<std::string> getSubKeys(bool) const = 0;
virtual bool holdWrites(bool) = 0; virtual bool holdWrites(bool) = 0;
virtual bool sourceChanged() const = 0; virtual bool sourceChanged() const = 0;
}; };
@ -130,7 +125,7 @@ public:
* @param readonly if true open readonly, else rw * @param readonly if true open readonly, else rw
* @param tildexp try tilde (home dir) expansion for subsection names * @param tildexp try tilde (home dir) expansion for subsection names
*/ */
ConfSimple(const string& data, int readonly = 0, bool tildexp = false, ConfSimple(const std::string& data, int readonly = 0, bool tildexp = false,
bool trimvalues = true); bool trimvalues = true);
/** /**
@ -160,7 +155,7 @@ public:
} }
/** Clear, then reparse from string */ /** Clear, then reparse from string */
void reparse(const string& in); void reparse(const std::string& in);
/** Clear all content */ /** Clear all content */
void clear() { void clear() {
@ -173,40 +168,40 @@ public:
* in global space if sk is empty). * in global space if sk is empty).
* @return 0 if name not found, 1 else * @return 0 if name not found, 1 else
*/ */
virtual int get(const string& name, string& value, virtual int get(const std::string& name, std::string& value,
const string& sk = string()) const; const std::string& sk = std::string()) const;
/** /**
* Get integer value for named parameter, from specified subsection (looks * Get integer value for named parameter, from specified subsection (looks
* in global space if sk is empty). * in global space if sk is empty).
* @return 0 if name not found, 1 else * @return 0 if name not found, 1 else
*/ */
virtual int get(const string& name, int* value, virtual int get(const std::string& name, int* value,
const string& sk = string()) const; const std::string& sk = std::string()) const;
/** /**
* Set value for named string parameter in specified subsection (or global) * Set value for named string parameter in specified subsection (or global)
* @return 0 for error, 1 else * @return 0 for error, 1 else
*/ */
virtual int set(const string& nm, const string& val, virtual int set(const std::string& nm, const std::string& val,
const string& sk = string()); const std::string& sk = std::string());
/** /**
* Set value for named integer parameter in specified subsection (or global) * Set value for named integer parameter in specified subsection (or global)
* @return 0 for error, 1 else * @return 0 for error, 1 else
*/ */
virtual int set(const string& nm, long long val, virtual int set(const std::string& nm, long long val,
const string& sk = string()); const std::string& sk = std::string());
/** /**
* Remove name and value from config * Remove name and value from config
*/ */
virtual int erase(const string& name, const string& sk); virtual int erase(const std::string& name, const std::string& sk);
/** /**
* Erase all names under given subkey (and subkey itself) * Erase all names under given subkey (and subkey itself)
*/ */
virtual int eraseKey(const string& sk); virtual int eraseKey(const std::string& sk);
virtual StatusCode getStatus() const; virtual StatusCode getStatus() const;
virtual bool ok() const { virtual bool ok() const {
@ -222,47 +217,47 @@ public:
*/ */
enum WalkerCode {WALK_STOP, WALK_CONTINUE}; enum WalkerCode {WALK_STOP, WALK_CONTINUE};
virtual WalkerCode sortwalk(WalkerCode virtual WalkerCode sortwalk(WalkerCode
(*wlkr)(void *cldata, const string& nm, (*wlkr)(void *cldata, const std::string& nm,
const string& val), const std::string& val),
void *clidata) const; void *clidata) const;
/** Print all values to stdout */ /** Print all values to stdout */
virtual void showall() const; virtual void showall() const;
/** Return all names in given submap. */ /** Return all names in given submap. */
virtual vector<string> getNames(const string& sk, const char *pattern = 0) virtual std::vector<std::string> getNames(const std::string& sk,
const; const char *pattern = 0) const;
/** Check if name is present in any submap. This is relatively expensive /** Check if name is present in any submap. This is relatively expensive
* but useful for saving further processing sometimes */ * but useful for saving further processing sometimes */
virtual bool hasNameAnywhere(const string& nm) const; virtual bool hasNameAnywhere(const std::string& nm) const;
/** /**
* Return all subkeys * Return all subkeys
*/ */
virtual vector<string> getSubKeys(bool) const { virtual std::vector<std::string> getSubKeys(bool) const {
return getSubKeys(); return getSubKeys();
} }
virtual vector<string> getSubKeys() const; virtual std::vector<std::string> getSubKeys() const;
/** Return subkeys in file order. BEWARE: only for the original from the /** Return subkeys in file order. BEWARE: only for the original from the
* file: the data is not duplicated to further copies */ * file: the data is not duplicated to further copies */
virtual vector<string> getSubKeys_unsorted(bool = false) const { virtual std::vector<std::string> getSubKeys_unsorted(bool = false) const {
return m_subkeys_unsorted; return m_subkeys_unsorted;
} }
/** Test for subkey existence */ /** Test for subkey existence */
virtual bool hasSubKey(const string& sk) const { virtual bool hasSubKey(const std::string& sk) const {
return m_submaps.find(sk) != m_submaps.end(); return m_submaps.find(sk) != m_submaps.end();
} }
virtual string getFilename() const { virtual std::string getFilename() const {
return m_filename; return m_filename;
} }
/** Used with config files with specially formatted, xml-like comments. /** Used with config files with specially formatted, xml-like comments.
* Extract the comments as text */ * Extract the comments as text */
virtual bool commentsAsXML(ostream& out); virtual bool commentsAsXML(std::ostream& out);
/** !! Note that assignment and copy constructor do not copy the /** !! Note that assignment and copy constructor do not copy the
auxiliary data (m_order and subkeys_unsorted). */ auxiliary data (m_order and subkeys_unsorted). */
@ -295,10 +290,10 @@ public:
/** /**
* Write in file format to out * Write in file format to out
*/ */
bool write(ostream& out) const; bool write(std::ostream& out) const;
/** Give access to semi-parsed file contents */ /** Give access to semi-parsed file contents */
const vector<ConfLine>& getlines() const { const std::vector<ConfLine>& getlines() const {
return m_order; return m_order;
} }
@ -308,24 +303,24 @@ protected:
StatusCode status; StatusCode status;
private: private:
// Set if we're working with a file // Set if we're working with a file
string m_filename; std::string m_filename;
time_t m_fmtime; time_t m_fmtime;
// Configuration data submaps (one per subkey, the main data has a // Configuration data submaps (one per subkey, the main data has a
// null subkey) // null subkey)
map<string, map<string, string> > m_submaps; std::map<std::string, std::map<std::string, std::string> > m_submaps;
vector<string> m_subkeys_unsorted; std::vector<std::string> m_subkeys_unsorted;
// Presentation data. We keep the comments, empty lines and // Presentation data. We keep the comments, empty lines and
// variable and subkey ordering information in there (for // variable and subkey ordering information in there (for
// rewriting the file while keeping hand-edited information) // rewriting the file while keeping hand-edited information)
vector<ConfLine> m_order; std::vector<ConfLine> m_order;
// Control if we're writing to the backing store // Control if we're writing to the backing store
bool m_holdWrites; bool m_holdWrites;
void parseinput(istream& input); void parseinput(std::istream& input);
bool write(); bool write();
// Internal version of set: no RW checking // Internal version of set: no RW checking
virtual int i_set(const string& nm, const string& val, virtual int i_set(const std::string& nm, const std::string& val,
const string& sk, bool init = false); const std::string& sk, bool init = false);
bool i_changed(bool upd); bool i_changed(bool upd);
}; };
@ -353,7 +348,7 @@ public:
* expansion */ * expansion */
ConfTree(const char *fname, int readonly = 0, bool trimvalues=true) ConfTree(const char *fname, int readonly = 0, bool trimvalues=true)
: ConfSimple(fname, readonly, true, trimvalues) {} : ConfSimple(fname, readonly, true, trimvalues) {}
ConfTree(const string& data, int readonly = 0, bool trimvalues=true) ConfTree(const std::string& data, int readonly = 0, bool trimvalues=true)
: ConfSimple(data, readonly, true, trimvalues) {} : ConfSimple(data, readonly, true, trimvalues) {}
ConfTree(int readonly = 0, bool trimvalues=true) ConfTree(int readonly = 0, bool trimvalues=true)
: ConfSimple(readonly, true, trimvalues) {} : ConfSimple(readonly, true, trimvalues) {}
@ -369,7 +364,8 @@ public:
* parents. * parents.
* @return 0 if name not found, 1 else * @return 0 if name not found, 1 else
*/ */
virtual int get(const string& name, string& value, const string& sk) const; virtual int get(const std::string& name, std::string& value,
const std::string& sk) const;
using ConfSimple::get; using ConfSimple::get;
}; };
@ -389,13 +385,14 @@ public:
/// Construct from configuration file names. The earler /// Construct from configuration file names. The earler
/// files in have priority when fetching values. Only the first /// files in have priority when fetching values. Only the first
/// file will be updated if ro is false and set() is used. /// file will be updated if ro is false and set() is used.
ConfStack(const vector<string>& fns, bool ro = true) { ConfStack(const std::vector<std::string>& fns, bool ro = true) {
construct(fns, ro); construct(fns, ro);
} }
/// Construct out of single file name and multiple directories /// Construct out of single file name and multiple directories
ConfStack(const string& nm, const vector<string>& dirs, bool ro = true) { ConfStack(const std::string& nm, const std::vector<std::string>& dirs,
vector<string> fns; bool ro = true) {
for (vector<string>::const_iterator it = dirs.begin(); std::vector<std::string> fns;
for (std::vector<std::string>::const_iterator it = dirs.begin();
it != dirs.end(); it++) { it != dirs.end(); it++) {
fns.push_back(path_cat(*it, nm)); fns.push_back(path_cat(*it, nm));
} }
@ -424,7 +421,7 @@ public:
} }
virtual bool sourceChanged() const { virtual bool sourceChanged() const {
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
if ((*it)->sourceChanged()) { if ((*it)->sourceChanged()) {
return true; return true;
@ -433,9 +430,9 @@ public:
return false; return false;
} }
virtual int get(const string& name, string& value, const string& sk, virtual int get(const std::string& name, std::string& value,
bool shallow) const { const std::string& sk, bool shallow) const {
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
if ((*it)->get(name, value, sk)) { if ((*it)->get(name, value, sk)) {
return true; return true;
@ -446,12 +443,13 @@ public:
} }
return false; return false;
} }
virtual int get(const string& name, string& value, const string& sk) const { virtual int get(const std::string& name, std::string& value,
const std::string& sk) const {
return get(name, value, sk, false); return get(name, value, sk, false);
} }
virtual bool hasNameAnywhere(const string& nm) const { virtual bool hasNameAnywhere(const std::string& nm) const {
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
if ((*it)->hasNameAnywhere(nm)) { if ((*it)->hasNameAnywhere(nm)) {
return true; return true;
@ -460,8 +458,8 @@ public:
return false; return false;
} }
virtual int set(const string& nm, const string& val, virtual int set(const std::string& nm, const std::string& val,
const string& sk = string()) { const std::string& sk = std::string()) {
if (!m_ok) { if (!m_ok) {
return 0; return 0;
} }
@ -470,10 +468,10 @@ public:
// Avoid adding unneeded entries: if the new value matches the // Avoid adding unneeded entries: if the new value matches the
// one out from the deeper configs, erase or dont add it // one out from the deeper configs, erase or dont add it
// from/to the topmost file // from/to the topmost file
typename vector<T*>::iterator it = m_confs.begin(); typename std::vector<T*>::iterator it = m_confs.begin();
it++; it++;
while (it != m_confs.end()) { while (it != m_confs.end()) {
string value; std::string value;
if ((*it)->get(nm, value, sk)) { if ((*it)->get(nm, value, sk)) {
// This file has value for nm/sk. If it is the same as the new // This file has value for nm/sk. If it is the same as the new
// one, no need for an entry in the topmost file. Else, stop // one, no need for an entry in the topmost file. Else, stop
@ -491,34 +489,34 @@ public:
return m_confs.front()->set(nm, val, sk); return m_confs.front()->set(nm, val, sk);
} }
virtual int erase(const string& nm, const string& sk) { virtual int erase(const std::string& nm, const std::string& sk) {
return m_confs.front()->erase(nm, sk); return m_confs.front()->erase(nm, sk);
} }
virtual int eraseKey(const string& sk) { virtual int eraseKey(const std::string& sk) {
return m_confs.front()->eraseKey(sk); return m_confs.front()->eraseKey(sk);
} }
virtual bool holdWrites(bool on) { virtual bool holdWrites(bool on) {
return m_confs.front()->holdWrites(on); return m_confs.front()->holdWrites(on);
} }
virtual vector<string> getNames(const string& sk, const char *pattern = 0) virtual std::vector<std::string> getNames(const std::string& sk,
const { const char *pattern = 0) const {
return getNames1(sk, pattern, false); return getNames1(sk, pattern, false);
} }
virtual vector<string> getNamesShallow(const string& sk, virtual std::vector<std::string> getNamesShallow(const std::string& sk,
const char *patt = 0) const { const char *patt = 0) const {
return getNames1(sk, patt, true); return getNames1(sk, patt, true);
} }
virtual vector<string> getNames1(const string& sk, const char *pattern, virtual std::vector<std::string> getNames1(
bool shallow) const { const std::string& sk, const char *pattern, bool shallow) const {
vector<string> nms; std::vector<std::string> nms;
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
bool skfound = false; bool skfound = false;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
if ((*it)->hasSubKey(sk)) { if ((*it)->hasSubKey(sk)) {
skfound = true; skfound = true;
vector<string> lst = (*it)->getNames(sk, pattern); std::vector<std::string> lst = (*it)->getNames(sk, pattern);
nms.insert(nms.end(), lst.begin(), lst.end()); nms.insert(nms.end(), lst.begin(), lst.end());
} }
if (shallow && skfound) { if (shallow && skfound) {
@ -526,19 +524,19 @@ public:
} }
} }
sort(nms.begin(), nms.end()); sort(nms.begin(), nms.end());
vector<string>::iterator uit = unique(nms.begin(), nms.end()); std::vector<std::string>::iterator uit = unique(nms.begin(), nms.end());
nms.resize(uit - nms.begin()); nms.resize(uit - nms.begin());
return nms; return nms;
} }
virtual vector<string> getSubKeys() const { virtual std::vector<std::string> getSubKeys() const {
return getSubKeys(false); return getSubKeys(false);
} }
virtual vector<string> getSubKeys(bool shallow) const { virtual std::vector<std::string> getSubKeys(bool shallow) const {
vector<string> sks; std::vector<std::string> sks;
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
vector<string> lst; std::vector<std::string> lst;
lst = (*it)->getSubKeys(); lst = (*it)->getSubKeys();
sks.insert(sks.end(), lst.begin(), lst.end()); sks.insert(sks.end(), lst.begin(), lst.end());
if (shallow) { if (shallow) {
@ -546,7 +544,7 @@ public:
} }
} }
sort(sks.begin(), sks.end()); sort(sks.begin(), sks.end());
vector<string>::iterator uit = unique(sks.begin(), sks.end()); std::vector<std::string>::iterator uit = unique(sks.begin(), sks.end());
sks.resize(uit - sks.begin()); sks.resize(uit - sks.begin());
return sks; return sks;
} }
@ -557,11 +555,11 @@ public:
private: private:
bool m_ok; bool m_ok;
vector<T*> m_confs; std::vector<T*> m_confs;
/// Reset to pristine /// Reset to pristine
void clear() { void clear() {
typename vector<T*>::iterator it; typename std::vector<T*>::iterator it;
for (it = m_confs.begin(); it != m_confs.end(); it++) { for (it = m_confs.begin(); it != m_confs.end(); it++) {
delete(*it); delete(*it);
} }
@ -571,7 +569,7 @@ private:
/// Common code to initialize from existing object /// Common code to initialize from existing object
void init_from(const ConfStack& rhs) { void init_from(const ConfStack& rhs) {
if ((m_ok = rhs.m_ok)) { if ((m_ok = rhs.m_ok)) {
typename vector<T*>::const_iterator it; typename std::vector<T*>::const_iterator it;
for (it = rhs.m_confs.begin(); it != rhs.m_confs.end(); it++) { for (it = rhs.m_confs.begin(); it != rhs.m_confs.end(); it++) {
m_confs.push_back(new T(**it)); m_confs.push_back(new T(**it));
} }
@ -579,8 +577,8 @@ private:
} }
/// Common construct from file names code /// Common construct from file names code
void construct(const vector<string>& fns, bool ro) { void construct(const std::vector<std::string>& fns, bool ro) {
vector<string>::const_iterator it; std::vector<std::string>::const_iterator it;
bool lastok = false; bool lastok = false;
for (it = fns.begin(); it != fns.end(); it++) { for (it = fns.begin(); it != fns.end(); it++) {
T* p = new T(it->c_str(), ro); T* p = new T(it->c_str(), ro);