Cleanup walk table

This commit is contained in:
2017-09-10 00:17:24 -05:00
parent f98c1bbb11
commit cdaf21f415
+13 -4
View File
@@ -5,6 +5,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/ */
#include <iomanip>
#include <iostream> #include <iostream>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@@ -342,11 +344,18 @@ int walk(int argc, char **args) {
if (fsBuff) { if (fsBuff) {
auto fs = createFileSystem(fsBuff, fsSize); auto fs = createFileSystem(fsBuff, fsSize);
if (fs) { if (fs) {
cout << setw(9) << "Type |";
cout << setw(10) << "Start |";
cout << setw(10) << "End |";
cout << setw(8) << "Size";
cout << endl;
cout << "-------------------------------------";
cout << endl;
fs->walk([](const char *type, uint64_t start, uint64_t end) { fs->walk([](const char *type, uint64_t start, uint64_t end) {
cout << type; cout << setw(7) << type << " |";
cout << "\tstart: " << start; cout << setw(8) << start << " |";
cout << "\tend: " << end; cout << setw(8) << end << " |";
cout << "\tsize: " << (end - start); cout << setw(8) << (end - start);
cout << endl; cout << endl;
return 0; return 0;
}); });