source: pacpusframework/branches/2.0-beta1/3rd/apache-log4cxx/include/log4cxx/pattern/formattinginfo.h@ 89

Last change on this file since 89 was 89, checked in by morasjul, 11 years ago

PACPUS 2.0 Beta deployed in new branch

Major changes:
-Add communication interface between components
-Add examples for communications interface (TestComponents)
-Move to Qt5 support

  • Property svn:executable set to *
File size: 2.6 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _LOG4CXX_HELPER_FORMATTING_INFO_H
19#define _LOG4CXX_HELPER_FORMATTING_INFO_H
20
21
22#include <log4cxx/helpers/objectimpl.h>
23#include <log4cxx/logstring.h>
24
25namespace log4cxx {
26 namespace pattern {
27
28
29class FormattingInfo;
30typedef helpers::ObjectPtrT<FormattingInfo> FormattingInfoPtr;
31
32
33/**
34 * Modifies the output of a pattern converter for a specified minimum
35 * and maximum width and alignment.
36 *
37 *
38 *
39 *
40 */
41class LOG4CXX_EXPORT FormattingInfo : public virtual log4cxx::helpers::ObjectImpl {
42
43 /**
44 * Minimum length.
45 */
46 const int minLength;
47
48 /**
49 * Maximum length.
50 */
51 const int maxLength;
52
53 /**
54 * Alignment.
55 */
56 const bool leftAlign;
57
58public:
59DECLARE_ABSTRACT_LOG4CXX_OBJECT(FormattingInfo)
60BEGIN_LOG4CXX_CAST_MAP()
61 LOG4CXX_CAST_ENTRY(FormattingInfo)
62END_LOG4CXX_CAST_MAP()
63
64
65 /**
66 * Creates new instance.
67 * @param leftAlign left align if true.
68 * @param minLength minimum length.
69 * @param maxLength maximum length.
70 */
71FormattingInfo(
72 const bool leftAlign, const int minLength, const int maxLength);
73
74 /**
75 * Gets default instance.
76 * @return default instance.
77 */
78static FormattingInfoPtr getDefault();
79
80 /**
81 * Determine if left aligned.
82 * @return true if left aligned.
83 */
84inline bool isLeftAligned() const {
85 return leftAlign;
86}
87
88 /**
89 * Get minimum length.
90 * @return minimum length.
91 */
92inline int getMinLength() const {
93 return minLength;
94}
95
96 /**
97 * Get maximum length.
98 * @return maximum length.
99 */
100inline int getMaxLength() const {
101 return maxLength;
102}
103
104 /**
105 * Adjust the content of the buffer based on the specified lengths and alignment.
106 *
107 * @param fieldStart start of field in buffer.
108 * @param buffer buffer to be modified.
109 */
110void format(const int fieldStart, LogString& buffer) const;
111};
112LOG4CXX_PTR_DEF(FormattingInfo);
113 }
114}
115
116
117#endif
Note: See TracBrowser for help on using the repository browser.