Revert "Device/Driver/LX: Add small delay after baud rate change"
[xcsoar.git] / test / src / DumpTaskFile.cpp
blob9301f72bb2bde15c6f3ad5451104ba69fb4d9d4d
1 #include "OS/Args.hpp"
2 #include "Task/TaskFile.hpp"
4 #include <memory>
6 int
7 main(int argc, char **argv)
9 Args args(argc, argv, "FILE.tsk|cup|igc");
10 tstring path = args.ExpectNextT();
11 args.ExpectEnd();
13 std::unique_ptr<TaskFile> file(TaskFile::Create(path.c_str()));
14 if (!file) {
15 fprintf(stderr, "TaskFile::Create() failed\n");
16 return EXIT_FAILURE;
19 unsigned count = file->Count();
20 printf("Number of tasks: %u\n---\n", count);
22 for (unsigned i = 0; i < count; ++i) {
23 const TCHAR *saved_name = file->GetName(i);
24 _tprintf(_T("%u: %s\n"), i, saved_name != NULL ? saved_name : _T(""));
27 return EXIT_SUCCESS;