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

Function toString

Sming/Components/Storage/src/Partition.cpp:59–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57} // namespace
58
59String toString(Partition::Type type, uint8_t subType)
60{
61 String s;
62 switch(type) {
63 case Partition::Type::app:
64 s = F("app/");
65 if(auto v = appSubTypeStrings[Partition::SubType::App(subType)]) {
66 s += String(v);
67 } else {
68 s += subType;
69 }
70 break;
71 case Partition::Type::data:
72 s = F("data/");
73 if(auto v = dataSubTypeStrings[Partition::SubType::Data(subType)]) {
74 s += String(v);
75 } else {
76 s += subType;
77 }
78 break;
79
80 case Partition::Type::storage:
81 s = F("storage/");
82 if(auto v = toString(Device::Type(subType))) {
83 s += v;
84 } else {
85 s += subType;
86 }
87 break;
88
89 default:
90 s = unsigned(type);
91 s += '.';
92 s += subType;
93 }
94 return s;
95}
96
97String toLongString(Partition::Type type, uint8_t subType)
98{

Callers 3

toLongStringFunction · 0.70
Partition.cppFile · 0.70
typeStringMethod · 0.70

Calls 5

AppEnum · 0.85
DataEnum · 0.85
FFunction · 0.50
StringClass · 0.50
TypeEnum · 0.50

Tested by

no test coverage detected