51 jackCommand.reset(new JackCommand(configuration)); |
51 jackCommand.reset(new JackCommand(configuration)); |
52 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
52 std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout)); |
53 jackCommand->processJackStream(writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
53 jackCommand->processJackStream(writer, std::bind(fflush, stdout)); // std::bind(fflush, XXX) Factory::create(XXX) must be the same stream XXX |
54 resultCode = CLI::EXIT_CODE_SUCCESS; |
54 resultCode = CLI::EXIT_CODE_SUCCESS; |
55 } catch (RelpipeCLIException e) { |
55 } catch (RelpipeCLIException e) { |
56 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessge().c_str()); |
56 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str()); |
57 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
57 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
58 resultCode = e.getExitCode(); |
58 resultCode = e.getExitCode(); |
59 } catch (JackException e) { |
59 } catch (JackException e) { |
60 fwprintf(stderr, L"Caught JACK exception: %ls\n", e.getMessge().c_str()); |
60 fwprintf(stderr, L"Caught JACK exception: %ls\n", e.getMessage().c_str()); |
61 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
61 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
62 resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
62 resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
63 } catch (RelpipeWriterException e) { |
63 } catch (RelpipeWriterException e) { |
64 fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessge().c_str()); |
64 fwprintf(stderr, L"Caught Writer exception: %ls\n", e.getMessage().c_str()); |
65 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
65 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
66 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
66 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
67 } |
67 } |
68 |
68 |
69 return resultCode; |
69 return resultCode; |