19 #include "core/exception.hpp"
20 #include "core/temp_file.hpp"
21 #include "core/cmd_line_processing.hpp"
22 #include "core/generic_app.hpp"
27 using namespace libjmmcg;
48 inline bool ProcessParam(
const unsigned long recognised_param,
const tchar *
const *
const argc,
unsigned long &i,
tostream &o) {
49 switch (recognised_param) {
51 o<<
_T(
"Got arg:")<<params[recognised_param].param<<std::endl;
55 o<<
_T(
"Got arg:")<<params[recognised_param].param<<std::endl;
56 prog_opts.s=
_T(
"fdafad");
63 inline bool PostProcessConfigFileItems(
const xmlpp::NodeSet &data_items,
tostream &) {
64 JMMCG_TRACE(_T(
"Number of items to process: ")+tostring(data_items.size()));
87 inline TestApp(
const TestApp &)
noexcept(
true);
92 CmdLineParamsData::ParamType(
_T(
"--param1"),
_T(
"Help for param1.")),
93 CmdLineParamsData::ParamType(
_T(
"--param2"),
_T(
"Help for param2."))
104 int main(
const unsigned int argv,
const tchar *
const *
const argc) {
107 TestApp::logger_ptr_type logger;
110 if (!cmd_line->ProcessParams(argv,argc,std::cout)) {
111 return exit_parameter_error;
113 logger=cmd_line->Log();
116 return app.Process(std::cerr);
117 }
catch (
const exception<
ppd::platform_api,
ppd::heavyweight_threading> &ex) {
120 }
catch (
const std::exception &ex) {
121 std::cerr<<
_T(
"STL (or derived) exception caught, details:\n")<<ex.what()<<
std::endl;
122 std::cerr<<
_T(
"Other details, not necessarily related to the STL exception caught.\n");
123 std::cerr<<crt_exception<ppd::platform_api,ppd::heavyweight_threading>::dump_crt_errno()<<std::endl;
126 std::cerr<<
_T(
"Unknown exception caught...\n");
127 std::cerr<<
_T(
"Other details, not necessarily related to the exception caught.\n");
128 std::cerr<<crt_exception<ppd::platform_api,ppd::heavyweight_threading>::dump_crt_errno()<<std::endl;