48 BarcodeCommand command; |
48 BarcodeCommand command; |
49 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
49 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
50 command.process(configuration, writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
50 command.process(configuration, writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
51 resultCode = CLI::EXIT_CODE_SUCCESS; |
51 resultCode = CLI::EXIT_CODE_SUCCESS; |
52 } catch (RelpipeWriterException& e) { |
52 } catch (RelpipeWriterException& e) { |
53 fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessge().c_str()); |
53 fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessage().c_str()); |
54 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
54 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
55 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
55 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
56 } catch (RelpipeCLIException& e) { |
56 } catch (RelpipeCLIException& e) { |
57 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessge().c_str()); |
57 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str()); |
58 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
58 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
59 resultCode = e.getExitCode(); |
59 resultCode = e.getExitCode(); |
60 } |
60 } |
61 |
61 |
62 return resultCode; |
62 return resultCode; |