OFFIS DCMTK  Version 3.6.0
winconap.h
1 // Copyright (C) 2009, Vaclav Haisman. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without modifica-
4 // tion, are permitted provided that the following conditions are met:
5 //
6 // 1. Redistributions of source code must retain the above copyright notice,
7 // this list of conditions and the following disclaimer.
8 //
9 // 2. Redistributions in binary form must reproduce the above copyright notice,
10 // this list of conditions and the following disclaimer in the documentation
11 // and/or other materials provided with the distribution.
12 //
13 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
14 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
15 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
16 // APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
17 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
18 // DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
19 // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 
24 #ifndef LOG4CPLUS_WIN32CONSOLEAPPENDER_H
25 #define LOG4CPLUS_WIN32CONSOLEAPPENDER_H
26 
27 
28 #include "dcmtk/oflog/config.h"
29 #if defined(_WIN32) && defined (LOG4CPLUS_HAVE_WIN32_CONSOLE)
30 
31 #include "dcmtk/oflog/appender.h"
33 
34 
35 namespace log4cplus
36 {
37 
50  class LOG4CPLUS_EXPORT Win32ConsoleAppender
51  : public Appender
52  {
53  public:
54  explicit Win32ConsoleAppender (bool allocConsole = true);
55  Win32ConsoleAppender (helpers::Properties const & properties, tstring& error);
56  virtual ~Win32ConsoleAppender ();
57 
58  virtual void close ();
59 
60  protected:
61  virtual void append (spi::InternalLoggingEvent const &);
62 
63  void write_handle (HANDLE, tchar const *, size_t);
64  void write_console (HANDLE, tchar const *, size_t);
65 
66  bool alloc_console;
67 
68  private:
69  Win32ConsoleAppender (Win32ConsoleAppender const &);
70  Win32ConsoleAppender & operator = (Win32ConsoleAppender const &);
71  };
72 
73 } // namespace log4cplus
74 
75 #endif
76 
77 #endif // LOG4CPLUS_WIN32CONSOLEAPPENDER_H


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2