summaryrefslogtreecommitdiff
path: root/ext/Log4Qt/src/helpers/properties.h
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2014-07-14 17:19:45 +0200
committerTomasz Sterna <tomek@xiaoka.com>2014-07-16 00:07:28 +0200
commit3c19406ee292e0ed7993bd4d3976cc34d40e2f22 (patch)
tree67d185e95d647e56c074f4b3a30ac4f0d81e2ee6 /ext/Log4Qt/src/helpers/properties.h
parent630cc2e3097f2236a4c1191be6c955ec523d6f1a (diff)
Replaced ext/Log4Qt source with submodule
Diffstat (limited to 'ext/Log4Qt/src/helpers/properties.h')
-rwxr-xr-xext/Log4Qt/src/helpers/properties.h161
1 files changed, 0 insertions, 161 deletions
diff --git a/ext/Log4Qt/src/helpers/properties.h b/ext/Log4Qt/src/helpers/properties.h
deleted file mode 100755
index 0866431..0000000
--- a/ext/Log4Qt/src/helpers/properties.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/******************************************************************************
- *
- * package: Log4Qt
- * file: properties.h
- * created: September
- * author: Martin Heinrich
- *
- *
- * Copyright 2007 Martin Heinrich
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ******************************************************************************/
-
-#ifndef LOG4QT_PROPERTIES_H
-#define LOG4QT_PROPERTIES_H
-
-#include "../log4qtshared.h"
-/******************************************************************************
- * Dependencies
- ******************************************************************************/
-
-#include <QtCore/QHash>
-#include <QtCore/QStringList>
-
-
-/******************************************************************************
- * Declarations
- ******************************************************************************/
-
-class QIODevice;
-class QSettings;
-
-
-namespace Log4Qt
-{
- /*!
- * \brief The class Properties implements a JAVA property hash.
- */
- class LOG4QT_EXPORT Properties : public QHash<QString, QString>
- {
- public:
- Properties(Properties *pDefaultProperties = 0);
- // virtual ~Properties(); // Use compiler default
- // Properties(const Properties &rOther); // Use compiler default
- // Properties &operator=(const Properties &rOther); // Not implemented
-
- public:
- Properties *defaultProperties() const;
- QString property(const QString &rKey) const;
- QString property(const QString &rKey,
- const QString &rDefaultValue) const;
- void setDefaultProperties(Properties *pDefault);
- void setProperty(const QString &rKey,
- const QString &rValue);
-
- // JAVA: void list(QTextStream &rTextStream);
- void load(QIODevice *pDevice);
-
- /*!
- * Reads all child keys from the QSettings object \a rSettings and
- * inserts them into this object. The value is created using
- * QVariant::toString(). Types that do not support toString() are
- * resulting in an empty string.
- *
- * \code
- * QSettings settings;
- * settings.setValue("Package", "Full");
- * settings.setValue("Background", Qt::white);
- * settings.setValue("Support", true);
- * settings.setValue("Help/Language", "en_UK");
- *
- * Properties properties
- * properties.load(&settings)
- *
- * // properties (("Package", "Full"), ("Background", ""), ("Support", "true"))
- * \endcode
- */
- void load(const QSettings &rSettings);
-
- QStringList propertyNames() const;
- // JAVA: void save(QIODevice *pDevice) const;
-
- private:
- void parseProperty(const QString &rProperty,
- int line);
- static int hexDigitValue(const QChar &rDigit);
- static QString trimLeft(const QString &rString);
-
- private:
- Properties *mpDefaultProperties;
- static const char msEscapeChar;
- static const char *msValueEscapeCodes;
- static const char *msValueEscapeChars;
- static const char *msKeyEscapeCodes;
- static const char *msKeyEscapeChars;
- };
-
-
- /**************************************************************************
- * Operators, Helper
- **************************************************************************/
-
-#ifndef QT_NO_DEBUG_STREAM
- /*!
- * \relates Properties
- *
- * Writes all object member variables to the given debug stream \a rDebug and
- * returns the stream.
- *
- * <tt>
- * %Properties(default:0x0 properties:QHash(("log4j.appender.testAppender.layout", "org.apache.log4j.PatternLayout ")
- * ("log4j.appender.testAppender.layout.ConversionPattern", "[%t] %-5p %l: %m%n")
- * ("log4j.appender.testAppender.Append", "false ")
- * ("log4j.appender.testAppender.File", "output/temp ")
- * ("log4j.rootCategory", "TRACE, testAppender")
- * ("log4j.appender.testAppender", "org.apache.log4j.FileAppender")) )
- * </tt>
- * \sa QDebug
- */
- QDebug operator<<(QDebug debug,
- const Properties &rProperties);
-#endif // QT_NO_DEBUG_STREAM
-
-
- /**************************************************************************
- * Inline
- **************************************************************************/
-
- inline Properties::Properties(Properties *pDefaultProperties) :
- mpDefaultProperties(pDefaultProperties)
- {}
-
- inline Properties *Properties::defaultProperties() const
- { return mpDefaultProperties; }
-
- inline void Properties::setDefaultProperties(Properties *pDefaultProperties)
- { mpDefaultProperties = pDefaultProperties; }
-
- inline void Properties::setProperty(const QString &rKey,
- const QString &rValue)
- { insert(rKey, rValue); }
-
-
-} // namespace Log4Qt
-
-
-Q_DECLARE_TYPEINFO(Log4Qt::Properties, Q_MOVABLE_TYPE);
-
-
-#endif // LOG4QT_PROPERTIES_H