OFFIS DCMTK  Version 3.6.0
layout.h
Go to the documentation of this file.
1 // Module: Log4CPLUS
2 // File: Layout.h
3 // Created: 6/2001
4 // Author: Tad E. Smith
5 //
6 //
7 // Copyright 2001-2009 Tad E. Smith
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 
23 #ifndef _LOG4CPLUS_LAYOUT_HEADER_
24 #define _LOG4CPLUS_LAYOUT_HEADER_
25 
26 #include "dcmtk/oflog/config.h"
27 #include "dcmtk/oflog/loglevel.h"
28 #include "dcmtk/oflog/streams.h"
29 #include "dcmtk/oflog/tstring.h"
34 
35 //#include <vector>
36 
37 
38 namespace log4cplus {
39 
40  // Forward Declarations
41  namespace pattern {
42  class PatternConverter;
43  }
44 
45 
50  class LOG4CPLUS_EXPORT Layout : protected :: log4cplus::helpers::LogLogUser {
51  public:
52  Layout() : llmCache(getLogLevelManager()) {}
54  : llmCache(getLogLevelManager()) {}
55  virtual ~Layout() {}
56 
57  virtual void formatAndAppend(log4cplus::tostream& output,
58  const log4cplus::spi::InternalLoggingEvent& event) = 0;
59  protected:
60  LogLevelManager& llmCache;
61 
62  private:
63  // Disable copy
64  Layout(const Layout&);
65  Layout& operator=(Layout&);
66  };
67 
68 
69 
80  class LOG4CPLUS_EXPORT SimpleLayout : public Layout {
81  public:
82  SimpleLayout() {}
83  SimpleLayout(const log4cplus::helpers::Properties& properties, log4cplus::tstring&) : Layout(properties) {}
84 
85  virtual void formatAndAppend(log4cplus::tostream& output,
87 
88  private:
89  // Disallow copying of instances of this class
90  SimpleLayout(const SimpleLayout&);
91  SimpleLayout& operator=(const SimpleLayout&);
92  };
93 
94 
95 
132  class LOG4CPLUS_EXPORT TTCCLayout : public Layout {
133  public:
134  // Ctor and dtor
135  TTCCLayout(bool use_gmtime = false);
137  virtual ~TTCCLayout();
138 
139  virtual void formatAndAppend(log4cplus::tostream& output,
141 
142  protected:
143  log4cplus::tstring dateFormat;
144  bool use_gmtime;
145 
146  private:
147  // Disallow copying of instances of this class
148  TTCCLayout(const TTCCLayout&);
149  TTCCLayout& operator=(const TTCCLayout&);
150  };
151 
152 
153 
154 
514  class LOG4CPLUS_EXPORT PatternLayout : public Layout {
515  public:
516  // Ctors and dtor
517  PatternLayout(const log4cplus::tstring& pattern, bool formatEachLine = true);
519  virtual ~PatternLayout();
520 
521  virtual void formatAndAppend(log4cplus::tostream& output,
523 
524  protected:
525  void init(const log4cplus::tstring& pattern, bool formatEachLine);
526 
527  // Data
528  log4cplus::tstring pattern;
529  bool formatEachLine;
531 
532  private:
533  // Disallow copying of instances of this class
535  PatternLayout& operator=(const PatternLayout&);
536  };
537 
538 
539 
540 } // end namespace log4cplus
541 
542 #endif // _LOG4CPLUS_LAYOUT_HEADER_
543 


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