Index: buzelib/Utils/MachineIndex.h =================================================================== --- buzelib/Utils/MachineIndex.h (revision 44) +++ buzelib/Utils/MachineIndex.h (working copy) @@ -60,7 +60,7 @@ IndexItem* parseLine(const std::string& line, FileReader &reader); MachineMenu* parseMenu(const std::string& firstLine, FileReader &reader); - void open(const char* fn); + void open(const char* fn, MachineMenu *menu = NULL); int saveDepth; Index: buzelib/Utils/MachineIndex.cpp =================================================================== --- buzelib/Utils/MachineIndex.cpp (revision 44) +++ buzelib/Utils/MachineIndex.cpp (working copy) @@ -66,6 +66,15 @@ MachineMenu* childMenu=parseMenu(line, reader); if (childMenu) menu->append(childMenu); + } else + if (line.at(0) == '#') { + const char *str; + + str = line.c_str(); + if(str && strlen(str) > 15 && !strncmp(str, "# buze-include ", 15)) + { + open(str + 15, menu); + } } else { IndexItem* item=parseLine(line, reader); if (item) { @@ -76,10 +85,13 @@ return menu; } -void MachineIndex::open(const char* fn) { +void MachineIndex::open(const char* fn, MachineMenu *menu) { FileReader reader; string line; + if(!menu) + menu = &root; + if (!reader.open(fn)) return ; while (!reader.eof()) { //cout << reader.readLine() << endl; @@ -98,14 +110,14 @@ str = line.c_str(); if(str && strlen(str) > 15 && !strncmp(str, "# buze-include ", 15)) { - open(str + 15); + open(str + 15, menu); } item=0; } else item=parseLine(line, reader); if (item) - root.append(item); + menu->append(item); } reader.close();