MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / computePageList

Method computePageList

plugins/webadmin/loops.cpp:346–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346void NavLoop::computePageList(void) {
347 // scan the dirs for files with title
348
349 bool haveMain = false;
350 for (size_t f = 0; f < pages.size(); f++) {
351 std::string page = getFileTitle(pages[f]);
352 if (compare_nocase(page, "main") == 0) {
353 haveMain = true;
354 }
355 }
356
357 // ok sort that sucker so main is first
358
359 if (haveMain) {
360 std::vector<std::string> files = pages;
361 pages.clear();
362 pages.push_back("Main");
363 for (size_t f = 0; f < files.size(); f++) {
364 if (compare_nocase(files[f], "main") != 0) {
365 pages.push_back(files[f]);
366 }
367 }
368 }
369}
370
371void NavLoop::setSize(void) {
372 size = pages.size();

Callers 1

handleAuthedRequestMethod · 0.80

Calls 5

getFileTitleFunction · 0.50
compare_nocaseFunction · 0.50
sizeMethod · 0.45
clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected