Re-do the FCS reflectors a little to include a description.

This commit is contained in:
Jonathan Naylor 2018-03-15 23:23:08 +00:00
parent 0d777da182
commit c1789ffd0f
8 changed files with 28 additions and 25 deletions

View file

@ -216,16 +216,17 @@ bool CConf::read()
} else if (section == SECTION_FCS_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_fcsNetworkEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Entries") == 0) {
char* p = ::strtok(value, ",\r\n");
while (p != NULL) {
if (::strlen(p) > 0U) {
for (unsigned int i = 0U; p[i] != 0; i++)
p[i] = ::toupper(p[i]);
std::string name = std::string(p);
m_fcsNetworkEntries.push_back(name);
else if (::strcmp(key, "Entry") == 0) {
char* p1 = ::strtok(value, ",");
char* p2 = ::strtok(NULL, "\r\n");
if (p1 != NULL && p2 != NULL) {
if (::strlen(p1) > 0U && ::strlen(p2) > 0U) {
for (unsigned int i = 0U; p1[i] != 0; i++)
p1[i] = ::toupper(p1[i]);
std::string name = std::string(p1);
std::string desc = std::string(p2);
m_fcsNetworkEntries.push_back(std::make_pair(name, desc));
}
p = ::strtok(NULL, ",\r\n");
}
} else if (::strcmp(key, "Port") == 0)
m_fcsNetworkPort = (unsigned int)::atoi(value);
@ -427,7 +428,7 @@ bool CConf::getFCSNetworkEnabled() const
return m_fcsNetworkEnabled;
}
std::vector<std::string> CConf::getFCSNetworkEntries() const
std::vector<std::pair<std::string, std::string>> CConf::getFCSNetworkEntries() const
{
return m_fcsNetworkEntries;
}