Warn if configuration has wrong number of lines when single expected.

This commit is contained in:
Arthur Britto
2013-02-10 21:48:03 -08:00
parent fffc276d7a
commit 7ac4bced80

View File

@@ -1,4 +1,5 @@
#include "ParseSection.h"
#include "Log.h"
#include "utils.h"
#include <iostream>
@@ -7,6 +8,8 @@
#define SECTION_DEFAULT_NAME ""
SETUP_LOG();
section ParseSection(const std::string& strInput, const bool bTrim)
{
std::string strData(strInput);
@@ -113,6 +116,12 @@ bool sectionSingleB(section& secSource, const std::string& strSection, std::stri
{
strValue = (*pmtEntries)[0];
}
else if (pmtEntries)
{
cLog(lsWARNING) << boost::str(boost::format("Section [%s]: requires 1 line not %d lines.")
% strSection
% pmtEntries->size());
}
return bSingle;
}