mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Warn if configuration has wrong number of lines when single expected.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user