]> cygwin.com Git - cygwin-apps/cygutils.git/blob - src/lpr/PrinterException.hh
4595665061b908e8038f9aef1fd34da391250bf2
[cygwin-apps/cygutils.git] / src / lpr / PrinterException.hh
1 /*
2 * lpr for cygwin/windows
3 *
4 * Copyright (C) 2000-2003 Rick Rankin
5 * http://www.cygwin.com/ml/cygwin/2000-07/msg00320.html
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * See the COPYING file for full license information.
21 */
22
23 #if !defined(PrinterException_hh)
24 #define PrinterException_hh
25
26 #include <iostream>
27 #include <string>
28
29 using namespace std;
30
31 class PrinterException
32 {
33 public:
34 PrinterException()
35 : m_msg("")
36 {
37 }
38
39 PrinterException(const string & msg)
40 : m_msg(msg)
41 {
42 }
43
44 PrinterException(const PrinterException & rhs)
45 : m_msg(rhs.m_msg)
46 {
47 }
48
49 ~PrinterException()
50 {
51 }
52
53 PrinterException & operator = (const PrinterException & rhs)
54 {
55 if (this != &rhs)
56 m_msg = rhs.m_msg;
57 return *this;
58 }
59
60 const string & getMessage() const
61 {
62 return m_msg;
63 }
64
65 private:
66 string m_msg;
67 };
68
69 inline ostream & operator << (ostream & stream, const PrinterException & pe)
70 {
71 stream << pe.getMessage();
72 return stream;
73 }
74
75 #endif /* PrinterException_hh */
This page took 0.04339 seconds and 6 git commands to generate.