summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2015-10-15 14:18:05 +0200
committerFrancis Dupont <fdupont@isc.org>2015-10-15 14:18:05 +0200
commit2b96cd134fa14552a7f0b83093956e74d118bf1c (patch)
treed17af609475b5574b69db46822db9e0ab2090d3d /tools
parent[3516] Added a cap to DictionaryType (diff)
downloadkea-2b96cd134fa14552a7f0b83093956e74d118bf1c.tar.xz
kea-2b96cd134fa14552a7f0b83093956e74d118bf1c.zip
[3516] Added some comments in processFile() for loop
Diffstat (limited to 'tools')
-rw-r--r--tools/system_messages.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/system_messages.cc b/tools/system_messages.cc
index 0129164f28..562525c248 100644
--- a/tools/system_messages.cc
+++ b/tools/system_messages.cc
@@ -524,27 +524,33 @@ void processFile(const std::string& filename)
LinesType lines1;
for (LinesType::iterator l = lines0.begin(); l != lines0.end(); ++l) {
std::string line = *l;
+ // Empty lines have no spaces so are processed
if (line.empty()) {
lines1.push_back(line);
continue;
}
+ // Trim leading spaces
size_t start = line.find_first_not_of(" \t\r\n\t\v");
if (start != 0) {
line.erase(0, start);
}
+ // Done?
if (line.empty()) {
lines1.push_back(line);
continue;
}
+ // Trim trailing spaces
size_t finish = line.find_last_not_of(" \t\r\n\t\v");
if ((finish != std::string::npos) &&
(finish + 1 != line.size())) {
line.erase(finish + 1);
}
+ // Done
if (line.empty()) {
lines1.push_back(line);
continue;
}
+ // Skip comments
if (line[0] != '#') {
lines1.push_back(line);
}