MCPcopy Create free account
hub / github.com/cuberite/cuberite / GetPage

Method GetPage

src/WebAdmin.cpp:344–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342
343
344sWebAdminPage cWebAdmin::GetPage(const HTTPRequest & a_Request)
345{
346 sWebAdminPage Page;
347 AStringVector Split = StringSplit(a_Request.Path, "/");
348
349 // Find the plugin that corresponds to the requested path
350 AString FoundPlugin;
351 if (Split.size() > 1)
352 {
353 for (PluginList::iterator itr = m_Plugins.begin(); itr != m_Plugins.end(); ++itr)
354 {
355 if ((*itr)->GetWebTitle() == Split[1])
356 {
357 Page.Content = (*itr)->HandleWebRequest(&a_Request);
358 cWebPlugin * WebPlugin = *itr;
359 FoundPlugin = WebPlugin->GetWebTitle();
360 AString TabName = WebPlugin->GetTabNameForRequest(&a_Request).first;
361 Page.PluginName = FoundPlugin;
362 Page.TabName = TabName;
363 break;
364 }
365 }
366 }
367
368 // Return the page contents
369 return Page;
370}
371
372
373

Callers

nothing calls this directly

Calls 7

StringSplitFunction · 0.85
sizeMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
GetWebTitleMethod · 0.80
HandleWebRequestMethod · 0.80
GetTabNameForRequestMethod · 0.80

Tested by

no test coverage detected