| 60 | | Array<shared_ptr<mpdf> > Sources; |
| 61 | | //abuse Mer to store sources |
| 62 | | Setting& _Sources = Cfg.lookup ( "Sources" ); |
| 63 | | int Slen = _Sources.getLength(); |
| 64 | | Sources.set_size ( Slen ); |
| 65 | | for ( int i = 0; i < Slen; i++ ) { |
| 66 | | try { |
| 67 | | shared_ptr<mpdf> mtmp = UI::build<mpdf> ( _Sources, i ); |
| 68 | | Sources ( i ) = mtmp; |
| 69 | | } catch ( UIException ) { |
| 70 | | // it is not mpdf - see if it is epdf |
| 71 | | try { |
| 72 | | shared_ptr<epdf> etmp = UI::build<epdf> ( _Sources, i ); |
| 73 | | if ( etmp ) { |
| 74 | | Sources ( i ) = new mepdf ( etmp ); // hopefully OK |
| 75 | | } |
| 76 | | } catch ( UIException &e ) { |
| 77 | | it_error ( "No mpdfs or epdfs found! " + string ( e.what() ) ); |
| 78 | | } catch ( std::exception e ) { |
| 79 | | it_error ( "Error in UI at " + _Sources[i].getPath() ); |
| 80 | | } |
| 81 | | } catch ( std::exception &e ) { |
| 82 | | it_error ( "Error in UI at " + _Sources[i].getPath() ); |
| 83 | | } |
| 84 | | } |
| 85 | | |
| | 60 | Array<shared_ptr<mpdf> > Sources; |
| | 61 | UI::get(Sources, Cfg, "Sources", UI::compulsory); |
| 92 | | } catch ( UIException &e ) { |
| 93 | | shared_ptr<discrete_support> DisSup = UI::build<discrete_support> ( Cfg, "Support" ); |
| 94 | | Merger->set_support ( *DisSup ); |
| | 69 | } |
| | 70 | } catch (UIException &e) { |
| | 71 | shared_ptr<discrete_support> DisSup = UI::build<discrete_support> ( Cfg, "Support", UI::optional ); |
| | 72 | if (DisSup){ |
| | 73 | Merger->set_support ( *DisSup ); |
| | 74 | } else{bdm_error("Support not defined");} |