Changes in / [297:92b193385702:296:9768e60aa4e1] in lemon-main
- Location:
- lemon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/lgf_reader.h
r295 r294 518 518 _use_nodes(false), _use_arcs(false), 519 519 _skip_nodes(false), _skip_arcs(false) { 520 if (!(*_is)) { 521 delete _is; 522 throw IoError("Cannot open file", fn); 523 } 520 if (!(*_is)) throw IoError("Cannot open file", fn); 524 521 } 525 522 … … 533 530 _use_nodes(false), _use_arcs(false), 534 531 _skip_nodes(false), _skip_arcs(false) { 535 if (!(*_is)) { 536 delete _is; 537 throw IoError("Cannot open file", fn); 538 } 532 if (!(*_is)) throw IoError("Cannot open file", fn); 539 533 } 540 534 … … 1315 1309 _use_nodes(false), _use_edges(false), 1316 1310 _skip_nodes(false), _skip_edges(false) { 1317 if (!(*_is)) { 1318 delete _is; 1319 throw IoError("Cannot open file", fn); 1320 } 1311 if (!(*_is)) throw IoError("Cannot open file", fn); 1321 1312 } 1322 1313 … … 1330 1321 _use_nodes(false), _use_edges(false), 1331 1322 _skip_nodes(false), _skip_edges(false) { 1332 if (!(*_is)) { 1333 delete _is; 1334 throw IoError("Cannot open file", fn); 1335 } 1323 if (!(*_is)) throw IoError("Cannot open file", fn); 1336 1324 } 1337 1325 … … 2107 2095 : _is(new std::ifstream(fn.c_str())), local_is(true), 2108 2096 _filename(fn) { 2109 if (!(*_is)) { 2110 delete _is; 2111 throw IoError("Cannot open file", fn); 2112 } 2097 if (!(*_is)) throw IoError("Cannot open file", fn); 2113 2098 } 2114 2099 … … 2119 2104 : _is(new std::ifstream(fn)), local_is(true), 2120 2105 _filename(fn) { 2121 if (!(*_is)) { 2122 delete _is; 2123 throw IoError("Cannot open file", fn); 2124 } 2106 if (!(*_is)) throw IoError("Cannot open file", fn); 2125 2107 } 2126 2108 … … 2405 2387 LgfContents(const std::string& fn) 2406 2388 : _is(new std::ifstream(fn.c_str())), local_is(true) { 2407 if (!(*_is)) { 2408 delete _is; 2409 throw IoError("Cannot open file", fn); 2410 } 2389 if (!(*_is)) throw IoError("Cannot open file", fn); 2411 2390 } 2412 2391 … … 2417 2396 LgfContents(const char* fn) 2418 2397 : _is(new std::ifstream(fn)), local_is(true) { 2419 if (!(*_is)) { 2420 delete _is; 2421 throw IoError("Cannot open file", fn); 2422 } 2398 if (!(*_is)) throw IoError("Cannot open file", fn); 2423 2399 } 2424 2400 -
lemon/lgf_writer.h
r295 r294 464 464 : _os(new std::ofstream(fn.c_str())), local_os(true), _digraph(digraph), 465 465 _skip_nodes(false), _skip_arcs(false) { 466 if (!(*_os)) { 467 delete _os; 468 throw IoError("Cannot write file", fn); 469 } 466 if (!(*_os)) throw IoError("Cannot write file", fn); 470 467 } 471 468 … … 477 474 : _os(new std::ofstream(fn)), local_os(true), _digraph(digraph), 478 475 _skip_nodes(false), _skip_arcs(false) { 479 if (!(*_os)) { 480 delete _os; 481 throw IoError("Cannot write file", fn); 482 } 476 if (!(*_os)) throw IoError("Cannot write file", fn); 483 477 } 484 478 … … 1031 1025 : _os(new std::ofstream(fn.c_str())), local_os(true), _graph(graph), 1032 1026 _skip_nodes(false), _skip_edges(false) { 1033 if (!(*_os)) { 1034 delete _os; 1035 throw IoError("Cannot write file", fn); 1036 } 1027 if (!(*_os)) throw IoError("Cannot write file", fn); 1037 1028 } 1038 1029 … … 1044 1035 : _os(new std::ofstream(fn)), local_os(true), _graph(graph), 1045 1036 _skip_nodes(false), _skip_edges(false) { 1046 if (!(*_os)) { 1047 delete _os; 1048 throw IoError("Cannot write file", fn); 1049 } 1037 if (!(*_os)) throw IoError("Cannot write file", fn); 1050 1038 } 1051 1039 … … 1600 1588 SectionWriter(const std::string& fn) 1601 1589 : _os(new std::ofstream(fn.c_str())), local_os(true) { 1602 if (!(*_os)) { 1603 delete _os; 1604 throw IoError("Cannot write file", fn); 1605 } 1590 if (!(*_os)) throw IoError("Cannot write file", fn); 1606 1591 } 1607 1592 … … 1611 1596 SectionWriter(const char* fn) 1612 1597 : _os(new std::ofstream(fn)), local_os(true) { 1613 if (!(*_os)) { 1614 delete _os; 1615 throw IoError("Cannot write file", fn); 1616 } 1598 if (!(*_os)) throw IoError("Cannot write file", fn); 1617 1599 } 1618 1600
Note: See TracChangeset
for help on using the changeset viewer.