]> cygwin.com Git - cygwin-apps/cygutils.git/blob - src/lpr/PrinterException.hh
lump commit
[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 in version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 #if !defined(PrinterException_hh)
22 #define PrinterException_hh
23
24 #include <iostream>
25 #include <string>
26
27 using namespace std;
28
29 class PrinterException
30 {
31 public:
32 PrinterException()
33 : m_msg("")
34 {
35 }
36
37 PrinterException(const string & msg)
38 : m_msg(msg)
39 {
40 }
41
42 PrinterException(const PrinterException & rhs)
43 : m_msg(rhs.m_msg)
44 {
45 }
46
47 ~PrinterException()
48 {
49 }
50
51 PrinterException & operator = (const PrinterException & rhs)
52 {
53 if (this != &rhs)
54 m_msg = rhs.m_msg;
55 return *this;
56 }
57
58 const string & getMessage() const
59 {
60 return m_msg;
61 }
62
63 private:
64 string m_msg;
65 };
66
67 inline ostream & operator << (ostream & stream, const PrinterException & pe)
68 {
69 stream << pe.getMessage();
70 return stream;
71 }
72
73 #endif /* PrinterException_hh */
This page took 0.038784 seconds and 5 git commands to generate.