MCPcopy Create free account
hub / github.com/SmingHub/Sming / testWebConstants

Function testWebConstants

samples/Basic_Utility/app/utility.cpp:14–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void testWebConstants()
15{
16 output << __FUNCTION__ << endl;
17
18 const char* extensions[] = {
19 "htm", "html", "txt", "js", "css", "xml", "json", "jpg", "gif",
20 "png", "svg", "ico", "gzip", "zip", "git", "sh", "bin", "exe",
21 };
22
23 for(auto ext : extensions) {
24 String contentType = ContentType::fromFileExtension(ext);
25 if(!contentType) {
26 contentType = F("(NOT FOUND)");
27 }
28 MimeType mimeType = ContentType::fromString(contentType);
29 output << " " << ext << ": " << contentType << " (#" << unsigned(mimeType) << ')' << endl;
30 }
31}
32
33} // namespace
34

Callers 1

initFunction · 0.85

Calls 3

fromFileExtensionFunction · 0.50
FFunction · 0.50
fromStringFunction · 0.50

Tested by

no test coverage detected