COIN-OR::LEMON - Graph Library

Changeset 290:f6899946c1ac in lemon for lemon/graph_to_eps.h


Ignore:
Timestamp:
09/30/08 20:53:18 (11 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Simplifying exceptions

  • Using asserts instead of exceptions for unitialized parameters
  • Only the IO exceptions are used in the lemon
  • DataFormatError? is renamed to FormatError?
  • The IoError? is used for file access errors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_to_eps.h

    r280 r290  
    4141#include<lemon/color.h>
    4242#include<lemon/bits/bezier.h>
     43#include<lemon/error.h>
    4344
    4445
     
    11671168graphToEps(G &g,const char *file_name)
    11681169{
     1170  std::ostream* os = new std::ofstream(file_name);
     1171  if (!(*os)) {
     1172    delete os;
     1173    throw IoError(file_name, "Cannot write file");
     1174  }
    11691175  return GraphToEps<DefaultGraphToEpsTraits<G> >
    1170     (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name),true));
     1176    (DefaultGraphToEpsTraits<G>(g,*os,true));
    11711177}
    11721178
     
    11831189graphToEps(G &g,const std::string& file_name)
    11841190{
     1191  std::ostream* os = new std::ofstream(file_name.c_str());
     1192  if (!(*os)) {
     1193    delete os;
     1194    throw IoError(file_name, "Cannot write file");
     1195  }
    11851196  return GraphToEps<DefaultGraphToEpsTraits<G> >
    1186     (DefaultGraphToEpsTraits<G>(g,*new std::ofstream(file_name.c_str()),true));
     1197    (DefaultGraphToEpsTraits<G>(g,*os,true));
    11871198}
    11881199
Note: See TracChangeset for help on using the changeset viewer.