# serial: serial::IOException Class Reference

serial 1.0 Cross-platformserialportlibraryforC++

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Data Fields

All Data Structures Namespaces Files Functions Enumerations Enumerator Defines
Public Member Functions
serial::IOException Class Reference

`#include <serial.h>`

## Public Member Functions

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

## Constructor & Destructor Documentation

serial::IOException::IOException | ( | std::string | file,
|  | int | line,
|  | int | errnum
| ) |  | `[inline, explicit]`

      : file_(file), line_(line), e_what_ (strerror (errnum)), errno_(errnum) {}

serial::IOException::IOException | ( | std::string | file,
|  | int | line,
|  | const char * | description
| ) |  | `[inline, explicit]`

      : file_(file), line_(line), e_what_ (description), errno_(0) {}

virtual serial::IOException::~IOException | ( |  | ) | throw ()`[inline, virtual]`

    {}

## Member Function Documentation

int serial::IOException::getErrorNumber | ( |  | ) | `[inline]`

    { return errno_; }

virtual const char* serial::IOException::what | ( |  | ) | const throw ()`[inline, virtual]`

      {
        std::stringstream ss;
        if (errno_ == 0)
          ss << "IO Exception: " << e_what_;
        else
          ss << "IO Exception (" << errno_ << "): " << e_what_;
        ss << ", file " << file_ << ", line " << line_ << ".";
        return ss.str ().c_str ();
      }

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

- include/serial/serial.h