]> git.lyx.org Git - lyx.git/blob - src/PrinterParams.cpp
'using namespace std' instead of 'using std::xxx'
[lyx.git] / src / PrinterParams.cpp
1 /**
2  * \file PrinterParams.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Allan Rae
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "PrinterParams.h"
14
15 #include "support/lstrings.h"
16
17 #include <boost/assert.hpp>
18
19
20 using namespace std;
21
22 namespace lyx {
23
24
25 PrinterParams::PrinterParams(Target t,
26                              string const & pname,
27                              string const & fname,
28                              bool all,
29                              unsigned int from,
30                              unsigned int to,
31                              bool odd,
32                              bool even,
33                              unsigned int copies,
34                              bool sorted,
35                              bool reverse)
36         : target(t),
37           printer_name(pname),
38           file_name(fname),
39           all_pages(all),
40           from_page(from),
41           to_page(to),
42           odd_pages(odd),
43           even_pages(even),
44           count_copies(copies),
45           sorted_copies(sorted),
46           reverse_order(reverse)
47 {
48         testInvariant();
49 }
50
51
52 PrinterParams::PrinterParams(PrinterParams const & pp)
53         : target(pp.target),
54           printer_name(pp.printer_name),
55           file_name(pp.file_name),
56           all_pages(pp.all_pages),
57           from_page(pp.from_page),
58           to_page(pp.to_page),
59           odd_pages(pp.odd_pages),
60           even_pages(pp.even_pages),
61           count_copies(pp.count_copies),
62           sorted_copies(pp.sorted_copies),
63           reverse_order(pp.reverse_order)
64 {
65         testInvariant();
66 }
67
68
69 void PrinterParams::testInvariant() const
70 {
71 #ifdef ENABLE_ASSERTIONS
72         switch (target) {
73         case PRINTER:
74                 //BOOST_ASSERT(!printer_name.empty());
75                 break;
76         case FILE:
77                 BOOST_ASSERT(!file_name.empty());
78                 break;
79         default:
80                 BOOST_ASSERT(false);
81                 break;
82         }
83 #endif
84 }
85
86
87 } // namespace lyx