serial  1.2.1
Cross-platform, serial port library written in C++
Public Member Functions
serial::IOException Class Reference

#include <serial.h>

Inheritance diagram for serial::IOException:
Inheritance graph
[legend]
Collaboration diagram for serial::IOException:
Collaboration graph
[legend]

Public Member Functions

 IOException (std::string file, int line, int errnum)
 
 IOException (std::string file, int line, const char *description)
 
virtual ~IOException () throw ()
 
 IOException (const IOException &other)
 
int getErrorNumber () const
 
virtual const char * what () const throw ()
 

Constructor & Destructor Documentation

serial::IOException::IOException ( std::string  file,
int  line,
int  errnum 
)
inlineexplicit
700  : file_(file), line_(line), errno_(errnum) {
701  std::stringstream ss;
702 #if defined(_WIN32) && !defined(__MINGW32__)
703  char error_str [1024];
704  strerror_s(error_str, 1024, errnum);
705 #else
706  char * error_str = strerror(errnum);
707 #endif
708  ss << "IO Exception (" << errno_ << "): " << error_str;
709  ss << ", file " << file_ << ", line " << line_ << ".";
710  e_what_ = ss.str();
711  }
serial::IOException::IOException ( std::string  file,
int  line,
const char *  description 
)
inlineexplicit
713  : file_(file), line_(line), errno_(0) {
714  std::stringstream ss;
715  ss << "IO Exception: " << description;
716  ss << ", file " << file_ << ", line " << line_ << ".";
717  e_what_ = ss.str();
718  }
virtual serial::IOException::~IOException ( )
throw (
)
inlinevirtual
719 {}
serial::IOException::IOException ( const IOException other)
inline
720 : line_(other.line_), e_what_(other.e_what_), errno_(other.errno_) {}

Member Function Documentation

int serial::IOException::getErrorNumber ( ) const
inline
722 { return errno_; }
virtual const char* serial::IOException::what ( ) const
throw (
)
inlinevirtual
724  {
725  return e_what_.c_str();
726  }

The documentation for this class was generated from the following file: