Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Configfile include
12-22-2010, 10:17 AM,
#3
 
Ah, ok, I missed this part in my first read-through:
Code:
else if (include.find(fname) != include.end())
        {
                return true;
        }
        include.insert(fname);
...but I'm still unclear on how this doesn't overwrite the contents of a previously loaded section:
Code:
iterator section = sections.insert(std::pair<std::string, SECTION>("", SECTION())).first;
What if sections[""] was already there, and had values? It looks to me like it would be overwritten by an empty SECTION object.

Shouldn't it be something like this:
Code:
iterator section = sections.find("");
if (section == sections.end())
{
        section = sections.insert(std::pair<std::string, SECTION>("", SECTION())).first;
}

It would certainly help my understanding if there was some test code that tested includes, or more comments describing how the include system works.
Reply


Messages In This Thread
Configfile include - by thelusiv - 12-22-2010, 02:35 AM
[No subject] - by NaN - 12-22-2010, 06:45 AM
[No subject] - by thelusiv - 12-22-2010, 10:17 AM
[No subject] - by NaN - 12-22-2010, 11:54 AM
[No subject] - by thelusiv - 12-22-2010, 01:12 PM
[No subject] - by NaN - 12-22-2010, 02:47 PM
[No subject] - by thelusiv - 12-23-2010, 08:40 AM
[No subject] - by NaN - 12-23-2010, 09:08 AM
[No subject] - by thelusiv - 12-23-2010, 11:18 AM
[No subject] - by NaN - 12-23-2010, 12:00 PM
[No subject] - by thelusiv - 12-27-2010, 02:43 AM
[No subject] - by joevenzon_phpbb2_import3 - 12-27-2010, 11:37 AM
[No subject] - by NaN - 12-27-2010, 08:10 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)