Indent + comments + use c++11 loops

This commit is contained in:
Jean-Francois Dockes 2018-11-14 10:38:22 +01:00
parent ea999ed6e5
commit b62478c0cc

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2007 J.F.Dockes /* Copyright (C) 2007-2018 J.F.Dockes
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
@ -52,26 +52,25 @@ namespace Rcl {
void Doc::dump(bool dotext) const void Doc::dump(bool dotext) const
{ {
LOGDEB("Rcl::Doc::dump: url: [" << (url) << "]\n" ); LOGDEB("Rcl::Doc::dump: url: [" << url << "]\n");
LOGDEB("Rcl::Doc::dump: idxurl: [" << (idxurl) << "]\n" ); LOGDEB("Rcl::Doc::dump: idxurl: [" << idxurl << "]\n");
LOGDEB("Rcl::Doc::dump: ipath: [" << (ipath) << "]\n" ); LOGDEB("Rcl::Doc::dump: ipath: [" << ipath << "]\n");
LOGDEB("Rcl::Doc::dump: mimetype: [" << (mimetype) << "]\n" ); LOGDEB("Rcl::Doc::dump: mimetype: [" << mimetype << "]\n");
LOGDEB("Rcl::Doc::dump: fmtime: [" << (fmtime) << "]\n" ); LOGDEB("Rcl::Doc::dump: fmtime: [" << fmtime << "]\n");
LOGDEB("Rcl::Doc::dump: dmtime: [" << (dmtime) << "]\n" ); LOGDEB("Rcl::Doc::dump: dmtime: [" << dmtime << "]\n");
LOGDEB("Rcl::Doc::dump: origcharset: [" << (origcharset) << "]\n" ); LOGDEB("Rcl::Doc::dump: origcharset: [" << origcharset << "]\n");
LOGDEB("Rcl::Doc::dump: syntabs: [" << (syntabs) << "]\n" ); LOGDEB("Rcl::Doc::dump: syntabs: [" << syntabs << "]\n");
LOGDEB("Rcl::Doc::dump: pcbytes: [" << (pcbytes) << "]\n" ); LOGDEB("Rcl::Doc::dump: pcbytes: [" << pcbytes << "]\n");
LOGDEB("Rcl::Doc::dump: fbytes: [" << (fbytes) << "]\n" ); LOGDEB("Rcl::Doc::dump: fbytes: [" << fbytes << "]\n");
LOGDEB("Rcl::Doc::dump: dbytes: [" << (dbytes) << "]\n" ); LOGDEB("Rcl::Doc::dump: dbytes: [" << dbytes << "]\n");
LOGDEB("Rcl::Doc::dump: sig: [" << (sig) << "]\n" ); LOGDEB("Rcl::Doc::dump: sig: [" << sig << "]\n");
LOGDEB("Rcl::Doc::dump: pc: [" << (pc) << "]\n" ); LOGDEB("Rcl::Doc::dump: pc: [" << pc << "]\n");
LOGDEB("Rcl::Doc::dump: xdocid: [" << ((unsigned long)xdocid) << "]\n" ); LOGDEB("Rcl::Doc::dump: xdocid: [" << (unsigned long)xdocid << "]\n");
for (map<string, string>::const_iterator it = meta.begin(); for (const auto& e : meta) {
it != meta.end(); it++) { LOGDEB("Rcl::Doc::dump: meta[" << e.first <<"]->["<< e.second << "]\n");
LOGDEB("Rcl::Doc::dump: meta[" << ((*it).first) << "]: [" << ((*it).second) << "]\n" );
} }
if (dotext) if (dotext)
LOGDEB("Rcl::Doc::dump: text: \n[" << (text) << "]\n" ); LOGDEB("Rcl::Doc::dump: text: \n[" << text << "]\n");
} }
// Copy ensuring no shared string data, for threading issues. // Copy ensuring no shared string data, for threading issues.
@ -94,7 +93,6 @@ namespace Rcl {
d->text.assign(text.begin(), text.end()); d->text.assign(text.begin(), text.end());
d->pc = pc; d->pc = pc;
d->xdocid = xdocid; d->xdocid = xdocid;
d->idxi = idxi;
d->haspages = haspages; d->haspages = haspages;
d->haschildren = haschildren; d->haschildren = haschildren;
d->onlyxattr = onlyxattr; d->onlyxattr = onlyxattr;
@ -103,8 +101,7 @@ namespace Rcl {
static const string cstr_fileu("file://"); static const string cstr_fileu("file://");
bool docsToPaths(vector<Rcl::Doc> &docs, vector<string> &paths) bool docsToPaths(vector<Rcl::Doc> &docs, vector<string> &paths)
{ {
for (vector<Rcl::Doc>::iterator it = docs.begin(); it != docs.end(); it++) { for (const auto& idoc : docs) {
Rcl::Doc &idoc = *it;
string backend; string backend;
idoc.getmeta(Rcl::Doc::keybcknd, &backend); idoc.getmeta(Rcl::Doc::keybcknd, &backend);
@ -127,5 +124,3 @@ bool docsToPaths(vector<Rcl::Doc> &docs, vector<string> &paths)
} }
} }