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

Function listAttributes

samples/Basic_IFS/app/application.cpp:408–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408void listAttributes()
409{
410 Directory dir;
411 if(dir.open()) {
412 while(dir.next()) {
413 auto filename = dir.stat().name.c_str();
414 File f;
415 if(!f.open(filename)) {
416 continue;
417 }
418 m_printf("%s:\r\n", filename);
419 auto callback = [](IFS::AttributeEnum& e) -> bool {
420 m_printf(" attr 0x%04x %s, %u bytes\r\n", unsigned(e.tag), toString(e.tag).c_str(), e.attrsize);
421 m_printHex(" ATTR", e.buffer, e.size);
422 return true;
423 };
424 char buffer[64];
425 int res = f.enumAttributes(callback, buffer, sizeof(buffer));
426 debug_i("res: %d", res);
427 }
428 }
429}
430
431void fstest()
432{

Callers 1

fstestFunction · 0.85

Calls 7

m_printfFunction · 0.85
m_printHexFunction · 0.85
toStringFunction · 0.50
openMethod · 0.45
nextMethod · 0.45
c_strMethod · 0.45
statMethod · 0.45

Tested by

no test coverage detected