Files
xkblayout-state/X11Exception.h
selurvedu 2602e1710f Fix issues found by Cppcheck
These include:

  - [X11Exception.h:16]: Class 'X11Exception' has a constructor
    with 1 argument that is not explicit.

  - [wrapper.cpp:62]: Array index 'i' is used before limits check.

  - [wrapper.cpp:183]: Exception should be caught by reference.
2015-07-27 22:02:07 +00:00

29 lines
738 B
C++

// X11Exception.h
// C++ exception that wraps X11 errors.
// Copyright (C) 2008 Jay Bromley <jbromley@gmail.com>
//
// $Id: X11Exception.h 26 2008-04-09 08:47:11Z jay $
#ifndef X11EXCEPTION_H_FE39A315_6827_447B_AE62_5FA2C3FD391F
#define X11EXCEPTION_H_FE39A315_6827_447B_AE62_5FA2C3FD391F
#include <exception>
class X11Exception : public std::exception
{
public:
X11Exception() : _reason("unknown") {}
explicit X11Exception(const std::string& what) : _reason(what) {}
virtual ~X11Exception() throw () {};
virtual const char* what() const throw () { return _reason.c_str(); }
private:
std::string _reason;
};
#endif // X11EXCEPTION_H_FE39A315_6827_447B_AE62_5FA2C3FD391F
// Local Variables:
// mode: c++
// End: