├── README.md ├── project └── autoUpdate │ ├── bin │ ├── debug │ │ ├── config │ │ │ └── AutoUpdateLog.conf │ │ ├── liteunzip.dll │ │ └── log4cxx.dll │ └── release │ │ ├── config │ │ └── AutoUpdateLog.conf │ │ ├── liteunzip.dll │ │ └── log4cxx.dll │ ├── include │ ├── LiteUnzip │ │ └── LiteUnzip.h │ ├── curl │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlbuild.h.cmake │ │ ├── curlbuild.h.in │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ ├── gtest │ │ ├── gtest-death-test.h │ │ ├── gtest-message.h │ │ ├── gtest-param-test.h │ │ ├── gtest-param-test.h.pump │ │ ├── gtest-printers.h │ │ ├── gtest-spi.h │ │ ├── gtest-test-part.h │ │ ├── gtest-typed-test.h │ │ ├── gtest.h │ │ ├── gtest_pred_impl.h │ │ ├── gtest_prod.h │ │ └── internal │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ └── log4cxx │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── appender.h │ │ ├── appenderskeleton.h │ │ ├── asyncappender.h │ │ ├── basicconfigurator.h │ │ ├── config │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── propertysetter.h │ │ ├── config_msvc.h.in │ │ ├── consoleappender.h │ │ ├── dailyrollingfileappender.h │ │ ├── db │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── odbcappender.h │ │ ├── defaultconfigurator.h │ │ ├── defaultloggerfactory.h │ │ ├── file.h │ │ ├── fileappender.h │ │ ├── filter │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── andfilter.h │ │ ├── denyallfilter.h │ │ ├── expressionfilter.h │ │ ├── levelmatchfilter.h │ │ ├── levelrangefilter.h │ │ ├── locationinfofilter.h │ │ ├── mapfilter.h │ │ ├── propertyfilter.h │ │ └── stringmatchfilter.h │ │ ├── helpers │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── absolutetimedateformat.h │ │ ├── appenderattachableimpl.h │ │ ├── aprinitializer.h │ │ ├── bufferedoutputstream.h │ │ ├── bufferedwriter.h │ │ ├── bytearrayinputstream.h │ │ ├── bytearrayoutputstream.h │ │ ├── bytebuffer.h │ │ ├── cacheddateformat.h │ │ ├── charsetdecoder.h │ │ ├── charsetencoder.h │ │ ├── class.h │ │ ├── classregistration.h │ │ ├── condition.h │ │ ├── cyclicbuffer.h │ │ ├── datagrampacket.h │ │ ├── datagramsocket.h │ │ ├── date.h │ │ ├── dateformat.h │ │ ├── datelayout.h │ │ ├── datetimedateformat.h │ │ ├── exception.h │ │ ├── fileinputstream.h │ │ ├── fileoutputstream.h │ │ ├── filewatchdog.h │ │ ├── inetaddress.h │ │ ├── inputstream.h │ │ ├── inputstreamreader.h │ │ ├── integer.h │ │ ├── iso8601dateformat.h │ │ ├── loader.h │ │ ├── locale.h │ │ ├── loglog.h │ │ ├── messagebuffer.h │ │ ├── mutex.h │ │ ├── object.h │ │ ├── objectimpl.h │ │ ├── objectoutputstream.h │ │ ├── objectptr.h │ │ ├── onlyonceerrorhandler.h │ │ ├── optionconverter.h │ │ ├── outputstream.h │ │ ├── outputstreamwriter.h │ │ ├── pool.h │ │ ├── properties.h │ │ ├── propertyresourcebundle.h │ │ ├── reader.h │ │ ├── relativetimedateformat.h │ │ ├── resourcebundle.h │ │ ├── serversocket.h │ │ ├── simpledateformat.h │ │ ├── socket.h │ │ ├── socketoutputstream.h │ │ ├── strftimedateformat.h │ │ ├── strictmath.h │ │ ├── stringhelper.h │ │ ├── stringtokenizer.h │ │ ├── synchronized.h │ │ ├── syslogwriter.h │ │ ├── system.h │ │ ├── systemerrwriter.h │ │ ├── systemoutwriter.h │ │ ├── tchar.h │ │ ├── thread.h │ │ ├── threadlocal.h │ │ ├── threadspecificdata.h │ │ ├── timezone.h │ │ ├── transcoder.h │ │ ├── transform.h │ │ ├── writer.h │ │ └── xml.h │ │ ├── hierarchy.h │ │ ├── htmllayout.h │ │ ├── layout.h │ │ ├── level.h │ │ ├── log4cxx.h │ │ ├── log4cxx.h.in │ │ ├── log4cxx.hw │ │ ├── logger.h │ │ ├── logmanager.h │ │ ├── logstring.h │ │ ├── mdc.h │ │ ├── ndc.h │ │ ├── net │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── smtpappender.h │ │ ├── socketappender.h │ │ ├── socketappenderskeleton.h │ │ ├── sockethubappender.h │ │ ├── syslogappender.h │ │ ├── telnetappender.h │ │ └── xmlsocketappender.h │ │ ├── nt │ │ ├── EventLogCategories.mc │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── nteventlogappender.h │ │ └── outputdebugstringappender.h │ │ ├── pattern │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── classnamepatternconverter.h │ │ ├── datepatternconverter.h │ │ ├── filedatepatternconverter.h │ │ ├── filelocationpatternconverter.h │ │ ├── formattinginfo.h │ │ ├── fulllocationpatternconverter.h │ │ ├── integerpatternconverter.h │ │ ├── levelpatternconverter.h │ │ ├── linelocationpatternconverter.h │ │ ├── lineseparatorpatternconverter.h │ │ ├── literalpatternconverter.h │ │ ├── loggerpatternconverter.h │ │ ├── loggingeventpatternconverter.h │ │ ├── messagepatternconverter.h │ │ ├── methodlocationpatternconverter.h │ │ ├── nameabbreviator.h │ │ ├── namepatternconverter.h │ │ ├── ndcpatternconverter.h │ │ ├── patternconverter.h │ │ ├── patternparser.h │ │ ├── propertiespatternconverter.h │ │ ├── relativetimepatternconverter.h │ │ ├── threadpatternconverter.h │ │ └── throwableinformationpatternconverter.h │ │ ├── patternlayout.h │ │ ├── portability.h │ │ ├── private │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── log4cxx_private.h │ │ ├── log4cxx_private.h.in │ │ └── log4cxx_private.hw │ │ ├── propertyconfigurator.h │ │ ├── provisionnode.h │ │ ├── rolling │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── action.h │ │ ├── filerenameaction.h │ │ ├── filterbasedtriggeringpolicy.h │ │ ├── fixedwindowrollingpolicy.h │ │ ├── gzcompressaction.h │ │ ├── manualtriggeringpolicy.h │ │ ├── rollingfileappender.h │ │ ├── rollingfileappenderskeleton.h │ │ ├── rollingpolicy.h │ │ ├── rollingpolicybase.h │ │ ├── rolloverdescription.h │ │ ├── sizebasedtriggeringpolicy.h │ │ ├── timebasedrollingpolicy.h │ │ ├── triggeringpolicy.h │ │ └── zipcompressaction.h │ │ ├── rollingfileappender.h │ │ ├── simplelayout.h │ │ ├── spi │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── appenderattachable.h │ │ ├── configurator.h │ │ ├── defaultrepositoryselector.h │ │ ├── errorhandler.h │ │ ├── filter.h │ │ ├── hierarchyeventlistener.h │ │ ├── location │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ └── locationinfo.h │ │ ├── loggerfactory.h │ │ ├── loggerrepository.h │ │ ├── loggingevent.h │ │ ├── optionhandler.h │ │ ├── repositoryselector.h │ │ ├── rootlogger.h │ │ └── triggeringeventevaluator.h │ │ ├── stream.h │ │ ├── ttcclayout.h │ │ ├── varia │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ └── fallbackerrorhandler.h │ │ ├── writerappender.h │ │ └── xml │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── domconfigurator.h │ │ └── xmllayout.h │ ├── lib │ ├── debug │ │ ├── gtestd.lib │ │ ├── log4cxx.lib │ │ └── vc8libcurl.lib │ └── release │ │ ├── gtest.lib │ │ ├── log4cxx.lib │ │ └── vc8libcurl.lib │ ├── src │ ├── auto_update │ │ ├── IAutoUpdate.cpp │ │ ├── auto_update.cc │ │ ├── auto_update.h │ │ ├── dllmain.cpp │ │ ├── file_download.cc │ │ └── file_download.h │ └── common │ │ ├── EncodingConverter.h │ │ ├── TemplateTimer.h │ │ ├── atomic.h │ │ ├── behavior.h │ │ ├── config_file.h │ │ ├── defines.h │ │ ├── guard.cc │ │ ├── guard.h │ │ ├── init_configure.cc │ │ ├── init_configure.h │ │ ├── md5.cc │ │ ├── md5.h │ │ ├── md5_expand.cc │ │ ├── md5_expand.h │ │ ├── mini_dump.cpp │ │ ├── mini_dump.h │ │ ├── password_md5crypt.cpp │ │ ├── password_md5crypt.h │ │ ├── path_utils.h │ │ ├── threadSafe_list.h │ │ └── utils.h │ └── vcprojects │ ├── IAutoUpdate │ ├── IAutoUpdate.vcproj │ ├── resource.h │ └── resource_temp.h │ ├── UnitTestAutoUpdate │ ├── UnitTestAutoUpdate.cpp │ ├── UnitTestAutoUpdate.vcproj │ └── autoUpdate_test.cc │ └── autoUpdate.sln ├── script ├── python │ ├── packet1.py │ ├── packet2.py │ └── packet3.py ├── shell │ ├── bakup.sh │ ├── check_process.sh │ ├── delouttime_file.sh │ ├── kill_process.sh │ ├── mysql_backup.sh │ ├── process_monitor.sh │ └── run_process.sh └── windows-bat │ ├── KillTest.bat │ ├── RunbatchTest.bat │ └── killcmd.bat └── src ├── algorithm ├── md5.cc ├── md5.h ├── password_md5crypt.cpp └── password_md5crypt.h ├── common ├── EncodingConverter.h ├── config_file.h ├── guard.cc ├── guard.h ├── mini_dump.cpp ├── mini_dump.h ├── path_utils.h ├── platform_log_defines.h ├── socket_common.h ├── str_utils.h ├── threadSafe_container.h └── time_utils.h ├── sql ├── sql_conn_pool.cc ├── sql_conn_pool.h └── sql_utils.h └── timer ├── TemplateTimer.h ├── Timer.c ├── asio_timer.cc └── libevent_timer.h /README.md: -------------------------------------------------------------------------------- 1 | 2 | #### src(C/C++的常用工具类) 3 | 4 | * md5实现; 5 | * md5+salt实现密码; 6 | * 读取、设置配置文件的一个通用实现; 7 | * 线程安全的容器; 8 | * mysql数据库连接池的实现; 9 | * 拼接sql组合查询字符串; 10 | * windows平台下的编码类型转换; 11 | * 标准string的通用方法; 12 | * 程序崩溃时生成dump文件以供windbg作分析; 13 | * windows路径工具类; 14 | * 互斥量封装; 15 | * 时间操作工具类; 16 | * 定时器 17 | * 跨平台(linux,windows,ios,android)日志头文件 18 | 19 | ### script 20 | 21 | * windows平台下批量运行exe及终止脚本 22 | 23 | * Jenkins打包部分的python脚本 24 | 25 | ### project 26 | 27 | * windows系统下自动升级接口,包括利用curl库的下载,md5校验文件,解压zip 28 | 29 | 30 | -------------------------------------------------------------------------------- /project/autoUpdate/bin/debug/config/AutoUpdateLog.conf: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=TRACE, stdout, logfile 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 6 | 7 | log4j.appender.logfile=org.apache.log4j.RollingFileAppender 8 | log4j.appender.logfile.File=./autoUpdate.log 9 | log4j.appender.logfile.Append=false 10 | log4j.appender.logfile.MaxFileSize=100KB 11 | log4j.appender.logfile.MaxBackupIndex=10 12 | log4j.appender.logfile.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.logfile.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -------------------------------------------------------------------------------- /project/autoUpdate/bin/debug/liteunzip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/bin/debug/liteunzip.dll -------------------------------------------------------------------------------- /project/autoUpdate/bin/debug/log4cxx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/bin/debug/log4cxx.dll -------------------------------------------------------------------------------- /project/autoUpdate/bin/release/config/AutoUpdateLog.conf: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=TRACE, stdout, logfile 2 | 3 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 4 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 5 | log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n 6 | 7 | log4j.appender.logfile=org.apache.log4j.RollingFileAppender 8 | log4j.appender.logfile.File=./autoUpdate.log 9 | log4j.appender.logfile.Append=false 10 | log4j.appender.logfile.MaxFileSize=100KB 11 | log4j.appender.logfile.MaxBackupIndex=10 12 | log4j.appender.logfile.layout=org.apache.log4j.PatternLayout 13 | log4j.appender.logfile.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -------------------------------------------------------------------------------- /project/autoUpdate/bin/release/liteunzip.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/bin/release/liteunzip.dll -------------------------------------------------------------------------------- /project/autoUpdate/bin/release/log4cxx.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/bin/release/log4cxx.dll -------------------------------------------------------------------------------- /project/autoUpdate/include/curl/Makefile.am: -------------------------------------------------------------------------------- 1 | #*************************************************************************** 2 | # _ _ ____ _ 3 | # Project ___| | | | _ \| | 4 | # / __| | | | |_) | | 5 | # | (__| |_| | _ <| |___ 6 | # \___|\___/|_| \_\_____| 7 | # 8 | # Copyright (C) 1998 - 2011, Daniel Stenberg, , et al. 9 | # 10 | # This software is licensed as described in the file COPYING, which 11 | # you should have received as part of this distribution. The terms 12 | # are also available at http://curl.haxx.se/docs/copyright.html. 13 | # 14 | # You may opt to use, copy, modify, merge, publish, distribute and/or sell 15 | # copies of the Software, and permit persons to whom the Software is 16 | # furnished to do so, under the terms of the COPYING file. 17 | # 18 | # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 | # KIND, either express or implied. 20 | # 21 | ########################################################################### 22 | pkginclude_HEADERS = \ 23 | curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \ 24 | typecheck-gcc.h curlbuild.h curlrules.h 25 | 26 | pkgincludedir= $(includedir)/curl 27 | 28 | # curlbuild.h does not exist in the git tree. When the original libcurl 29 | # source code distribution archive file is created, curlbuild.h.dist is 30 | # renamed to curlbuild.h and included in the tarball so that it can be 31 | # used directly on non-configure systems. 32 | # 33 | # The distributed curlbuild.h will be overwritten on configure systems 34 | # when the configure script runs, with one that is suitable and specific 35 | # to the library being configured and built. 36 | # 37 | # curlbuild.h.in is the distributed template file from which the configure 38 | # script creates curlbuild.h at library configuration time, overwiting the 39 | # one included in the distribution archive. 40 | # 41 | # curlbuild.h.dist is not included in the source code distribution archive. 42 | 43 | EXTRA_DIST = curlbuild.h.in 44 | 45 | DISTCLEANFILES = curlbuild.h 46 | 47 | checksrc: 48 | @@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST) 49 | 50 | if CURLDEBUG 51 | # for debug builds, we scan the sources on all regular make invokes 52 | all-local: checksrc 53 | endif 54 | -------------------------------------------------------------------------------- /project/autoUpdate/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread (void *, size_t, size_t, FILE *); 28 | size_t fwrite (const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /project/autoUpdate/include/gtest/gtest_prod.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: wan@google.com (Zhanyong Wan) 31 | // 32 | // Google C++ Testing Framework definitions useful in production code. 33 | 34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 36 | 37 | // When you need to test the private or protected members of a class, 38 | // use the FRIEND_TEST macro to declare your tests as friends of the 39 | // class. For example: 40 | // 41 | // class MyClass { 42 | // private: 43 | // void MyMethod(); 44 | // FRIEND_TEST(MyClassTest, MyMethod); 45 | // }; 46 | // 47 | // class MyClassTest : public testing::Test { 48 | // // ... 49 | // }; 50 | // 51 | // TEST_F(MyClassTest, MyMethod) { 52 | // // Can call MyClass::MyMethod() here. 53 | // } 54 | 55 | #define FRIEND_TEST(test_case_name, test_name)\ 56 | friend class test_case_name##_##test_name##_Test 57 | 58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ 59 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | SUBDIRS = helpers net nt rolling spi varia xml config db private pattern filter 17 | log4cxxincdir = $(includedir)/log4cxx 18 | log4cxxinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/*.h log4cxx.h 19 | DISTCLEANFILES = log4cxx.h 20 | EXTRA_DIST = log4cxx.hw 21 | 22 | dist-hook: 23 | -rm -f $(distdir)/log4cxx.h 24 | 25 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/basicconfigurator.h: -------------------------------------------------------------------------------- 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_BASIC_CONFIGURATOR_H 19 | #define _LOG4CXX_BASIC_CONFIGURATOR_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace log4cxx 28 | { 29 | class Appender; 30 | typedef helpers::ObjectPtrT AppenderPtr; 31 | 32 | /** 33 | Use this class to quickly configure the package. 34 |

For file based configuration see 35 | PropertyConfigurator. For XML based configuration see 36 | DOMConfigurator. 37 | */ 38 | class LOG4CXX_EXPORT BasicConfigurator 39 | { 40 | protected: 41 | BasicConfigurator() {} 42 | 43 | public: 44 | /** 45 | Add a ConsoleAppender that uses PatternLayout 46 | using the PatternLayout#TTCC_CONVERSION_PATTERN and 47 | prints to stdout to the root logger.*/ 48 | static void configure(); 49 | 50 | /** 51 | Add appender to the root logger. 52 | @param appender The appender to add to the root logger. 53 | */ 54 | static void configure(const AppenderPtr& appender); 55 | 56 | /** 57 | Reset the default hierarchy to its defaut. It is equivalent to 58 | calling 59 | Logger::getDefaultHierarchy()->resetConfiguration(). 60 | See Hierarchy#resetConfiguration() for more details. */ 61 | static void resetConfiguration(); 62 | }; // class BasicConfigurator 63 | } // namespace log4cxx 64 | 65 | #endif //_LOG4CXX_BASIC_CONFIGURATOR_H 66 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/config/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | configincdir = $(includedir)/log4cxx/config 17 | configinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/config/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/config_msvc.h.in: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one or more 2 | * contributor license agreements. See the NOTICE file distributed with 3 | * this work for additional information regarding copyright ownership. 4 | * The ASF licenses this file to You under the Apache License, Version 2.0 5 | * (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /* Name of package */ 17 | #define PACKAGE "log4cxx" 18 | 19 | /* Version number of package */ 20 | #define VERSION "@VERSION@" 21 | 22 | /* Define to 1 if you have the `ftime' function. */ 23 | #define LOG4CXX_HAVE_FTIME 1 24 | 25 | /* ODBC support through Microsoft ODBC. */ 26 | #define LOG4CXX_HAVE_MS_ODBC 1 27 | 28 | /* thread support through Microsoft threads. */ 29 | #define LOG4CXX_HAVE_MS_THREAD 1 30 | 31 | /* ODBC support */ 32 | #define LOG4CXX_HAVE_ODBC 1 33 | 34 | /* thread support */ 35 | #define LOG4CXX_HAVE_THREAD 1 36 | 37 | typedef __int64 int64_t; 38 | 39 | #if defined(WIN32) || defined(_WIN32) 40 | #pragma warning(disable : 4250 4251 4786 4290) 41 | #endif 42 | 43 | #ifdef LOG4CXX_STATIC 44 | #define LOG4CXX_EXPORT 45 | // cf. file msvc/static/static.cpp 46 | #pragma comment(linker, "/include:?ForceSymbolReferences@@YAXXZ") 47 | #else // DLL 48 | #ifdef LOG4CXX 49 | #define LOG4CXX_EXPORT __declspec(dllexport) 50 | #else 51 | #define LOG4CXX_EXPORT __declspec(dllimport) 52 | #endif 53 | #endif 54 | 55 | #if !defined(LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS) 56 | #if defined(_MSC_VER) 57 | #if _MSC_VER <= 1200 58 | #define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 1 59 | #else 60 | #define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 0 61 | #endif 62 | #else 63 | #define LOG4CXX_HAVE_OLD_WIN32_INTERLOCKS 0 64 | #endif 65 | #endif 66 | 67 | #define _WIN32_WINNT 0x0400 68 | 69 | #include 70 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/db/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | dbincdir = $(includedir)/log4cxx/db 17 | dbinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/db/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/defaultconfigurator.h: -------------------------------------------------------------------------------- 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_DEFAULT_CONFIGURATOR_H 19 | #define _LOG4CXX_DEFAULT_CONFIGURATOR_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace spi { 26 | class LoggerRepository; 27 | typedef helpers::ObjectPtrT LoggerRepositoryPtr; 28 | } 29 | 30 | /** 31 | * Configures the repository from environmental settings and files. 32 | * 33 | */ 34 | class LOG4CXX_EXPORT DefaultConfigurator 35 | { 36 | private: 37 | DefaultConfigurator() {} 38 | 39 | public: 40 | /** 41 | Add a ConsoleAppender that uses PatternLayout 42 | using the PatternLayout#TTCC_CONVERSION_PATTERN and 43 | prints to stdout to the root logger.*/ 44 | static void configure(log4cxx::spi::LoggerRepository*); 45 | 46 | private: 47 | static const LogString getConfigurationFileName(); 48 | static const LogString getConfiguratorClass(); 49 | 50 | 51 | 52 | }; // class DefaultConfigurator 53 | } // namespace log4cxx 54 | 55 | #endif //_LOG4CXX_DEFAULT_CONFIGURATOR_H 56 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/defaultloggerfactory.h: -------------------------------------------------------------------------------- 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_DEFAULT_LOGGER_FACTORY_H 19 | #define _LOG4CXX_DEFAULT_LOGGER_FACTORY_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | class Logger; 27 | typedef helpers::ObjectPtrT LoggerPtr; 28 | 29 | class LOG4CXX_EXPORT DefaultLoggerFactory : 30 | public virtual spi::LoggerFactory, 31 | public virtual helpers::ObjectImpl 32 | { 33 | public: 34 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(DefaultLoggerFactory) 35 | BEGIN_LOG4CXX_CAST_MAP() 36 | LOG4CXX_CAST_ENTRY(spi::LoggerFactory) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | virtual LoggerPtr makeNewLoggerInstance( 40 | log4cxx::helpers::Pool& pool, 41 | const LogString& name) const; 42 | }; 43 | } // namespace log4cxx 44 | 45 | #endif //_LOG4CXX_DEFAULT_LOGGER_FACTORY_H 46 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/filter/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | filterincdir = $(includedir)/log4cxx/filter 17 | filterinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/filter/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/filter/mapfilter.h: -------------------------------------------------------------------------------- 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 | #ifndef _LOG4CXX_FILTER_MAPFILTER_H 18 | #define _LOG4CXX_FILTER_MAPFILTER_H 19 | 20 | #include 21 | 22 | namespace log4cxx 23 | { 24 | namespace filter 25 | { 26 | 27 | 28 | class LOG4CXX_EXPORT MapFilter:public log4cxx::spi::Filter 29 | { 30 | public: 31 | DECLARE_LOG4CXX_OBJECT(MapFilter) 32 | BEGIN_LOG4CXX_CAST_MAP() 33 | LOG4CXX_CAST_ENTRY(log4cxx::spi::Filter) 34 | END_LOG4CXX_CAST_MAP() 35 | 36 | MapFilter(); 37 | 38 | 39 | FilterDecision decide(const spi::LoggingEventPtr & event) const; 40 | 41 | }; 42 | } 43 | } 44 | #endif 45 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | helpersincdir = $(includedir)/log4cxx/helpers 17 | helpersinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/helpers/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/absolutetimedateformat.h: -------------------------------------------------------------------------------- 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_HELPERS_ABSOLUTE_TIME_DATE_FORMAT_H 19 | #define _LOG4CXX_HELPERS_ABSOLUTE_TIME_DATE_FORMAT_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** 28 | Formats a date in the format HH:mm:ss,SSS for example, 29 | "15:49:37,459". 30 | */ 31 | class LOG4CXX_EXPORT AbsoluteTimeDateFormat : public SimpleDateFormat 32 | { 33 | public: 34 | AbsoluteTimeDateFormat() 35 | : SimpleDateFormat(LOG4CXX_STR("HH:mm:ss,SSS")) {} 36 | }; 37 | } // namespace helpers 38 | } // namespace log4cxx 39 | 40 | #endif // _LOG4CXX_HELPERS_ABSOLUTE_TIME_DATE_FORMAT_H 41 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/aprinitializer.h: -------------------------------------------------------------------------------- 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_HELPERS_APRINITIALIZER_H 19 | #define _LOG4CXX_HELPERS_APRINITIALIZER_H 20 | 21 | #ifndef LOG4CXX 22 | #error "aprinitializer.h should only be included by log4cxx implementation" 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | namespace log4cxx 30 | { 31 | namespace helpers 32 | { 33 | class APRInitializer 34 | { 35 | public: 36 | static log4cxx_time_t initialize(); 37 | static apr_pool_t* getRootPool(); 38 | static apr_threadkey_t* getTlsKey(); 39 | static bool isDestructed; 40 | 41 | private: 42 | APRInitializer(); 43 | APRInitializer(const APRInitializer&); 44 | APRInitializer& operator=(const APRInitializer&); 45 | apr_pool_t* p; 46 | log4cxx_time_t startTime; 47 | apr_threadkey_t* tlsKey; 48 | static APRInitializer& getInstance(); 49 | static void tlsDestruct(void*); 50 | 51 | public: 52 | ~APRInitializer(); 53 | }; 54 | } // namespace helpers 55 | } // namespace log4cxx 56 | 57 | #endif //_LOG4CXX_HELPERS_APRINITIALIZER_H 58 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/bufferedoutputstream.h: -------------------------------------------------------------------------------- 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_HELPERS_BUFFEREDOUTPUTSTREAM_H 19 | #define _LOG4CXX_HELPERS_BUFFEREDOUTPUTSTREAM_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace helpers { 27 | 28 | /** 29 | * Abstract class for writing to character streams. 30 | */ 31 | class LOG4CXX_EXPORT BufferedOutputStream : public OutputStream 32 | { 33 | private: 34 | size_t count; 35 | LogString buf; 36 | 37 | public: 38 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(BufferedOutputStream) 39 | BEGIN_LOG4CXX_CAST_MAP() 40 | LOG4CXX_CAST_ENTRY(BufferedOutputStream) 41 | LOG4CXX_CAST_ENTRY_CHAIN(OutputStream) 42 | END_LOG4CXX_CAST_MAP() 43 | 44 | protected: 45 | BufferedOutputStream(OutputStreamPtr& out, size_t size = 4096); 46 | ~BufferedOutputStream(); 47 | 48 | public: 49 | void close(Pool& p); 50 | void flush(Pool& p); 51 | void write(ByteBuffer& buf, Pool& p); 52 | 53 | private: 54 | BufferedOutputStream(const BufferedOutputStream&); 55 | BufferedOutputStream& operator=(const BufferedOutputStream&); 56 | }; 57 | 58 | LOG4CXX_PTR_DEF(BufferedOutputStream); 59 | } // namespace helpers 60 | 61 | } //namespace log4cxx 62 | 63 | #endif //_LOG4CXX_HELPERS_BUFFEREDOUTPUTSTREAM_H 64 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/bufferedwriter.h: -------------------------------------------------------------------------------- 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_HELPERS_BUFFEREDWRITER_H 19 | #define _LOG4CXX_HELPERS_BUFFEREDWRITER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace helpers { 27 | 28 | /** 29 | * Writes text to a character-output stream buffering 30 | * requests to increase efficiency. 31 | */ 32 | class LOG4CXX_EXPORT BufferedWriter : public Writer 33 | { 34 | private: 35 | WriterPtr out; 36 | size_t sz; 37 | LogString buf; 38 | 39 | public: 40 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(BufferedWriter) 41 | BEGIN_LOG4CXX_CAST_MAP() 42 | LOG4CXX_CAST_ENTRY(BufferedWriter) 43 | LOG4CXX_CAST_ENTRY_CHAIN(Writer) 44 | END_LOG4CXX_CAST_MAP() 45 | 46 | BufferedWriter(WriterPtr& out); 47 | BufferedWriter(WriterPtr& out, size_t sz); 48 | virtual ~BufferedWriter(); 49 | 50 | virtual void close(Pool& p); 51 | virtual void flush(Pool& p); 52 | virtual void write(const LogString& str, Pool& p); 53 | 54 | private: 55 | BufferedWriter(const BufferedWriter&); 56 | BufferedWriter& operator=(const BufferedWriter&); 57 | }; 58 | 59 | } // namespace helpers 60 | 61 | } //namespace log4cxx 62 | 63 | #endif //_LOG4CXX_HELPERS_BUFFEREDWRITER_H 64 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/bytebuffer.h: -------------------------------------------------------------------------------- 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_HELPERS_BYTEBUFFER_H 19 | #define _LOG4CXX_HELPERS_BYTEBUFFER_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | 27 | namespace helpers { 28 | 29 | /** 30 | * A byte buffer. 31 | */ 32 | class LOG4CXX_EXPORT ByteBuffer 33 | { 34 | private: 35 | char* base; 36 | size_t pos; 37 | size_t lim; 38 | size_t cap; 39 | 40 | public: 41 | ByteBuffer(char* data, size_t capacity); 42 | ~ByteBuffer(); 43 | 44 | void clear(); 45 | void flip(); 46 | 47 | inline char* data() { return base; } 48 | inline const char* data() const { return base; } 49 | inline char* current() { return base + pos; } 50 | inline const char* current() const { return base + pos; } 51 | inline size_t limit() const { return lim; } 52 | void limit(size_t newLimit); 53 | inline size_t position() const { return pos; } 54 | inline size_t remaining() const { return lim - pos; } 55 | void position(size_t newPosition); 56 | 57 | bool put(char byte); 58 | 59 | 60 | private: 61 | ByteBuffer(const ByteBuffer&); 62 | ByteBuffer& operator=(const ByteBuffer&); 63 | }; 64 | 65 | } // namespace helpers 66 | 67 | } //namespace log4cxx 68 | 69 | #endif //_LOG4CXX_HELPERS_BYTEBUFFER_H 70 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/class.h: -------------------------------------------------------------------------------- 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_HELPERS_CLASS_H 19 | #define _LOG4CXX_HELPERS_CLASS_H 20 | 21 | #if defined(_MSC_VER) 22 | #pragma warning (push) 23 | #pragma warning ( disable: 4231 4251 4275 4786 ) 24 | #endif 25 | 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | namespace log4cxx 32 | { 33 | namespace helpers 34 | { 35 | class Object; 36 | typedef ObjectPtrT ObjectPtr; 37 | 38 | 39 | class LOG4CXX_EXPORT Class 40 | { 41 | public: 42 | virtual ~Class(); 43 | virtual ObjectPtr newInstance() const; 44 | LogString toString() const; 45 | virtual LogString getName() const = 0; 46 | static const Class& forName(const LogString& className); 47 | static bool registerClass(const Class& newClass); 48 | 49 | protected: 50 | Class(); 51 | 52 | private: 53 | Class(const Class&); 54 | Class& operator=(const Class&); 55 | typedef std::map ClassMap; 56 | static ClassMap& getRegistry(); 57 | static void registerClasses(); 58 | }; 59 | } // namespace log4cxx 60 | } // namespace helper 61 | 62 | #if defined(_MSC_VER) 63 | #pragma warning (pop) 64 | #endif 65 | 66 | 67 | #endif //_LOG4CXX_HELPERS_CLASS_H 68 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/classregistration.h: -------------------------------------------------------------------------------- 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_HELPERS_CLASSREGISTRATION_H 19 | #define _LOG4CXX_HELPERS_CLASSREGISTRATION_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | class Class; 28 | class LOG4CXX_EXPORT ClassRegistration 29 | { 30 | public: 31 | typedef const Class& (*ClassAccessor)(); 32 | ClassRegistration(ClassAccessor classAccessor); 33 | 34 | private: 35 | ClassRegistration(const ClassRegistration&); 36 | ClassRegistration& operator=(const ClassRegistration&); 37 | }; 38 | } // namespace log4cxx 39 | } // namespace helper 40 | 41 | #endif //_LOG4CXX_HELPERS_CLASSREGISTRATION_H 42 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/date.h: -------------------------------------------------------------------------------- 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_HELPERS_DATE_H 19 | #define _LOG4CXX_HELPERS_DATE_H 20 | 21 | #include 22 | #include 23 | 24 | 25 | namespace log4cxx { 26 | namespace helpers { 27 | /** 28 | * Simple transcoder for converting between 29 | * external char and wchar_t strings and 30 | * internal strings. 31 | * 32 | */ 33 | class LOG4CXX_EXPORT Date : public ObjectImpl { 34 | const log4cxx_time_t time; 35 | 36 | public: 37 | DECLARE_LOG4CXX_OBJECT(Date) 38 | BEGIN_LOG4CXX_CAST_MAP() 39 | LOG4CXX_CAST_ENTRY(Date) 40 | END_LOG4CXX_CAST_MAP() 41 | 42 | Date(); 43 | Date(log4cxx_time_t time); 44 | virtual ~Date(); 45 | 46 | inline log4cxx_time_t getTime() const { 47 | return time; 48 | } 49 | 50 | /** 51 | * Get start of next second 52 | */ 53 | log4cxx_time_t getNextSecond() const; 54 | 55 | 56 | static log4cxx_time_t getMicrosecondsPerDay(); 57 | static log4cxx_time_t getMicrosecondsPerSecond(); 58 | 59 | }; 60 | 61 | LOG4CXX_PTR_DEF(Date); 62 | 63 | } 64 | } 65 | 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/datetimedateformat.h: -------------------------------------------------------------------------------- 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_HELPERS_DATE_TIME_DATE_FORMAT_H 19 | #define _LOG4CXX_HELPERS_DATE_TIME_DATE_FORMAT_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** 28 | Formats a date in the format dd MMM yyyy HH:mm:ss,SSS for example, 29 | "06 Nov 1994 15:49:37,459". 30 | */ 31 | class LOG4CXX_EXPORT DateTimeDateFormat : public SimpleDateFormat 32 | { 33 | public: 34 | DateTimeDateFormat() 35 | : SimpleDateFormat(LOG4CXX_STR("dd MMM yyyy HH:mm:ss,SSS")) {} 36 | DateTimeDateFormat(const std::locale* locale) 37 | : SimpleDateFormat(LOG4CXX_STR("dd MMM yyyy HH:mm:ss,SSS"), locale) {} 38 | }; 39 | } // namespace helpers 40 | } // namespace log4cxx 41 | 42 | #endif // _LOG4CXX_HELPERS_DATE_TIME_DATE_FORMAT_H 43 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/fileoutputstream.h: -------------------------------------------------------------------------------- 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_HELPERS_FILEOUTPUTSTREAM_H 19 | #define _LOG4CXX_HELPERS_FILEOUTPUTSTREAM_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | 26 | namespace log4cxx 27 | { 28 | 29 | namespace helpers { 30 | 31 | /** 32 | * OutputStream implemented on top of APR file IO. 33 | */ 34 | class LOG4CXX_EXPORT FileOutputStream : public OutputStream 35 | { 36 | private: 37 | Pool pool; 38 | apr_file_t* fileptr; 39 | 40 | public: 41 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(FileOutputStream) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(FileOutputStream) 44 | LOG4CXX_CAST_ENTRY_CHAIN(OutputStream) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | FileOutputStream(const LogString& filename, bool append = false); 48 | FileOutputStream(const logchar* filename, bool append = false); 49 | virtual ~FileOutputStream(); 50 | 51 | virtual void close(Pool& p); 52 | virtual void flush(Pool& p); 53 | virtual void write(ByteBuffer& buf, Pool& p); 54 | 55 | private: 56 | FileOutputStream(const FileOutputStream&); 57 | FileOutputStream& operator=(const FileOutputStream&); 58 | static apr_file_t* open(const LogString& fn, bool append, 59 | log4cxx::helpers::Pool& p); 60 | }; 61 | 62 | LOG4CXX_PTR_DEF(FileOutputStream); 63 | } // namespace helpers 64 | 65 | } //namespace log4cxx 66 | 67 | #endif //_LOG4CXX_HELPERS_FILEOUTPUTSTREAM_H 68 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/integer.h: -------------------------------------------------------------------------------- 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_HELPERS_INTEGER_H 19 | #define _LOG4CXX_HELPERS_INTEGER_H 20 | 21 | #include 22 | 23 | 24 | namespace log4cxx { 25 | namespace helpers { 26 | class LOG4CXX_EXPORT Integer : public ObjectImpl { 27 | const int val; 28 | public: 29 | DECLARE_LOG4CXX_OBJECT(Integer) 30 | BEGIN_LOG4CXX_CAST_MAP() 31 | LOG4CXX_CAST_ENTRY(Integer) 32 | END_LOG4CXX_CAST_MAP() 33 | 34 | Integer(); 35 | Integer(int i); 36 | virtual ~Integer(); 37 | 38 | inline int intValue() const { 39 | return val; 40 | } 41 | 42 | }; 43 | 44 | LOG4CXX_PTR_DEF(Integer); 45 | 46 | } 47 | } 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/iso8601dateformat.h: -------------------------------------------------------------------------------- 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_HELPERS_ISO_8601_DATE_FORMAT_H 19 | #define _LOG4CXX_HELPERS_ISO_8601_DATE_FORMAT_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** 28 | Formats a date in the format yyyy-MM-dd HH:mm:ss,SSS for example 29 | "1999-11-27 15:49:37,459". 30 | 31 |

Refer to the 32 | summary of the 33 | International Standard Date and Time Notation for more 34 | information on this format. 35 | */ 36 | class LOG4CXX_EXPORT ISO8601DateFormat : public SimpleDateFormat 37 | { 38 | public: 39 | ISO8601DateFormat() 40 | : SimpleDateFormat(LOG4CXX_STR("yyyy-MM-dd HH:mm:ss,SSS")) {} 41 | }; 42 | } // namespace helpers 43 | } // namespace log4cxx 44 | 45 | #endif // _LOG4CXX_HELPERS_ISO_8601_DATE_FORMAT_H 46 | 47 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/loader.h: -------------------------------------------------------------------------------- 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_HELPERS_LOADER_H 19 | #define _LOG4CXX_HELPERS_LOADER_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | 27 | namespace log4cxx 28 | { 29 | namespace helpers 30 | { 31 | class Class; 32 | 33 | class LOG4CXX_EXPORT Loader 34 | { 35 | public: 36 | static const Class& loadClass(const LogString& clazz); 37 | 38 | static InputStreamPtr getResourceAsStream( 39 | const LogString& name); 40 | }; 41 | } // namespace helpers 42 | } // namespace log4cxx 43 | #endif //_LOG4CXX_HELPERS_LOADER_H 44 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/locale.h: -------------------------------------------------------------------------------- 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_HELPERS_LOCALE_H 19 | #define _LOG4CXX_HELPERS_LOCALE_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | class LOG4CXX_EXPORT Locale 28 | { 29 | public: 30 | Locale(const LogString& language); 31 | Locale(const LogString& language, const LogString& country); 32 | Locale(const LogString& language, const LogString& country, 33 | const LogString& variant); 34 | 35 | const LogString& getLanguage() const; 36 | const LogString& getCountry() const; 37 | const LogString& getVariant() const; 38 | 39 | protected: 40 | Locale(const Locale&); 41 | Locale& operator=(const Locale&); 42 | const LogString language; 43 | const LogString country; 44 | const LogString variant; 45 | }; // class Locale 46 | } // namespace helpers 47 | } // namespace log4cxx 48 | 49 | #endif // _LOG4CXX_HELPERS_LOCALE_H 50 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/mutex.h: -------------------------------------------------------------------------------- 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_HELPERS_MUTEX_H 19 | #define _LOG4CXX_HELPERS_MUTEX_H 20 | 21 | #include 22 | 23 | extern "C" { 24 | struct apr_thread_mutex_t; 25 | struct apr_pool_t; 26 | } 27 | 28 | 29 | namespace log4cxx 30 | { 31 | namespace helpers 32 | { 33 | class Pool; 34 | 35 | class LOG4CXX_EXPORT Mutex 36 | { 37 | public: 38 | Mutex(log4cxx::helpers::Pool& p); 39 | Mutex(apr_pool_t* p); 40 | ~Mutex(); 41 | apr_thread_mutex_t* getAPRMutex() const; 42 | 43 | private: 44 | Mutex(const Mutex&); 45 | Mutex& operator=(const Mutex&); 46 | apr_thread_mutex_t* mutex; 47 | }; 48 | } // namespace helpers 49 | } // namespace log4cxx 50 | 51 | #endif //_LOG4CXX_HELPERS_MUTEX_H 52 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/objectimpl.h: -------------------------------------------------------------------------------- 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_HELPERS_OBJECT_IMPL_H 19 | #define _LOG4CXX_HELPERS_OBJECT_IMPL_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** Implementation class for Object.*/ 28 | class LOG4CXX_EXPORT ObjectImpl : public virtual Object 29 | { 30 | public: 31 | ObjectImpl(); 32 | virtual ~ObjectImpl(); 33 | void addRef() const; 34 | void releaseRef() const; 35 | 36 | protected: 37 | mutable unsigned int volatile ref; 38 | 39 | private: 40 | // 41 | // prevent object copy and assignment 42 | // 43 | ObjectImpl(const ObjectImpl&); 44 | ObjectImpl& operator=(const ObjectImpl&); 45 | }; 46 | } 47 | } 48 | 49 | #endif //_LOG4CXX_HELPERS_OBJECT_IMPL_H 50 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/outputstream.h: -------------------------------------------------------------------------------- 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_HELPERS_OUTPUTSTREAM_H 19 | #define _LOG4CXX_HELPERS_OUTPUTSTREAM_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace helpers { 27 | class ByteBuffer; 28 | 29 | /** 30 | * Abstract class for writing to character streams. 31 | */ 32 | class LOG4CXX_EXPORT OutputStream : public ObjectImpl 33 | { 34 | public: 35 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(OutputStream) 36 | BEGIN_LOG4CXX_CAST_MAP() 37 | LOG4CXX_CAST_ENTRY(OutputStream) 38 | END_LOG4CXX_CAST_MAP() 39 | 40 | protected: 41 | OutputStream(); 42 | virtual ~OutputStream(); 43 | 44 | public: 45 | virtual void close(Pool& p) = 0; 46 | virtual void flush(Pool& p) = 0; 47 | virtual void write(ByteBuffer& buf, Pool& p) = 0; 48 | 49 | private: 50 | OutputStream(const OutputStream&); 51 | OutputStream& operator=(const OutputStream&); 52 | }; 53 | 54 | LOG4CXX_PTR_DEF(OutputStream); 55 | } // namespace helpers 56 | 57 | } //namespace log4cxx 58 | 59 | #endif //_LOG4CXX_HELPERS_OUTPUTSTREAM_H 60 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/outputstreamwriter.h: -------------------------------------------------------------------------------- 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_HELPERS_OUTPUTSTREAMWRITER_H 19 | #define _LOG4CXX_HELPERS_OUTPUTSTREAMWRITER_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace log4cxx 26 | { 27 | 28 | namespace helpers { 29 | 30 | /** 31 | * Abstract class for writing to character streams. 32 | */ 33 | class LOG4CXX_EXPORT OutputStreamWriter : public Writer 34 | { 35 | private: 36 | OutputStreamPtr out; 37 | CharsetEncoderPtr enc; 38 | 39 | public: 40 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(OutputStreamWriter) 41 | BEGIN_LOG4CXX_CAST_MAP() 42 | LOG4CXX_CAST_ENTRY(OutputStreamWriter) 43 | LOG4CXX_CAST_ENTRY_CHAIN(Writer) 44 | END_LOG4CXX_CAST_MAP() 45 | 46 | OutputStreamWriter(OutputStreamPtr& out); 47 | OutputStreamWriter(OutputStreamPtr& out, CharsetEncoderPtr &enc); 48 | ~OutputStreamWriter(); 49 | 50 | virtual void close(Pool& p); 51 | virtual void flush(Pool& p); 52 | virtual void write(const LogString& str, Pool& p); 53 | LogString getEncoding() const; 54 | 55 | private: 56 | OutputStreamWriter(const OutputStreamWriter&); 57 | OutputStreamWriter& operator=(const OutputStreamWriter&); 58 | }; 59 | 60 | LOG4CXX_PTR_DEF(OutputStreamWriter); 61 | } // namespace helpers 62 | 63 | } //namespace log4cxx 64 | 65 | #endif //_LOG4CXX_HELPERS_OUTPUTSTREAMWRITER_H 66 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/pool.h: -------------------------------------------------------------------------------- 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_HELPERS_POOL_H 19 | #define _LOG4CXX_HELPERS_POOL_H 20 | 21 | #include 22 | #include 23 | 24 | extern "C" { 25 | struct apr_pool_t; 26 | } 27 | 28 | namespace log4cxx 29 | { 30 | namespace helpers 31 | { 32 | class LOG4CXX_EXPORT Pool 33 | { 34 | public: 35 | Pool(); 36 | Pool(apr_pool_t* pool, bool release); 37 | ~Pool(); 38 | 39 | apr_pool_t* getAPRPool(); 40 | apr_pool_t* create(); 41 | void* palloc(size_t length); 42 | char* pstralloc(size_t length); 43 | char* itoa(int n); 44 | char* pstrndup(const char* s, size_t len); 45 | char* pstrdup(const char*s); 46 | char* pstrdup(const std::string&); 47 | 48 | protected: 49 | apr_pool_t* pool; 50 | const bool release; 51 | 52 | private: 53 | Pool(const log4cxx::helpers::Pool&); 54 | Pool& operator=(const Pool&); 55 | }; 56 | } // namespace helpers 57 | } // namespace log4cxx 58 | 59 | #endif //_LOG4CXX_HELPERS_POOL_H 60 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/reader.h: -------------------------------------------------------------------------------- 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_HELPERS_READER_H 19 | #define _LOG4CXX_HELPERS_READER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace helpers { 27 | 28 | /** 29 | * Abstract class for reading from character streams. 30 | * 31 | */ 32 | class LOG4CXX_EXPORT Reader : public ObjectImpl 33 | { 34 | public: 35 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(Reader) 36 | BEGIN_LOG4CXX_CAST_MAP() 37 | LOG4CXX_CAST_ENTRY(Reader) 38 | END_LOG4CXX_CAST_MAP() 39 | 40 | protected: 41 | /** 42 | * Creates a new character-stream reader. 43 | */ 44 | Reader(); 45 | 46 | virtual ~Reader(); 47 | 48 | public: 49 | /** 50 | * Closes the stream. 51 | * @param p The memory pool associated with the reader. 52 | */ 53 | virtual void close(Pool& p) = 0; 54 | 55 | /** 56 | * @return The complete stream contents as a LogString. 57 | * @param p The memory pool associated with the reader. 58 | */ 59 | virtual LogString read(Pool& p) = 0; 60 | 61 | private: 62 | Reader(const Reader&); 63 | 64 | Reader& operator=(const Reader&); 65 | }; 66 | 67 | LOG4CXX_PTR_DEF(Reader); 68 | } // namespace helpers 69 | 70 | } //namespace log4cxx 71 | 72 | #endif //_LOG4CXX_HELPERS_READER_H 73 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/relativetimedateformat.h: -------------------------------------------------------------------------------- 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_HELPERS_RELATIVE_TIME_DATE_FORMAT_H 19 | #define _LOG4CXX_HELPERS_RELATIVE_TIME_DATE_FORMAT_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** 28 | Formats a date by printing the number of seconds 29 | elapsed since the start of the application. This is the fastest 30 | printing DateFormat in the package. 31 | */ 32 | class LOG4CXX_EXPORT RelativeTimeDateFormat : public DateFormat 33 | { 34 | public: 35 | RelativeTimeDateFormat(); 36 | virtual void format(LogString &s, 37 | log4cxx_time_t tm, 38 | log4cxx::helpers::Pool& p) const; 39 | 40 | private: 41 | log4cxx_time_t startTime; 42 | 43 | }; 44 | } // namespace helpers 45 | } // namespace log4cxx 46 | 47 | #endif // _LOG4CXX_HELPERS_RELATIVE_TIME_DATE_FORMAT_H 48 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/serversocket.h: -------------------------------------------------------------------------------- 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_HELPERS_SERVER_SOCKET_H 19 | #define _LOG4CXX_HELPERS_SERVER_SOCKET_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | namespace helpers 27 | { 28 | class LOG4CXX_EXPORT ServerSocket 29 | { 30 | public: 31 | /** Creates a server socket on a specified port. 32 | */ 33 | ServerSocket(int port); 34 | 35 | virtual ~ServerSocket(); 36 | 37 | /** Listens for a connection to be made to this socket and 38 | accepts it 39 | */ 40 | SocketPtr accept(); 41 | 42 | /** Closes this socket. 43 | */ 44 | void close(); 45 | 46 | /** Retrive setting for SO_TIMEOUT. 47 | */ 48 | int getSoTimeout() const; 49 | 50 | /** Enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. 51 | */ 52 | void setSoTimeout(int timeout); 53 | 54 | private: 55 | Pool pool; 56 | Mutex mutex; 57 | apr_socket_t* socket; 58 | int timeout; 59 | 60 | }; 61 | } // namespace helpers 62 | } // namespace log4cxx 63 | 64 | #endif //_LOG4CXX_HELPERS_SERVER_SOCKET_H 65 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/strftimedateformat.h: -------------------------------------------------------------------------------- 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_HELPERS_STRFTIME_DATE_FORMAT_H 19 | #define _LOG4CXX_HELPERS_STRFTIME_DATE_FORMAT_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | 28 | /** 29 | Concrete class for formatting and parsing dates in a 30 | locale-sensitive manner. 31 | 32 | */ 33 | class LOG4CXX_EXPORT StrftimeDateFormat : public DateFormat 34 | { 35 | public: 36 | /** 37 | Constructs a DateFormat using the given pattern and the default 38 | time zone. 39 | 40 | @param pattern the pattern describing the date and time format 41 | */ 42 | StrftimeDateFormat(const LogString& pattern); 43 | ~StrftimeDateFormat(); 44 | 45 | virtual void format(LogString& s, 46 | log4cxx_time_t tm, 47 | log4cxx::helpers::Pool& p) const; 48 | 49 | /** 50 | * Set time zone. 51 | * @param zone new time zone. 52 | */ 53 | void setTimeZone(const TimeZonePtr& zone); 54 | 55 | 56 | private: 57 | /** 58 | * Time zone. 59 | */ 60 | TimeZonePtr timeZone; 61 | std::string pattern; 62 | }; 63 | 64 | 65 | } // namespace helpers 66 | } // namespace log4cxx 67 | 68 | #endif // _LOG4CXX_HELPERS_STRFTIME_DATE_FORMAT_H 69 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/strictmath.h: -------------------------------------------------------------------------------- 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_HELPERS_STRICTMATH_H 19 | #define _LOG4CXX_HELPERS_STRICTMATH_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers 26 | { 27 | /** 28 | The class StrictMath contains methods for performing basic numeric 29 | operations 30 | */ 31 | class StrictMath 32 | { 33 | public: 34 | template static inline const _type& 35 | minimum(const _type& a, const _type& b) 36 | { 37 | return (a < b) ? a : b; 38 | } 39 | 40 | template static inline const _type& 41 | maximum(const _type& a, const _type& b) 42 | { 43 | return (a > b) ? a : b; 44 | } 45 | }; // class StrictMath 46 | } // namespace helpers 47 | } // namespace log4cx 48 | 49 | #endif //_LOG4CXX_HELPERS_STRICTMATH_H 50 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/stringhelper.h: -------------------------------------------------------------------------------- 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_HELPERS_STRING_HELPER_H 19 | #define _LOG4CXX_HELPERS_STRING_HELPER_H 20 | 21 | #include 22 | #include 23 | 24 | 25 | namespace log4cxx 26 | { 27 | namespace helpers 28 | { 29 | class Pool; 30 | /** 31 | String manipulation routines 32 | */ 33 | class LOG4CXX_EXPORT StringHelper 34 | { 35 | public: 36 | static LogString trim(const LogString& s); 37 | static bool startsWith(const LogString& s, const LogString& suffix); 38 | static bool endsWith(const LogString& s, const LogString& suffix); 39 | static bool equalsIgnoreCase(const LogString& s1, 40 | const logchar* upper, const logchar* lower); 41 | static bool equalsIgnoreCase(const LogString& s1, 42 | const LogString& upper, const LogString& lower); 43 | 44 | 45 | static int toInt(const LogString& s); 46 | static log4cxx_int64_t toInt64(const LogString& s); 47 | 48 | static void toString(int i, log4cxx::helpers::Pool& pool, LogString& dst); 49 | static void toString(log4cxx_int64_t i, log4cxx::helpers::Pool& pool, LogString& dst); 50 | static void toString(size_t i, log4cxx::helpers::Pool& pool, LogString& dst); 51 | 52 | static void toString(bool val, LogString& dst); 53 | 54 | static LogString toLowerCase(const LogString& s); 55 | 56 | static LogString format(const LogString& pattern, const std::vector& params); 57 | }; 58 | } 59 | } 60 | 61 | #endif //_LOG4CXX_HELPERS_STRING_HELPER_H 62 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/stringtokenizer.h: -------------------------------------------------------------------------------- 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_HELPERS_STRING_TOKENIZER_H 19 | #define _LOG4CXX_HELPERS_STRING_TOKENIZER_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | namespace helpers 27 | { 28 | class LOG4CXX_EXPORT StringTokenizer 29 | { 30 | public: 31 | StringTokenizer(const LogString& str, const LogString& delim); 32 | ~StringTokenizer(); 33 | bool hasMoreTokens() const; 34 | LogString nextToken(); 35 | 36 | protected: 37 | LogString src; 38 | LogString delim; 39 | size_t pos; 40 | 41 | private: 42 | // prevent copy and assignment statements 43 | StringTokenizer(const StringTokenizer&); 44 | StringTokenizer& operator=(const StringTokenizer&); 45 | }; // class StringTokenizer 46 | } // namespace helpers; 47 | } // namespace log4cxx; 48 | 49 | #endif //_LOG4CXX_HELPERS_STRING_TOKENIZER_H 50 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/synchronized.h: -------------------------------------------------------------------------------- 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_HELPERS_SYNCHRONIZED_H 19 | #define _LOG4CXX_HELPERS_SYNCHRONIZED_H 20 | #include 21 | 22 | namespace log4cxx 23 | { 24 | namespace helpers { 25 | class Mutex; 26 | 27 | /** utility class for objects multi-thread synchronization.*/ 28 | class LOG4CXX_EXPORT synchronized 29 | { 30 | public: 31 | synchronized(const Mutex& mutex); 32 | ~synchronized(); 33 | 34 | 35 | private: 36 | void* mutex; 37 | // prevent use of copy and assignment 38 | synchronized(const synchronized&); 39 | synchronized& operator=(const synchronized&); 40 | }; 41 | } 42 | } 43 | 44 | #endif //_LOG4CXX_HELPERS_SYNCHRONIZED_H 45 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/syslogwriter.h: -------------------------------------------------------------------------------- 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_SYSLOG_WRITER_H 19 | #define _LOG4CXX_SYSLOG_WRITER_H 20 | 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace log4cxx 27 | { 28 | namespace helpers 29 | { 30 | /** 31 | SyslogWriter is a wrapper around the DatagramSocket class 32 | it writes text to the specified host on the port 514 (UNIX syslog) 33 | */ 34 | class LOG4CXX_EXPORT SyslogWriter 35 | { 36 | public: 37 | SyslogWriter(const LogString& syslogHost); 38 | void write(const LogString& string); 39 | 40 | private: 41 | LogString syslogHost; 42 | InetAddressPtr address; 43 | DatagramSocketPtr ds; 44 | }; 45 | } // namespace helpers 46 | } // namespace log4cxx 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/system.h: -------------------------------------------------------------------------------- 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_HELPERS_SYSTEM_H 19 | #define _LOG4CXX_HELPERS_SYSTEM_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | namespace helpers 27 | { 28 | class Properties; 29 | 30 | /** The System class contains several useful class fields and methods. 31 | It cannot be instantiated. 32 | */ 33 | class LOG4CXX_EXPORT System 34 | { 35 | public: 36 | 37 | /** 38 | Gets the system property indicated by the specified key. 39 | 40 | @param key the name of the system property. 41 | 42 | @return the string value of the system property, or the default value if 43 | there is no property with that key. 44 | 45 | @throws IllegalArgumentException if key is empty. 46 | */ 47 | static LogString getProperty(const LogString& key); 48 | 49 | }; 50 | } // namespace helpers 51 | } // namespace log4cxx 52 | 53 | #endif //_LOG4CXX_HELPERS_SYSTEM_H 54 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/systemerrwriter.h: -------------------------------------------------------------------------------- 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_HELPERS_SYSTEMERRWRITER_H 19 | #define _LOG4CXX_HELPERS_SYSTEMERRWRITER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers { 26 | 27 | /** 28 | * Abstract class for writing to character streams. 29 | */ 30 | class LOG4CXX_EXPORT SystemErrWriter : public Writer 31 | { 32 | public: 33 | DECLARE_LOG4CXX_OBJECT(SystemErrWriter) 34 | BEGIN_LOG4CXX_CAST_MAP() 35 | LOG4CXX_CAST_ENTRY(SystemErrWriter) 36 | LOG4CXX_CAST_ENTRY_CHAIN(Writer) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | SystemErrWriter(); 40 | virtual ~SystemErrWriter(); 41 | 42 | virtual void close(Pool& p); 43 | virtual void flush(Pool& p); 44 | virtual void write(const LogString& str, Pool& p); 45 | 46 | static void write(const LogString& str); 47 | static void flush(); 48 | 49 | private: 50 | SystemErrWriter(const SystemErrWriter&); 51 | SystemErrWriter& operator=(const SystemErrWriter&); 52 | static bool isWide(); 53 | }; 54 | 55 | } // namespace helpers 56 | 57 | } //namespace log4cxx 58 | 59 | #endif //_LOG4CXX_HELPERS_SYSTEMERRWRITER_H 60 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/systemoutwriter.h: -------------------------------------------------------------------------------- 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_HELPERS_SYSTEMOUTWRITER_H 19 | #define _LOG4CXX_HELPERS_SYSTEMOUTWRITER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace helpers { 26 | 27 | /** 28 | * Abstract class for writing to character streams. 29 | */ 30 | class LOG4CXX_EXPORT SystemOutWriter : public Writer 31 | { 32 | public: 33 | DECLARE_LOG4CXX_OBJECT(SystemOutWriter) 34 | BEGIN_LOG4CXX_CAST_MAP() 35 | LOG4CXX_CAST_ENTRY(SystemOutWriter) 36 | LOG4CXX_CAST_ENTRY_CHAIN(Writer) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | SystemOutWriter(); 40 | ~SystemOutWriter(); 41 | 42 | virtual void close(Pool& p); 43 | virtual void flush(Pool& p); 44 | virtual void write(const LogString& str, Pool& p); 45 | 46 | static void write(const LogString& str); 47 | static void flush(); 48 | private: 49 | SystemOutWriter(const SystemOutWriter&); 50 | SystemOutWriter& operator=(const SystemOutWriter&); 51 | static bool isWide(); 52 | }; 53 | 54 | } // namespace helpers 55 | 56 | } //namespace log4cxx 57 | 58 | #endif //_LOG4CXX_HELPERS_SYSTEMOUTWRITER_H 59 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/timezone.h: -------------------------------------------------------------------------------- 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_HELPERS_TIMEZONE_H 19 | #define _LOG4CXX_HELPERS_TIMEZONE_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | struct apr_time_exp_t; 26 | 27 | namespace log4cxx 28 | { 29 | namespace helpers 30 | { 31 | class TimeZone; 32 | LOG4CXX_PTR_DEF(TimeZone); 33 | 34 | class LOG4CXX_EXPORT TimeZone : public helpers::ObjectImpl 35 | { 36 | public: 37 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(TimeZone) 38 | BEGIN_LOG4CXX_CAST_MAP() 39 | LOG4CXX_CAST_ENTRY(TimeZone) 40 | END_LOG4CXX_CAST_MAP() 41 | 42 | static const TimeZonePtr& getDefault(); 43 | static const TimeZonePtr& getGMT(); 44 | static const TimeZonePtr getTimeZone(const LogString& ID); 45 | 46 | const LogString getID() const { 47 | return id; 48 | } 49 | 50 | 51 | /** 52 | * Expand an APR time into the human readable 53 | * components for this timezone. 54 | */ 55 | virtual log4cxx_status_t explode(apr_time_exp_t* result, 56 | log4cxx_time_t input) const = 0; 57 | 58 | 59 | protected: 60 | TimeZone(const LogString& ID); 61 | virtual ~TimeZone(); 62 | 63 | const LogString id; 64 | }; 65 | 66 | 67 | } 68 | } 69 | 70 | #endif //_LOG4CXX_HELPERS_TIMEZONE_H 71 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/helpers/writer.h: -------------------------------------------------------------------------------- 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_HELPERS_WRITER_H 19 | #define _LOG4CXX_HELPERS_WRITER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace helpers { 27 | 28 | /** 29 | * Abstract class for writing to character streams. 30 | */ 31 | class LOG4CXX_EXPORT Writer : public ObjectImpl 32 | { 33 | public: 34 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(Writer) 35 | BEGIN_LOG4CXX_CAST_MAP() 36 | LOG4CXX_CAST_ENTRY(Writer) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | protected: 40 | Writer(); 41 | virtual ~Writer(); 42 | 43 | public: 44 | virtual void close(Pool& p) = 0; 45 | virtual void flush(Pool& p) = 0; 46 | virtual void write(const LogString& str, Pool& p) = 0; 47 | 48 | private: 49 | Writer(const Writer&); 50 | Writer& operator=(const Writer&); 51 | }; 52 | 53 | LOG4CXX_PTR_DEF(Writer); 54 | } // namespace helpers 55 | 56 | } //namespace log4cxx 57 | 58 | #endif //_LOG4CXX_HELPERS_WRITER_H 59 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/log4cxx.h.in: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one or more 2 | * contributor license agreements. See the NOTICE file distributed with 3 | * this work for additional information regarding copyright ownership. 4 | * The ASF licenses this file to You under the Apache License, Version 2.0 5 | * (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef LOG4CXX_LOG4CXX_H 19 | #define LOG4CXX_LOG4CXX_H 20 | 21 | /* GENERATED FILE WARNING! DO NOT EDIT log4cxx.h 22 | * 23 | * Edit log4cxx.h.in instead 24 | * 25 | */ 26 | 27 | 28 | #define LOG4CXX_LOGCHAR_IS_UNICHAR @LOGCHAR_IS_UNICHAR@ 29 | #define LOG4CXX_LOGCHAR_IS_UTF8 @LOGCHAR_IS_UTF8@ 30 | #define LOG4CXX_LOGCHAR_IS_WCHAR @LOGCHAR_IS_WCHAR@ 31 | 32 | #define LOG4CXX_CHAR_API @CHAR_API@ 33 | #define LOG4CXX_WCHAR_T_API @WCHAR_T_API@ 34 | #define LOG4CXX_UNICHAR_API @UNICHAR_API@ 35 | #define LOG4CXX_CFSTRING_API @CFSTRING_API@ 36 | 37 | 38 | typedef long long log4cxx_int64_t; 39 | #define LOG4CXX_USE_GLOBAL_SCOPE_TEMPLATE 0 40 | #define LOG4CXX_LOGSTREAM_ADD_NOP 0 41 | typedef log4cxx_int64_t log4cxx_time_t; 42 | typedef int log4cxx_status_t; 43 | typedef unsigned int log4cxx_uint32_t; 44 | 45 | 46 | #define LOG4CXX_EXPORT 47 | #define LOG4CXX_PTR_DEF(T) typedef log4cxx::helpers::ObjectPtrT T##Ptr 48 | #define LOG4CXX_LIST_DEF(N, T) typedef std::vector N 49 | 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/net/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | netincdir = $(includedir)/log4cxx/net 17 | netinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/net/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/nt/EventLogCategories.mc: -------------------------------------------------------------------------------- 1 | ; 2 | ; Licensed to the Apache Software Foundation (ASF) under one 3 | ; or more contributor license agreements. See the NOTICE file 4 | ; distributed with this work for additional information 5 | ; regarding copyright ownership. The ASF licenses this file 6 | ; to you under the Apache License, Version 2.0 (the 7 | ; "License"); you may not use this file except in compliance 8 | ; with the License. You may obtain a copy of the License at 9 | ; 10 | ; http://www.apache.org/licenses/LICENSE-2.0 11 | ; 12 | ; Unless required by applicable law or agreed to in writing, 13 | ; software distributed under the License is distributed on an 14 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | ; KIND, either express or implied. See the License for the 16 | ; specific language governing permissions and limitations 17 | ; under the License. 18 | ; 19 | MessageId=0x0001 20 | Language=English 21 | Fatal 22 | . 23 | MessageId=0x0002 24 | Language=English 25 | Error 26 | . 27 | MessageId=0x0003 28 | Language=English 29 | Warn 30 | . 31 | MessageId=0x0004 32 | Language=English 33 | Info 34 | . 35 | MessageId=0x0005 36 | Language=English 37 | Debug 38 | . 39 | MessageId=0x1000 40 | Language=English 41 | %1 42 | . 43 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/nt/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | ntincdir = $(includedir)/log4cxx/nt 17 | ntinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/nt/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/nt/outputdebugstringappender.h: -------------------------------------------------------------------------------- 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_NT_OUTPUTDEBUGSTRING_APPENDER_HEADER_ 19 | #define _LOG4CXX_NT_OUTPUTDEBUGSTRING_APPENDER_HEADER_ 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace nt 26 | { 27 | class LOG4CXX_EXPORT OutputDebugStringAppender : public AppenderSkeleton 28 | { 29 | public: 30 | DECLARE_LOG4CXX_OBJECT(OutputDebugStringAppender) 31 | BEGIN_LOG4CXX_CAST_MAP() 32 | LOG4CXX_CAST_ENTRY(OutputDebugStringAppender) 33 | LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) 34 | END_LOG4CXX_CAST_MAP() 35 | 36 | OutputDebugStringAppender(); 37 | 38 | bool requiresLayout() const 39 | { return true; } 40 | 41 | virtual void close() {} 42 | 43 | virtual void append(const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p); 44 | }; 45 | } 46 | } 47 | 48 | #endif //_LOG4CXX_NT_OUTPUTDEBUGSTRING_APPENDER_HEADER_ 49 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | patternincdir = $(includedir)/log4cxx/pattern 17 | patterninc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/pattern/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/classnamepatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_CLASSNAME_PATTERN_CONVERTER_H 19 | #define _LOG4CXX_PATTERN_CLASSNAME_PATTERN_CONVERTER_H 20 | 21 | 22 | #include 23 | 24 | namespace log4cxx { 25 | namespace pattern { 26 | 27 | 28 | /** 29 | * Formats the class name of the site of the logging request. 30 | * 31 | * 32 | * 33 | */ 34 | class LOG4CXX_EXPORT ClassNamePatternConverter : public NamePatternConverter { 35 | /** 36 | * Private constructor. 37 | * @param options options, may be null. 38 | * @param logger logger for diagnostic messages, may be null. 39 | */ 40 | ClassNamePatternConverter( 41 | const std::vector& options); 42 | 43 | public: 44 | DECLARE_LOG4CXX_PATTERN(ClassNamePatternConverter) 45 | BEGIN_LOG4CXX_CAST_MAP() 46 | LOG4CXX_CAST_ENTRY(ClassNamePatternConverter) 47 | LOG4CXX_CAST_ENTRY_CHAIN(NamePatternConverter) 48 | END_LOG4CXX_CAST_MAP() 49 | 50 | /** 51 | * Gets an instance of ClassNamePatternConverter. 52 | * @param options options, may be null. 53 | * @return instance of pattern converter. 54 | */ 55 | static PatternConverterPtr newInstance( 56 | const std::vector& options); 57 | 58 | void format(const log4cxx::spi::LoggingEventPtr&event, 59 | LogString& toAppendTo, 60 | log4cxx::helpers::Pool& p) const; 61 | }; 62 | 63 | } 64 | } 65 | #endif 66 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/filedatepatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_FILE_DATE_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_FILE_DATE_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Formats an date by delegating to DatePatternConverter. The default 28 | * date pattern for a %d specifier in a file name is different than 29 | * the %d pattern in pattern layout. 30 | * 31 | * 32 | * 33 | */ 34 | class LOG4CXX_EXPORT FileDatePatternConverter { 35 | /** 36 | * Private constructor. 37 | */ 38 | FileDatePatternConverter(); 39 | 40 | public: 41 | /** 42 | * Obtains an instance of pattern converter. 43 | * @param options options, may be null. 44 | * @return instance of pattern converter. 45 | */ 46 | static PatternConverterPtr newInstance( 47 | const std::vector& options); 48 | }; 49 | } 50 | } 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/filelocationpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_FILE_LOCATION_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_FILE_LOCATION_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | 27 | /** 28 | * Return the event's line location information in a StringBuffer. 29 | * 30 | * 31 | * 32 | */ 33 | class LOG4CXX_EXPORT FileLocationPatternConverter 34 | : public LoggingEventPatternConverter { 35 | /** 36 | * Private constructor. 37 | */ 38 | FileLocationPatternConverter(); 39 | 40 | public: 41 | DECLARE_LOG4CXX_PATTERN(FileLocationPatternConverter) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(FileLocationPatternConverter) 44 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | /** 48 | * Obtains an instance of pattern converter. 49 | * @param options options, may be null. 50 | * @return instance of pattern converter. 51 | */ 52 | static PatternConverterPtr newInstance( 53 | const std::vector& options); 54 | 55 | void format(const log4cxx::spi::LoggingEventPtr& event, 56 | LogString& toAppendTo, 57 | log4cxx::helpers::Pool& p) const; 58 | }; 59 | 60 | } 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/fulllocationpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_FULL_LOCATION_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_FULL_LOCATION_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | 27 | /** 28 | * Format the event's line location information. 29 | * 30 | * 31 | * 32 | */ 33 | class LOG4CXX_EXPORT FullLocationPatternConverter 34 | : public LoggingEventPatternConverter { 35 | /** 36 | * Private constructor. 37 | */ 38 | FullLocationPatternConverter(); 39 | 40 | public: 41 | DECLARE_LOG4CXX_PATTERN(FullLocationPatternConverter) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(FullLocationPatternConverter) 44 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | /** 48 | * Obtains an instance of pattern converter. 49 | * @param options options, may be null. 50 | * @return instance of pattern converter. 51 | */ 52 | static PatternConverterPtr newInstance( 53 | const std::vector& options); 54 | 55 | void format(const log4cxx::spi::LoggingEventPtr& event, 56 | LogString& toAppendTo, 57 | log4cxx::helpers::Pool& p) const; 58 | }; 59 | 60 | } 61 | } 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/integerpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_INTEGER_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_INTEGER_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Formats an integer. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT IntegerPatternConverter : public PatternConverter { 33 | 34 | /** 35 | * Private constructor. 36 | */ 37 | IntegerPatternConverter(); 38 | 39 | public: 40 | DECLARE_LOG4CXX_PATTERN(IntegerPatternConverter) 41 | BEGIN_LOG4CXX_CAST_MAP() 42 | LOG4CXX_CAST_ENTRY(IntegerPatternConverter) 43 | LOG4CXX_CAST_ENTRY_CHAIN(PatternConverter) 44 | END_LOG4CXX_CAST_MAP() 45 | 46 | /** 47 | * Obtains an instance of pattern converter. 48 | * @param options options, may be null. 49 | * @return instance of pattern converter. 50 | */ 51 | static PatternConverterPtr newInstance( 52 | const std::vector& options); 53 | 54 | void format(const log4cxx::helpers::ObjectPtr& obj, 55 | LogString& toAppendTo, 56 | log4cxx::helpers::Pool& p) const; 57 | }; 58 | 59 | LOG4CXX_PTR_DEF(IntegerPatternConverter); 60 | 61 | } 62 | } 63 | #endif 64 | 65 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/levelpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_LEVEL_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_LEVEL_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Return the event's level in a StringBuffer. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT LevelPatternConverter : public LoggingEventPatternConverter { 33 | /** 34 | * Private constructor. 35 | */ 36 | LevelPatternConverter(); 37 | 38 | public: 39 | DECLARE_LOG4CXX_PATTERN(LevelPatternConverter) 40 | BEGIN_LOG4CXX_CAST_MAP() 41 | LOG4CXX_CAST_ENTRY(LevelPatternConverter) 42 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 43 | END_LOG4CXX_CAST_MAP() 44 | 45 | /** 46 | * Obtains an instance of pattern converter. 47 | * @param options options, may be null. 48 | * @return instance of pattern converter. 49 | */ 50 | static PatternConverterPtr newInstance( 51 | const std::vector& options); 52 | 53 | void format(const log4cxx::spi::LoggingEventPtr& event, 54 | LogString& toAppendTo, 55 | log4cxx::helpers::Pool& p) const; 56 | 57 | LogString getStyleClass(const log4cxx::helpers::ObjectPtr& e) const; 58 | }; 59 | } 60 | } 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/linelocationpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_LINE_LOCATION_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_LINE_LOCATION_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | 27 | /** 28 | * Format the event's line location information. 29 | * 30 | * 31 | * 32 | */ 33 | class LOG4CXX_EXPORT LineLocationPatternConverter 34 | : public LoggingEventPatternConverter { 35 | /** 36 | * Private constructor. 37 | */ 38 | LineLocationPatternConverter(); 39 | 40 | public: 41 | DECLARE_LOG4CXX_PATTERN(LineLocationPatternConverter) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(LineLocationPatternConverter) 44 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | /** 48 | * Obtains an instance of pattern converter. 49 | * @param options options, may be null. 50 | * @return instance of pattern converter. 51 | */ 52 | static PatternConverterPtr newInstance( 53 | const std::vector& options); 54 | 55 | void format(const log4cxx::spi::LoggingEventPtr& event, 56 | LogString& toAppendTo, 57 | log4cxx::helpers::Pool& p) const; 58 | }; 59 | 60 | } 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/lineseparatorpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_LINE_SEPARATOR_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_LINE_SEPARATOR_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | 27 | /** 28 | * Formats a line separator. 29 | * 30 | * 31 | * 32 | */ 33 | class LOG4CXX_EXPORT LineSeparatorPatternConverter 34 | : public LoggingEventPatternConverter { 35 | 36 | /** 37 | * Private constructor. 38 | */ 39 | LineSeparatorPatternConverter(); 40 | 41 | public: 42 | DECLARE_LOG4CXX_PATTERN(LineSeparatorPatternConverter) 43 | BEGIN_LOG4CXX_CAST_MAP() 44 | LOG4CXX_CAST_ENTRY(LineSeparatorPatternConverter) 45 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 46 | END_LOG4CXX_CAST_MAP() 47 | 48 | 49 | /** 50 | * Obtains an instance of pattern converter. 51 | * @param options options, may be null. 52 | * @return instance of pattern converter. 53 | */ 54 | static PatternConverterPtr newInstance( 55 | const std::vector& options); 56 | 57 | void format(const log4cxx::spi::LoggingEventPtr& event, 58 | LogString& toAppendTo, 59 | log4cxx::helpers::Pool& p) const; 60 | 61 | void format(const log4cxx::helpers::ObjectPtr& obj, 62 | LogString& toAppendTo, 63 | log4cxx::helpers::Pool& p) const; 64 | }; 65 | 66 | } 67 | } 68 | #endif 69 | 70 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/literalpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_LITERAL_PATTERN_CONVERTER_H 19 | #define _LOG4CXX_PATTERN_LITERAL_PATTERN_CONVERTER_H 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | /** 27 | * Formats a string literal. 28 | * 29 | * 30 | * 31 | * 32 | */ 33 | class LOG4CXX_EXPORT LiteralPatternConverter : public LoggingEventPatternConverter { 34 | /** 35 | * String literal. 36 | */ 37 | const LogString literal; 38 | 39 | /** 40 | * Create a new instance. 41 | * @param literal string literal. 42 | */ 43 | LiteralPatternConverter(const LogString& literal); 44 | 45 | 46 | public: 47 | DECLARE_LOG4CXX_PATTERN(LiteralPatternConverter) 48 | BEGIN_LOG4CXX_CAST_MAP() 49 | LOG4CXX_CAST_ENTRY(LiteralPatternConverter) 50 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 51 | END_LOG4CXX_CAST_MAP() 52 | 53 | static PatternConverterPtr newInstance(const LogString& literal); 54 | 55 | void format(const log4cxx::spi::LoggingEventPtr& event, 56 | LogString& toAppendTo, 57 | log4cxx::helpers::Pool& p) const; 58 | 59 | void format(const log4cxx::helpers::ObjectPtr& obj, 60 | LogString& toAppendTo, 61 | log4cxx::helpers::Pool& p) const; 62 | }; 63 | 64 | } 65 | } 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/loggerpatternconverter.h: -------------------------------------------------------------------------------- 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 | #ifndef _LOG4CXX_PATTERN_LOGGER_PATTERN_CONVERTER_H 18 | #define _LOG4CXX_PATTERN_LOGGER_PATTERN_CONVERTER_H 19 | 20 | 21 | #include 22 | 23 | namespace log4cxx { 24 | namespace pattern { 25 | 26 | 27 | /** 28 | * Formats a logger name. 29 | * 30 | * 31 | * 32 | * 33 | */ 34 | class LOG4CXX_EXPORT LoggerPatternConverter : public NamePatternConverter { 35 | 36 | /** 37 | * Private constructor. 38 | * @param options options, may be null. 39 | * @param logger logger for diagnostic messages, may be null. 40 | */ 41 | LoggerPatternConverter(const std::vector& options); 42 | 43 | public: 44 | DECLARE_LOG4CXX_PATTERN(LoggerPatternConverter) 45 | BEGIN_LOG4CXX_CAST_MAP() 46 | LOG4CXX_CAST_ENTRY(LoggerPatternConverter) 47 | LOG4CXX_CAST_ENTRY_CHAIN(NamePatternConverter) 48 | END_LOG4CXX_CAST_MAP() 49 | 50 | /** 51 | * Obtains an instance of pattern converter. 52 | * @param options options, may be null. 53 | * @return instance of pattern converter. 54 | */ 55 | static PatternConverterPtr newInstance( 56 | const std::vector& options); 57 | 58 | void format(const log4cxx::spi::LoggingEventPtr& event, 59 | LogString& toAppendTo, 60 | log4cxx::helpers::Pool& p) const; 61 | }; 62 | 63 | } 64 | } 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/messagepatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_MESSAGE_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_MESSAGE_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Formats the message of an logging event. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT MessagePatternConverter : public LoggingEventPatternConverter { 33 | 34 | /** 35 | * Private constructor. 36 | */ 37 | MessagePatternConverter(); 38 | 39 | public: 40 | DECLARE_LOG4CXX_PATTERN(MessagePatternConverter) 41 | BEGIN_LOG4CXX_CAST_MAP() 42 | LOG4CXX_CAST_ENTRY(MessagePatternConverter) 43 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 44 | END_LOG4CXX_CAST_MAP() 45 | 46 | /** 47 | * Obtains an instance of pattern converter. 48 | * @param options options, may be null. 49 | * @return instance of pattern converter. 50 | */ 51 | static PatternConverterPtr newInstance( 52 | const std::vector& options); 53 | 54 | void format(const log4cxx::spi::LoggingEventPtr& event, 55 | LogString& toAppendTo, 56 | log4cxx::helpers::Pool& p) const; 57 | }; 58 | } 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/methodlocationpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_METHOD_LOCATION_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_METHOD_LOCATION_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Return the event's line location information in a StringBuffer. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT MethodLocationPatternConverter 33 | : public LoggingEventPatternConverter { 34 | 35 | /** 36 | * Private constructor. 37 | */ 38 | MethodLocationPatternConverter(); 39 | 40 | public: 41 | DECLARE_LOG4CXX_PATTERN(MethodLocationPatternConverter) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(MethodLocationPatternConverter) 44 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | /** 48 | * Obtains an instance of MethodLocationPatternConverter. 49 | * @param options options, may be null. 50 | * @return instance of MethodLocationPatternConverter. 51 | */ 52 | static PatternConverterPtr newInstance( 53 | const std::vector& options); 54 | 55 | void format(const log4cxx::spi::LoggingEventPtr& event, 56 | LogString& toAppendTo, 57 | log4cxx::helpers::Pool& p) const; 58 | }; 59 | } 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/namepatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_NAMED_PATTERN_CONVERTER_H 19 | #define _LOG4CXX_PATTERN_NAMED_PATTERN_CONVERTER_H 20 | 21 | #include 22 | #include 23 | 24 | #include 25 | 26 | namespace log4cxx { 27 | namespace pattern { 28 | 29 | /** 30 | * 31 | * Base class for other pattern converters which can return only parts of their name. 32 | * 33 | */ 34 | class LOG4CXX_EXPORT NamePatternConverter : public LoggingEventPatternConverter { 35 | /** 36 | * Abbreviator. 37 | */ 38 | const NameAbbreviatorPtr abbreviator; 39 | 40 | public: 41 | DECLARE_LOG4CXX_PATTERN(NamePatternConverter) 42 | BEGIN_LOG4CXX_CAST_MAP() 43 | LOG4CXX_CAST_ENTRY(NamePatternConverter) 44 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 45 | END_LOG4CXX_CAST_MAP() 46 | 47 | 48 | protected: 49 | /** 50 | * Constructor. 51 | * @param name name of converter. 52 | * @param style style name for associated output. 53 | * @param options options, may be null, first element will be interpreted as an abbreviation pattern. 54 | */ 55 | NamePatternConverter( 56 | const LogString& name, 57 | const LogString& style, 58 | const std::vector& options); 59 | 60 | /** 61 | * Abbreviate name in string buffer. 62 | * @param nameStart starting position of name to abbreviate. 63 | * @param buf string buffer containing name. 64 | */ 65 | void abbreviate(int nameStart, LogString& buf) const; 66 | 67 | private: 68 | NameAbbreviatorPtr getAbbreviator(const std::vector& options); 69 | }; 70 | 71 | } 72 | } 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/ndcpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_NDC_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_NDC_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Return the event's NDC in a StringBuffer. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT NDCPatternConverter : public LoggingEventPatternConverter { 33 | 34 | /** 35 | * Private constructor. 36 | */ 37 | NDCPatternConverter(); 38 | 39 | public: 40 | DECLARE_LOG4CXX_PATTERN(NDCPatternConverter) 41 | BEGIN_LOG4CXX_CAST_MAP() 42 | LOG4CXX_CAST_ENTRY(NDCPatternConverter) 43 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 44 | END_LOG4CXX_CAST_MAP() 45 | 46 | /** 47 | * Obtains an instance of NDCPatternConverter. 48 | * @param options options, may be null. 49 | * @return instance of NDCPatternConverter. 50 | */ 51 | static PatternConverterPtr newInstance( 52 | const std::vector& options); 53 | 54 | void format(const log4cxx::spi::LoggingEventPtr& event, 55 | LogString& toAppendTo, 56 | log4cxx::helpers::Pool& p) const; 57 | }; 58 | } 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/relativetimepatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_RELATIVE_TIME_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_RELATIVE_TIME_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Format the relative time in milliseconds. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT RelativeTimePatternConverter : public LoggingEventPatternConverter { 33 | public: 34 | DECLARE_LOG4CXX_PATTERN(RelativeTimePatternConverter) 35 | BEGIN_LOG4CXX_CAST_MAP() 36 | LOG4CXX_CAST_ENTRY(RelativeTimePatternConverter) 37 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 38 | END_LOG4CXX_CAST_MAP() 39 | 40 | /** 41 | * Private constructor. 42 | */ 43 | RelativeTimePatternConverter(); 44 | 45 | /** 46 | * Obtains an instance of RelativeTimePatternConverter. 47 | * @param options options, currently ignored, may be null. 48 | * @return instance of RelativeTimePatternConverter. 49 | */ 50 | static PatternConverterPtr newInstance( 51 | const std::vector& options); 52 | 53 | void format(const log4cxx::spi::LoggingEventPtr& event, 54 | LogString& toAppendTo, 55 | log4cxx::helpers::Pool& p) const; 56 | }; 57 | } 58 | } 59 | #endif 60 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/pattern/threadpatternconverter.h: -------------------------------------------------------------------------------- 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_PATTERN_THREAD_PATTERN_CONVERTER 19 | #define _LOG4CXX_PATTERN_THREAD_PATTERN_CONVERTER 20 | 21 | #include 22 | 23 | namespace log4cxx { namespace pattern { 24 | 25 | 26 | /** 27 | * Formats the event thread name. 28 | * 29 | * 30 | * 31 | */ 32 | class LOG4CXX_EXPORT ThreadPatternConverter : public LoggingEventPatternConverter { 33 | /** 34 | * Private constructor. 35 | */ 36 | ThreadPatternConverter(); 37 | 38 | public: 39 | DECLARE_LOG4CXX_PATTERN(ThreadPatternConverter) 40 | BEGIN_LOG4CXX_CAST_MAP() 41 | LOG4CXX_CAST_ENTRY(ThreadPatternConverter) 42 | LOG4CXX_CAST_ENTRY_CHAIN(LoggingEventPatternConverter) 43 | END_LOG4CXX_CAST_MAP() 44 | 45 | /** 46 | * Obtains an instance of ThreadPatternConverter. 47 | * @param options options, currently ignored, may be null. 48 | * @return instance of ThreadPatternConverter. 49 | */ 50 | static PatternConverterPtr newInstance( 51 | const std::vector& options); 52 | 53 | void format(const log4cxx::spi::LoggingEventPtr& event, 54 | LogString& toAppendTo, 55 | log4cxx::helpers::Pool& p) const; 56 | }; 57 | } 58 | } 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/portability.h: -------------------------------------------------------------------------------- 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_PORTABILITY_H 19 | #define _LOG4CXX_PORTABILITY_H 20 | 21 | // 22 | // Obsolete file 23 | // 24 | 25 | #endif //_LOG4CXX_PORTABILITY_H 26 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/private/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | privateincdir = $(includedir)/log4cxx/private 17 | privateinc_HEADERS= $(top_builddir)/src/main/include/log4cxx/private/*.h log4cxx_private.h 18 | DISTCLEANFILES = log4cxx_private.h 19 | EXTRA_DIST = log4cxx_private.hw 20 | 21 | dist-hook: 22 | -rm -f $(distdir)/log4cxx_private.h 23 | 24 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/private/log4cxx_private.h: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one or more 2 | * contributor license agreements. See the NOTICE file distributed with 3 | * this work for additional information regarding copyright ownership. 4 | * The ASF licenses this file to You under the Apache License, Version 2.0 5 | * (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef LOG4CXX_PRIVATE_LOG4CXX_H 19 | #define LOG4CXX_PRIVATE_LOG4CXX_H 20 | 21 | 22 | /* GENERATED FILE WARNING! DO NOT EDIT log4cxx.h 23 | * 24 | * You must modify log4cxx.hw instead. 25 | * 26 | * 27 | * This is the Win32 specific version of log4cxx.h. 28 | */ 29 | 30 | #include 31 | 32 | #if !defined(LOG4CXX) && !defined(LOG4CXX_TEST) 33 | #error "log4cxx/private/log4cxx.h should only be used within log4cxx and tests implementation" 34 | #endif 35 | 36 | 37 | #if !defined(__BORLANDC__) 38 | #define LOG4CXX_RETURN_AFTER_THROW 1 39 | #else 40 | #define LOG4CXX_RETURN_AFTER_THROW 0 41 | #endif 42 | 43 | #if defined(_WIN32_WCE) 44 | #define LOG4CXX_HAS_STD_LOCALE 0 45 | #else 46 | #define LOG4CXX_HAS_STD_LOCALE 1 47 | #endif 48 | 49 | #define LOG4CXX_FORCE_WIDE_CONSOLE 1 50 | #define LOG4CXX_FORCE_BYTE_CONSOLE 0 51 | 52 | 53 | #if defined(_MSC_VER) 54 | #define LOG4CXX_MEMSET_IOS_BASE 1 55 | #endif 56 | 57 | #if !defined(_WIN32_WCE) 58 | #define LOG4CXX_HAVE_ODBC 1 59 | #if defined(__BORLANDC__) 60 | #define LOG4CXX_HAS_MBSRTOWCS 0 61 | #else 62 | #define LOG4CXX_HAS_MBSRTOWCS 1 63 | #endif 64 | #else 65 | #define LOG4CXX_HAVE_ODBC 0 66 | #define LOG4CXX_HAS_MBSRTOWCS 0 67 | #endif 68 | 69 | #define LOG4CXX_HAS_FWIDE 1 70 | #define LOG4CXX_HAS_WCSTOMBS 1 71 | 72 | #define LOG4CXX_CHARSET_UTF8 0 73 | #define LOG4CXX_CHARSET_ISO88591 0 74 | #define LOG4CXX_CHARSET_USASCII 0 75 | #define LOG4CXX_CHARSET_EBCDIC 0 76 | 77 | 78 | #define LOG4CXX_HAVE_LIBESMTP 0 79 | #define LOG4CXX_HAVE_SYSLOG 0 80 | 81 | #define LOG4CXX_WIN32_THREAD_FMTSPEC "0x%.8x" 82 | #define LOG4CXX_APR_THREAD_FMTSPEC "0x%pt" 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/private/log4cxx_private.h.in: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one or more 2 | * contributor license agreements. See the NOTICE file distributed with 3 | * this work for additional information regarding copyright ownership. 4 | * The ASF licenses this file to You under the Apache License, Version 2.0 5 | * (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef LOG4CXX_PRIVATE_LOG4CXX_H 19 | #define LOG4CXX_PRIVATE_LOG4CXX_H 20 | 21 | /* GENERATED FILE WARNING! DO NOT EDIT log4cxx_private.h 22 | * 23 | * You must modify log4cxx_private.h.in instead. 24 | * 25 | */ 26 | 27 | #include 28 | 29 | #if !defined(LOG4CXX) && !defined(LOG4CXX_TEST) 30 | #error "log4cxx/private/log4cxx_private.h should only be used within log4cxx implementation or tests" 31 | #endif 32 | 33 | #define LOG4CXX_RETURN_AFTER_THROW 0 34 | 35 | #define LOG4CXX_HAS_STD_LOCALE @HAS_STD_LOCALE@ 36 | #define LOG4CXX_FORCE_WIDE_CONSOLE 0 37 | #define LOG4CXX_FORCE_BYTE_CONSOLE 0 38 | #define LOG4CXX_MEMSET_IOS_BASE 0 39 | #define LOG4CXX_HAVE_ODBC @HAS_ODBC@ 40 | #define LOG4CXX_HAS_MBSRTOWCS @HAS_MBSRTOWCS@ 41 | #define LOG4CXX_HAS_WCSTOMBS @HAS_WCSTOMBS@ 42 | #define LOG4CXX_HAS_FWIDE @HAS_FWIDE@ 43 | 44 | #define LOG4CXX_CHARSET_UTF8 @CHARSET_UTF8@ 45 | #define LOG4CXX_CHARSET_ISO88591 @CHARSET_ISO88591@ 46 | #define LOG4CXX_CHARSET_USASCII @CHARSET_USASCII@ 47 | #define LOG4CXX_CHARSET_EBCDIC @CHARSET_EBCDIC@ 48 | 49 | #define LOG4CXX_HAVE_LIBESMTP @HAS_LIBESMTP@ 50 | #define LOG4CXX_HAVE_SYSLOG @HAS_SYSLOG@ 51 | 52 | #define LOG4CXX_WIN32_THREAD_FMTSPEC "0x%.8x" 53 | #define LOG4CXX_APR_THREAD_FMTSPEC "0x%pt" 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/private/log4cxx_private.hw: -------------------------------------------------------------------------------- 1 | /* Licensed to the Apache Software Foundation (ASF) under one or more 2 | * contributor license agreements. See the NOTICE file distributed with 3 | * this work for additional information regarding copyright ownership. 4 | * The ASF licenses this file to You under the Apache License, Version 2.0 5 | * (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | 18 | #ifndef LOG4CXX_PRIVATE_LOG4CXX_H 19 | #define LOG4CXX_PRIVATE_LOG4CXX_H 20 | 21 | 22 | /* GENERATED FILE WARNING! DO NOT EDIT log4cxx.h 23 | * 24 | * You must modify log4cxx.hw instead. 25 | * 26 | * 27 | * This is the Win32 specific version of log4cxx.h. 28 | */ 29 | 30 | #include 31 | 32 | #if !defined(LOG4CXX) && !defined(LOG4CXX_TEST) 33 | #error "log4cxx/private/log4cxx.h should only be used within log4cxx and tests implementation" 34 | #endif 35 | 36 | 37 | #if !defined(__BORLANDC__) 38 | #define LOG4CXX_RETURN_AFTER_THROW 1 39 | #else 40 | #define LOG4CXX_RETURN_AFTER_THROW 0 41 | #endif 42 | 43 | #if defined(_WIN32_WCE) 44 | #define LOG4CXX_HAS_STD_LOCALE 0 45 | #else 46 | #define LOG4CXX_HAS_STD_LOCALE 1 47 | #endif 48 | 49 | #define LOG4CXX_FORCE_WIDE_CONSOLE 1 50 | #define LOG4CXX_FORCE_BYTE_CONSOLE 0 51 | 52 | 53 | #if defined(_MSC_VER) 54 | #define LOG4CXX_MEMSET_IOS_BASE 1 55 | #endif 56 | 57 | #if !defined(_WIN32_WCE) 58 | #define LOG4CXX_HAVE_ODBC 1 59 | #if defined(__BORLANDC__) 60 | #define LOG4CXX_HAS_MBSRTOWCS 0 61 | #else 62 | #define LOG4CXX_HAS_MBSRTOWCS 1 63 | #endif 64 | #else 65 | #define LOG4CXX_HAVE_ODBC 0 66 | #define LOG4CXX_HAS_MBSRTOWCS 0 67 | #endif 68 | 69 | #define LOG4CXX_HAS_FWIDE 1 70 | #define LOG4CXX_HAS_WCSTOMBS 1 71 | 72 | #define LOG4CXX_CHARSET_UTF8 0 73 | #define LOG4CXX_CHARSET_ISO88591 0 74 | #define LOG4CXX_CHARSET_USASCII 0 75 | #define LOG4CXX_CHARSET_EBCDIC 0 76 | 77 | 78 | #define LOG4CXX_HAVE_LIBESMTP 0 79 | #define LOG4CXX_HAVE_SYSLOG 0 80 | 81 | #define LOG4CXX_WIN32_THREAD_FMTSPEC "0x%.8x" 82 | #define LOG4CXX_APR_THREAD_FMTSPEC "0x%pt" 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/provisionnode.h: -------------------------------------------------------------------------------- 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_PROVISION_NODE_H 19 | #define _LOG4CXX_PROVISION_NODE_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace log4cxx 26 | { 27 | class Logger; 28 | typedef helpers::ObjectPtrT LoggerPtr; 29 | 30 | 31 | typedef std::vector ProvisionNode; 32 | 33 | } // namespace log4cxx 34 | 35 | #endif //_LOG4CXX_PROVISION_NODE_H 36 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/rolling/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | rollingincdir = $(includedir)/log4cxx/rolling 17 | rollinginc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/rolling/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/rolling/action.h: -------------------------------------------------------------------------------- 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 | #if !defined(_LOG4CXX_ROLLING_ACTION_H) 19 | #define _LOG4CXX_ROLLING_ACTION_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace log4cxx { 27 | namespace rolling { 28 | 29 | 30 | /** 31 | * A file system action performed as part of a rollover event. 32 | */ 33 | class Action : public virtual log4cxx::helpers::ObjectImpl { 34 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(Action) 35 | BEGIN_LOG4CXX_CAST_MAP() 36 | LOG4CXX_CAST_ENTRY(Action) 37 | END_LOG4CXX_CAST_MAP() 38 | /** 39 | * Is action complete. 40 | */ 41 | bool complete; 42 | 43 | /** 44 | * Is action interrupted. 45 | */ 46 | bool interrupted; 47 | 48 | log4cxx::helpers::Pool pool; 49 | log4cxx::helpers::Mutex mutex; 50 | 51 | 52 | protected: 53 | /** 54 | * Constructor. 55 | */ 56 | Action(); 57 | virtual ~Action(); 58 | 59 | public: 60 | /** 61 | * Perform action. 62 | * 63 | * @return true if successful. 64 | */ 65 | virtual bool execute(log4cxx::helpers::Pool& pool) const = 0; 66 | 67 | void run(log4cxx::helpers::Pool& pool); 68 | 69 | void close(); 70 | 71 | /** 72 | * Tests if the action is complete. 73 | * @return true if action is complete. 74 | */ 75 | bool isComplete() const; 76 | 77 | void reportException(const std::exception&); 78 | 79 | 80 | }; 81 | 82 | LOG4CXX_PTR_DEF(Action); 83 | 84 | } 85 | } 86 | #endif 87 | 88 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/rolling/filerenameaction.h: -------------------------------------------------------------------------------- 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 | #if !defined(_LOG4CXX_ROLLING_FILE_RENAME_ACTION_H) 19 | #define _LOG4CXX_ROLLING_FILE_RENAME_ACTION_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx { 25 | namespace rolling { 26 | 27 | 28 | class FileRenameAction : public Action { 29 | const File source; 30 | const File destination; 31 | bool renameEmptyFile; 32 | public: 33 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(FileRenameAction) 34 | BEGIN_LOG4CXX_CAST_MAP() 35 | LOG4CXX_CAST_ENTRY(FileRenameAction) 36 | LOG4CXX_CAST_ENTRY_CHAIN(Action) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | /** 40 | * Constructor. 41 | */ 42 | FileRenameAction(const File& toRename, 43 | const File& renameTo, 44 | bool renameEmptyFile); 45 | 46 | /** 47 | * Perform action. 48 | * 49 | * @return true if successful. 50 | */ 51 | virtual bool execute(log4cxx::helpers::Pool& pool) const; 52 | }; 53 | 54 | LOG4CXX_PTR_DEF(FileRenameAction); 55 | 56 | } 57 | } 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/rolling/gzcompressaction.h: -------------------------------------------------------------------------------- 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 | #if !defined(_LOG4CXX_ROLLING_GZ_COMPRESS_ACTION_H) 19 | #define _LOG4CXX_ROLLING_GZ_COMPRESS_ACTION_H 20 | 21 | #if defined(_MSC_VER) 22 | #pragma warning ( push ) 23 | #pragma warning ( disable: 4231 4251 4275 4786 ) 24 | #endif 25 | 26 | #include 27 | #include 28 | 29 | namespace log4cxx { 30 | namespace rolling { 31 | 32 | 33 | class GZCompressAction : public Action { 34 | const File source; 35 | const File destination; 36 | bool deleteSource; 37 | public: 38 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(GZCompressAction) 39 | BEGIN_LOG4CXX_CAST_MAP() 40 | LOG4CXX_CAST_ENTRY(GZCompressAction) 41 | LOG4CXX_CAST_ENTRY_CHAIN(Action) 42 | END_LOG4CXX_CAST_MAP() 43 | 44 | /** 45 | * Constructor. 46 | */ 47 | GZCompressAction(const File& source, 48 | const File& destination, 49 | bool deleteSource); 50 | 51 | /** 52 | * Perform action. 53 | * 54 | * @return true if successful. 55 | */ 56 | virtual bool execute(log4cxx::helpers::Pool& pool) const; 57 | 58 | private: 59 | GZCompressAction(const GZCompressAction&); 60 | GZCompressAction& operator=(const GZCompressAction&); 61 | }; 62 | 63 | LOG4CXX_PTR_DEF(GZCompressAction); 64 | 65 | } 66 | } 67 | 68 | #if defined(_MSC_VER) 69 | #pragma warning ( pop ) 70 | #endif 71 | 72 | #endif 73 | 74 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/rolling/zipcompressaction.h: -------------------------------------------------------------------------------- 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 | #if !defined(_LOG4CXX_ROLLING_ZIP_COMPRESS_ACTION_H) 19 | #define _LOG4CXX_ROLLING_ZIP_COMPRESS_ACTION_H 20 | 21 | #if defined(_MSC_VER) 22 | #pragma warning ( push ) 23 | #pragma warning ( disable: 4231 4251 4275 4786 ) 24 | #endif 25 | 26 | 27 | #include 28 | #include 29 | 30 | namespace log4cxx { 31 | namespace rolling { 32 | 33 | 34 | class ZipCompressAction : public Action { 35 | const File source; 36 | const File destination; 37 | bool deleteSource; 38 | public: 39 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(ZipCompressAction) 40 | BEGIN_LOG4CXX_CAST_MAP() 41 | LOG4CXX_CAST_ENTRY(ZipCompressAction) 42 | LOG4CXX_CAST_ENTRY_CHAIN(Action) 43 | END_LOG4CXX_CAST_MAP() 44 | 45 | /** 46 | * Constructor. 47 | */ 48 | ZipCompressAction(const File& source, 49 | const File& destination, 50 | bool deleteSource); 51 | 52 | /** 53 | * Perform action. 54 | * 55 | * @return true if successful. 56 | */ 57 | virtual bool execute(log4cxx::helpers::Pool& pool) const; 58 | 59 | private: 60 | ZipCompressAction(const ZipCompressAction&); 61 | ZipCompressAction& operator=(const ZipCompressAction&); 62 | }; 63 | 64 | LOG4CXX_PTR_DEF(ZipCompressAction); 65 | 66 | } 67 | 68 | #if defined(_MSC_VER) 69 | #pragma warning ( pop ) 70 | #endif 71 | 72 | } 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | SUBDIRS = location 17 | spiincdir = $(includedir)/log4cxx/spi 18 | spiinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/spi/*.h 19 | 20 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/configurator.h: -------------------------------------------------------------------------------- 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_SPI_CONFIGURATOR_H 19 | #define _LOG4CXX_SPI_CONFIGURATOR_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | class File; 26 | 27 | namespace spi 28 | { 29 | /** 30 | Implemented by classes capable of configuring log4j using a URL. 31 | */ 32 | class LOG4CXX_EXPORT Configurator : virtual public helpers::Object 33 | { 34 | public: 35 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(Configurator) 36 | Configurator(); 37 | 38 | /** 39 | Interpret a resource pointed by a URL and set up log4j accordingly. 40 | 41 | The configuration is done relative to the hierarchy 42 | parameter. 43 | 44 | @param configFileName The file to parse 45 | @param repository The hierarchy to operation upon. 46 | */ 47 | virtual void doConfigure(const File& configFileName, 48 | spi::LoggerRepositoryPtr& repository) = 0; 49 | 50 | 51 | private: 52 | Configurator(const Configurator&); 53 | Configurator& operator=(const Configurator&); 54 | bool initialized; 55 | }; 56 | 57 | LOG4CXX_PTR_DEF(Configurator); 58 | } 59 | } 60 | 61 | #endif // _LOG4CXX_SPI_CONFIGURATOR_H 62 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/defaultrepositoryselector.h: -------------------------------------------------------------------------------- 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_SPI_DEFAULT_REPOSITORY_SELECTOR_H 19 | #define _LOG4CXX_SPI_DEFAULT_REPOSITORY_SELECTOR_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace log4cxx 26 | { 27 | namespace spi 28 | { 29 | class LOG4CXX_EXPORT DefaultRepositorySelector : 30 | public virtual RepositorySelector, 31 | public virtual helpers::ObjectImpl 32 | { 33 | public: 34 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(DefaultRepositorySelector) 35 | BEGIN_LOG4CXX_CAST_MAP() 36 | LOG4CXX_CAST_ENTRY(RepositorySelector) 37 | END_LOG4CXX_CAST_MAP() 38 | 39 | DefaultRepositorySelector(const LoggerRepositoryPtr& repository1); 40 | void addRef() const; 41 | void releaseRef() const; 42 | virtual LoggerRepositoryPtr& getLoggerRepository(); 43 | 44 | private: 45 | LoggerRepositoryPtr repository; 46 | }; 47 | } // namespace spi 48 | } // namespace log4cxx 49 | 50 | #endif //_LOG4CXX_SPI_DEFAULT_REPOSITORY_SELECTOR_H 51 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/hierarchyeventlistener.h: -------------------------------------------------------------------------------- 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_SPI_HIERARCHY_EVENT_LISTENER_H 19 | #define _LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H 20 | 21 | #if defined(_MSC_VER) 22 | #pragma warning ( push ) 23 | #pragma warning ( disable: 4231 4251 4275 4786 ) 24 | #endif 25 | 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | namespace log4cxx 32 | { 33 | class Logger; 34 | class Appender; 35 | 36 | 37 | namespace spi 38 | { 39 | 40 | /** Listen to events occuring within a Hierarchy.*/ 41 | class LOG4CXX_EXPORT HierarchyEventListener : 42 | public virtual log4cxx::helpers::Object 43 | { 44 | public: 45 | virtual ~HierarchyEventListener() {} 46 | 47 | virtual void addAppenderEvent( 48 | const log4cxx::helpers::ObjectPtrT& logger, 49 | const log4cxx::helpers::ObjectPtrT& appender) = 0; 50 | 51 | virtual void removeAppenderEvent( 52 | const log4cxx::helpers::ObjectPtrT& logger, 53 | const log4cxx::helpers::ObjectPtrT& appender) = 0; 54 | }; 55 | LOG4CXX_PTR_DEF(HierarchyEventListener); 56 | LOG4CXX_LIST_DEF(HierarchyEventListenerList, HierarchyEventListenerPtr); 57 | 58 | } // namespace spi 59 | } // namespace log4cxx 60 | 61 | #if defined(_MSC_VER) 62 | #pragma warning ( pop ) 63 | #endif 64 | 65 | #endif //_LOG4CXX_SPI_HIERARCHY_EVENT_LISTENER_H 66 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/location/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | spiincdir = $(includedir)/log4cxx/spi/location 17 | spiinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/spi/location/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/loggerfactory.h: -------------------------------------------------------------------------------- 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_SPI_LOGGERFACTORY_H 19 | #define _LOG4CXX_SPI_LOGGERFACTORY_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | 26 | namespace spi 27 | { 28 | /** 29 | Implement this interface to create new instances of Logger or 30 | a sub-class of Logger. 31 | */ 32 | class LOG4CXX_EXPORT LoggerFactory : public virtual helpers::Object 33 | { 34 | public: 35 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(LoggerFactory) 36 | virtual ~LoggerFactory() {} 37 | virtual LoggerPtr makeNewLoggerInstance( 38 | log4cxx::helpers::Pool& pool, 39 | const LogString& name) const = 0; 40 | }; 41 | 42 | 43 | } // namespace spi 44 | } // namesapce log4cxx 45 | 46 | #endif //_LOG4CXX_SPI_LOGGERFACTORY_H 47 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/repositoryselector.h: -------------------------------------------------------------------------------- 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_SPI_REPOSITORY_SELECTOR_H 19 | #define _LOG4CXX_SPI_REPOSITORY_SELECTOR_H 20 | 21 | #include 22 | #include 23 | 24 | namespace log4cxx 25 | { 26 | namespace spi 27 | { 28 | class LoggerRepository; 29 | typedef helpers::ObjectPtrT LoggerRepositoryPtr; 30 | 31 | /** 32 | The LogManager uses one (and only one) 33 | RepositorySelector implementation to select the 34 | {@link log4cxx::spi::LoggerRepository LoggerRepository} 35 | for a particular application context. 36 | 37 |

It is the responsability of the RepositorySelector 38 | implementation to track the application context. log4cxx makes no 39 | assumptions about the application context or on its management. 40 | 41 |

See also LogManager. 42 | */ 43 | class LOG4CXX_EXPORT RepositorySelector : public virtual helpers::Object 44 | { 45 | public: 46 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(RepositorySelector) 47 | virtual ~RepositorySelector() {} 48 | virtual LoggerRepositoryPtr& getLoggerRepository() = 0; 49 | }; 50 | LOG4CXX_PTR_DEF(RepositorySelector); 51 | } //namespace spi 52 | } //namespace log4cxx 53 | 54 | #endif //_LOG4CXX_SPI_REPOSITORY_SELECTOR_H 55 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/rootlogger.h: -------------------------------------------------------------------------------- 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_SPI_ROOT_LOGGER_H 19 | #define _LOG4CXX_SPI_ROOT_LOGGER_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace spi 26 | { 27 | /** 28 | RootLogger sits at the top of the logger hierachy. It is a 29 | regular logger except that it provides several guarantees. 30 | 31 |

First, it cannot be assigned a null 32 | level. Second, since root logger cannot have a parent, the 33 | #getEffectiveLevel method always returns the value of the 34 | level field without walking the hierarchy. 35 | */ 36 | class LOG4CXX_EXPORT RootLogger : public Logger 37 | { 38 | public: 39 | /** 40 | The root logger names itself as "root". However, the root 41 | logger cannot be retrieved by name. 42 | */ 43 | RootLogger(log4cxx::helpers::Pool& pool, const LevelPtr& level); 44 | 45 | /** 46 | Return the assigned level value without walking the logger 47 | hierarchy. 48 | */ 49 | virtual const LevelPtr& getEffectiveLevel() const; 50 | 51 | /** 52 | Setting a null value to the level of the root logger may have catastrophic 53 | results. We prevent this here. 54 | */ 55 | void setLevel(const LevelPtr& level); 56 | }; 57 | } // namespace spi 58 | } // namespace log4cxx 59 | 60 | #endif //_LOG4CXX_SPI_ROOT_LOGGER_H 61 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/spi/triggeringeventevaluator.h: -------------------------------------------------------------------------------- 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_SPI_TRIGGERING_EVENT_EVALUATOR_H 19 | #define _LOG4CXX_SPI_TRIGGERING_EVENT_EVALUATOR_H 20 | 21 | #include 22 | 23 | namespace log4cxx 24 | { 25 | namespace spi 26 | { 27 | /** 28 | Implementions of this interface allow certain appenders to decide 29 | when to perform an appender specific action. 30 | 31 |

For example the {@link net::SMTPAppender SMTPAppender} sends 32 | an email when the #isTriggeringEvent method returns 33 | true and adds the event to an internal buffer when the 34 | returned result is false. 35 | 36 | */ 37 | class LOG4CXX_EXPORT TriggeringEventEvaluator : public virtual helpers::Object 38 | { 39 | public: 40 | DECLARE_ABSTRACT_LOG4CXX_OBJECT(TriggeringEventEvaluator) 41 | /** 42 | Is this the triggering event? 43 | */ 44 | virtual bool isTriggeringEvent(const spi::LoggingEventPtr& event) = 0; 45 | }; 46 | LOG4CXX_PTR_DEF(TriggeringEventEvaluator); 47 | } 48 | } 49 | 50 | #endif // _LOG4CXX_SPI_TRIGGERING_EVENT_EVALUATOR_H 51 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/varia/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | variaincdir = $(includedir)/log4cxx/varia 17 | variainc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/varia/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/include/log4cxx/xml/Makefile.am: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | xmlincdir = $(includedir)/log4cxx/xml 17 | xmlinc_HEADERS= $(top_srcdir)/src/main/include/log4cxx/xml/*.h 18 | 19 | -------------------------------------------------------------------------------- /project/autoUpdate/lib/debug/gtestd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/debug/gtestd.lib -------------------------------------------------------------------------------- /project/autoUpdate/lib/debug/log4cxx.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/debug/log4cxx.lib -------------------------------------------------------------------------------- /project/autoUpdate/lib/debug/vc8libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/debug/vc8libcurl.lib -------------------------------------------------------------------------------- /project/autoUpdate/lib/release/gtest.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/release/gtest.lib -------------------------------------------------------------------------------- /project/autoUpdate/lib/release/log4cxx.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/release/log4cxx.lib -------------------------------------------------------------------------------- /project/autoUpdate/lib/release/vc8libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/lib/release/vc8libcurl.lib -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/IAutoUpdate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/auto_update/IAutoUpdate.cpp -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/auto_update.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/auto_update/auto_update.cc -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/auto_update.h: -------------------------------------------------------------------------------- 1 | #ifndef auto_update_h__ 2 | #define auto_update_h__ 3 | 4 | 5 | #include 6 | #include 7 | 8 | typedef struct updateFileInfo_ 9 | { 10 | std::string update_version; 11 | std::string file_url; 12 | std::string file_description; 13 | std::string file_checksum; 14 | }UPDATE_FILE_INFO; 15 | 16 | 17 | enum AUTO_UPDATE_EVENT 18 | { 19 | DOWNLOAD_FILE_START, 20 | CHECK_FILE_START, 21 | UNZIP_FILE_START, 22 | 23 | DOWNLOAD_FILE_DONE, 24 | CHECK_FILE_DONE, 25 | UNZIP_FILE_DONE, 26 | 27 | DOWNLOAD_FILE_FAILED, 28 | CHECK_FILE_FAILED, 29 | UNZIP_FILE_FAILED, 30 | 31 | DOWNLOAD_FILE_STOP, 32 | }; 33 | 34 | 35 | class IAutoUpdateEvent 36 | { 37 | public: 38 | 39 | virtual void RunEvent(int event_type) = 0; 40 | virtual void DownLoadProgress(const double total, const double downloaded) = 0; 41 | }; 42 | 43 | class CInitConfig; 44 | class CFileDownLoad; 45 | 46 | #ifndef UNIT_TEST 47 | 48 | #ifdef _DLL_MODE 49 | #define DLL_MODE_API __declspec(dllexport) 50 | #else 51 | #define DLL_MODE_API __declspec(dllimport) 52 | #endif 53 | 54 | #endif 55 | 56 | #ifndef UNIT_TEST 57 | class DLL_MODE_API CAutoUpdate 58 | #else 59 | class CAutoUpdate 60 | #endif 61 | { 62 | public: 63 | 64 | CAutoUpdate(void); 65 | ~CAutoUpdate(void); 66 | 67 | void Init(const UPDATE_FILE_INFO& updateFileInfo, const std::string& download_path, const std::string& replace_path); 68 | void SetAutoUpdateEvent(IAutoUpdateEvent* autoUpdateEvent) {pAutoUpdateEvent_ = autoUpdateEvent; } 69 | 70 | bool Run(); 71 | void StopDownloadFile(); 72 | 73 | private: 74 | 75 | static DWORD WINAPI RunThread(LPVOID param); 76 | 77 | bool CheckMD5(const std::string& get_md5, const std::string& source_file); 78 | bool UnzipFile(const std::string& source_file, const std::string& dest_path); 79 | 80 | private: 81 | 82 | UPDATE_FILE_INFO updateFileInfo_; 83 | std::string download_path_; 84 | std::string replace_path_; 85 | 86 | IAutoUpdateEvent* pAutoUpdateEvent_; 87 | CInitConfig* pInitConfig_; 88 | CFileDownLoad* pFileDownLoad_; 89 | 90 | bool running_; 91 | }; 92 | 93 | 94 | #endif // auto_update_h__ 95 | -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/dllmain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/auto_update/dllmain.cpp -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/file_download.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/auto_update/file_download.cc -------------------------------------------------------------------------------- /project/autoUpdate/src/auto_update/file_download.h: -------------------------------------------------------------------------------- 1 | #ifndef file_download_h__ 2 | #define file_download_h__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "auto_update.h" 8 | 9 | enum DOWNLOAD_RESULT 10 | { 11 | DOWNLOAD_SUCCESS, 12 | DOWNLOAD_STOP, 13 | DOWNLOAD_FAILED, 14 | }; 15 | 16 | class CFileDownLoad 17 | { 18 | public: 19 | CFileDownLoad(void); 20 | ~CFileDownLoad(void); 21 | 22 | int StartDownLoadFile(const std::string& fileurl, const std::string& local_path, IAutoUpdateEvent* pAutoUpdateEvent, std::string& local_full_path); 23 | 24 | void StopDownLoadFile(); 25 | 26 | private: 27 | 28 | static size_t my_write_func(void *buffer, size_t size, size_t count, void *stream); 29 | 30 | static int my_progress_func(IAutoUpdateEvent* autoUpdateEvent,double total, double reciced, double ultotal, double ulnow); 31 | 32 | static CURL *curl_; 33 | 34 | static bool stop_flag; 35 | 36 | static curl_off_t local_file_len_; 37 | 38 | }; 39 | #endif // file_download_h__ 40 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/atomic.h: -------------------------------------------------------------------------------- 1 | #ifndef ATOMIC_HPP_ 2 | #define ATOMIC_HPP_ 3 | 4 | #if defined(WIN32) || defined(WIN64) 5 | 6 | #include 7 | 8 | #define atomic_inc(a, b) ((b) + _InterlockedExchangeAdd(a, b)) 9 | #define atomic_dec(a, b) (-(b) + _InterlockedExchangeAdd(a, -(b))) 10 | #define atomic_compare_and_swap(a, b, c) ((b) == _InterlockedCompareExchange(a, c, b)) 11 | //#define atomic_and __sync_and_and_fetch 12 | //#define atomic_or __sync_or_and_fetch 13 | //#define atomic_xor __sync_xor_and_fetch 14 | //#define atomic_nand __sync_nand_and_fetch 15 | 16 | #else 17 | 18 | #define atomic_inc __sync_add_and_fetch 19 | #define atomic_dec __sync_sub_and_fetch 20 | #define atomic_compare_and_swap __sync_bool_compare_and_swap 21 | //#define atomic_and __sync_and_and_fetch 22 | //#define atomic_or __sync_or_and_fetch 23 | //#define atomic_xor __sync_xor_and_fetch 24 | //#define atomic_nand __sync_nand_and_fetch 25 | 26 | #endif // defined(WIN32) || defined(WIN64) 27 | 28 | #endif // ATOMIC_HPP_ 29 | 30 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/behavior.h: -------------------------------------------------------------------------------- 1 | 2 | typedef enum behaior_type 3 | { 4 | BEHAVIOR_SHORT_CONN, 5 | BEHAVIOR_PERSISTENT_CONN, 6 | BEHAVIOR_NO_BLOCK, 7 | BEHAVIOR_TCP_NODELAY, 8 | BEHAVIOR_SOCKET_SEND_SIZE, 9 | BEHAVIOR_SOCKET_RECV_SIZE, 10 | BEHAVIOR_CONNECT_TIMEOUT, 11 | BEHAVIOR_RETRY_TIMEOUT, 12 | BEHAVIOR_SND_TIMEOUT, 13 | BEHAVIOR_RCV_TIMEOUT, 14 | BEHAVIOR_USE_UDP, 15 | } 16 | BEHAVIOR_TYPE; -------------------------------------------------------------------------------- /project/autoUpdate/src/common/defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * defines.h 3 | * 4 | * Created on: 2012-9-12 5 | * Author: yaowei 6 | */ 7 | 8 | #ifndef DEFINES_H_ 9 | #define DEFINES_H_ 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | using namespace log4cxx; 16 | extern LoggerPtr g_logger; 17 | 18 | #define CRLF "\r\n" 19 | #define GROUP_NUM_START 1000 20 | 21 | 22 | #endif /* DEFINES_H_ */ 23 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/guard.cc: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef WIN32 4 | #include 5 | #include 6 | #include 7 | #ifdef OSX 8 | #include 9 | #endif 10 | #else 11 | #include 12 | #include 13 | #ifdef LEGACY_WIN32 14 | #include 15 | #endif 16 | #endif 17 | #include "guard.h" 18 | // 19 | // Automatically lock in constructor 20 | CGuard::CGuard(pthread_mutex_t& lock): 21 | m_Mutex(lock), 22 | m_iLocked() 23 | { 24 | #ifndef WIN32 25 | m_iLocked = pthread_mutex_lock(&m_Mutex); 26 | #else 27 | m_iLocked = WaitForSingleObject(m_Mutex, INFINITE); 28 | #endif 29 | } 30 | 31 | // Automatically unlock in destructor 32 | CGuard::~CGuard() 33 | { 34 | #ifndef WIN32 35 | if (0 == m_iLocked) 36 | pthread_mutex_unlock(&m_Mutex); 37 | #else 38 | if (WAIT_FAILED != m_iLocked) 39 | ReleaseMutex(m_Mutex); 40 | #endif 41 | } 42 | 43 | void CGuard::enterCS(pthread_mutex_t& lock) 44 | { 45 | #ifndef WIN32 46 | pthread_mutex_lock(&lock); 47 | #else 48 | WaitForSingleObject(lock, INFINITE); 49 | #endif 50 | } 51 | 52 | void CGuard::leaveCS(pthread_mutex_t& lock) 53 | { 54 | #ifndef WIN32 55 | pthread_mutex_unlock(&lock); 56 | #else 57 | ReleaseMutex(lock); 58 | #endif 59 | } 60 | 61 | void CGuard::createMutex(pthread_mutex_t& lock) 62 | { 63 | #ifndef WIN32 64 | pthread_mutex_init(&lock, NULL); 65 | #else 66 | lock = CreateMutex(NULL, false, NULL); 67 | #endif 68 | } 69 | 70 | void CGuard::releaseMutex(pthread_mutex_t& lock) 71 | { 72 | #ifndef WIN32 73 | pthread_mutex_destroy(&lock); 74 | #else 75 | CloseHandle(lock); 76 | #endif 77 | } 78 | 79 | void CGuard::createCond(pthread_cond_t& cond) 80 | { 81 | #ifndef WIN32 82 | pthread_cond_init(&cond, NULL); 83 | #else 84 | cond = CreateEvent(NULL, false, false, NULL); 85 | #endif 86 | } 87 | 88 | void CGuard::releaseCond(pthread_cond_t& cond) 89 | { 90 | #ifndef WIN32 91 | pthread_cond_destroy(&cond); 92 | #else 93 | CloseHandle(cond); 94 | #endif 95 | 96 | } 97 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/init_configure.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Init_log4cxx.cc 3 | * 4 | * Created on: 2012-9-12 5 | * Author: yaowei 6 | */ 7 | 8 | #include "init_configure.h" 9 | #include "config_file.h" 10 | #include "defines.h" 11 | #include "path_utils.h" 12 | #include "utils.h" 13 | #include "EncodingConverter.h" 14 | 15 | #ifndef AUTO_UPDATE 16 | #define LOG_CON_FILE L"\\config\\log.conf" 17 | #else 18 | #define LOG_CON_FILE L"\\config\\AutoUpdateLog.conf" 19 | #endif 20 | 21 | 22 | #define CONF_FILE "\\config\\config.ini" 23 | 24 | LoggerPtr g_logger; 25 | 26 | CInitConfig::CInitConfig() { 27 | // TODO Auto-generated constructor stub 28 | 29 | } 30 | 31 | CInitConfig::~CInitConfig() { 32 | // TODO Auto-generated destructor stub 33 | } 34 | 35 | void CInitConfig::InitLog4cxx(std::string project_name) { 36 | /** 读取配置文件 */ 37 | current_path_ = path_utils::GetModuleDirectory(NULL); 38 | 39 | std::wstring ws_current_path = EncodingConverter::ToWideString(current_path_.c_str()); 40 | #ifdef UNIT_TEST 41 | PropertyConfigurator::configure(ws_current_path + LOG_CON_FILE); 42 | #endif 43 | g_logger = Logger::getLogger(project_name); 44 | LOG4CXX_INFO(g_logger, "Run."); 45 | } 46 | 47 | bool CInitConfig::LoadConfiguration(std::string& file_path ) 48 | { 49 | std::locale old_locale = std::locale::global(std::locale("")); 50 | file_path = current_path_ + CONF_FILE; 51 | std::ifstream conf_file(file_path.c_str()); 52 | std::locale::global(old_locale); 53 | if(!conf_file) 54 | { 55 | LOG4CXX_ERROR(g_logger, "CInitConfig::LoadConfiguration failed."); 56 | return false; 57 | } 58 | conf_file >> utils::G(); 59 | return true; 60 | } 61 | 62 | std::string CInitConfig::getCurrentPath() const 63 | { 64 | return current_path_; 65 | } 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/init_configure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * init_log4cxx.h 3 | * 4 | * Created on: 2012-9-12 5 | * Author: yaowei 6 | */ 7 | 8 | #ifndef INIT_LOG4CXX_H_ 9 | #define INIT_LOG4CXX_H_ 10 | 11 | #include 12 | 13 | 14 | class CInitConfig { 15 | public: 16 | CInitConfig(); 17 | virtual ~CInitConfig(); 18 | 19 | public: 20 | 21 | void InitLog4cxx(std::string project_name); 22 | 23 | bool LoadConfiguration(std::string& file_path ); 24 | 25 | std::string getCurrentPath() const; 26 | 27 | private: 28 | 29 | std::string current_path_; 30 | }; 31 | 32 | #endif /* INIT_LOG4CXX_H_ */ 33 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/md5_expand.h: -------------------------------------------------------------------------------- 1 | #ifndef MD5_H 2 | #define MD5_H 3 | 4 | #include 5 | #include 6 | 7 | /* Type define */ 8 | typedef unsigned char byte; 9 | typedef unsigned int uint32; 10 | 11 | using std::string; 12 | using std::ifstream; 13 | 14 | /* MD5 declaration. */ 15 | class MD5 { 16 | public: 17 | MD5(); 18 | MD5(const void* input, size_t length); 19 | MD5(const string& str); 20 | MD5(ifstream& in); 21 | void update(const void* input, size_t length); 22 | void update(const string& str); 23 | void update(ifstream& in); 24 | const byte* digest(); 25 | string toString(); 26 | void reset(); 27 | 28 | private: 29 | void update(const byte* input, size_t length); 30 | void final(); 31 | void transform(const byte block[64]); 32 | void encode(const uint32* input, byte* output, size_t length); 33 | void decode(const byte* input, uint32* output, size_t length); 34 | string bytesToHexString(const byte* input, size_t length); 35 | 36 | /* class uncopyable */ 37 | MD5(const MD5&); 38 | MD5& operator=(const MD5&); 39 | 40 | private: 41 | uint32 _state[4]; /* state (ABCD) */ 42 | uint32 _count[2]; /* number of bits, modulo 2^64 (low-order word first) */ 43 | byte _buffer[64]; /* input buffer */ 44 | byte _digest[16]; /* message digest */ 45 | bool _finished; /* calculate finished ? */ 46 | 47 | static const byte PADDING[64]; /* padding for calculate */ 48 | static const char HEX[16]; 49 | enum { BUFFER_SIZE = 1024 }; 50 | }; 51 | 52 | #endif /*MD5_H*/ -------------------------------------------------------------------------------- /project/autoUpdate/src/common/mini_dump.h: -------------------------------------------------------------------------------- 1 | #ifndef __MINIDUMP_H__ 2 | #define __MINIDUMP_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class MiniDumper 9 | { 10 | private: 11 | static CRITICAL_SECTION cs_; 12 | MiniDumper(); 13 | MiniDumper(const MiniDumper & ){} 14 | 15 | static LONG WINAPI HandleException(LPEXCEPTION_POINTERS pExceptionPointers); 16 | public: 17 | ~MiniDumper(); 18 | 19 | static MiniDumper & Instance(); 20 | void Install(); 21 | }; 22 | 23 | 24 | #endif //__MINIDUMP_H__ 25 | -------------------------------------------------------------------------------- /project/autoUpdate/src/common/password_md5crypt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/common/password_md5crypt.h -------------------------------------------------------------------------------- /project/autoUpdate/src/common/path_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/src/common/path_utils.h -------------------------------------------------------------------------------- /project/autoUpdate/vcprojects/IAutoUpdate/IAutoUpdate.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/vcprojects/IAutoUpdate/IAutoUpdate.vcproj -------------------------------------------------------------------------------- /project/autoUpdate/vcprojects/IAutoUpdate/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/vcprojects/IAutoUpdate/resource.h -------------------------------------------------------------------------------- /project/autoUpdate/vcprojects/IAutoUpdate/resource_temp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/project/autoUpdate/vcprojects/IAutoUpdate/resource_temp.h -------------------------------------------------------------------------------- /project/autoUpdate/vcprojects/UnitTestAutoUpdate/UnitTestAutoUpdate.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | int main(int argc, char* argv[]) 4 | { 5 | ::testing::InitGoogleTest(&argc, argv); 6 | //testing::GTEST_FLAG(repeat) = 5; 7 | //testing::GTEST_FLAG(filter) = "UserClientSDK.reentrant*"; 8 | 9 | RUN_ALL_TESTS(); 10 | 11 | for (;;) 12 | { 13 | } 14 | return 0; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /project/autoUpdate/vcprojects/autoUpdate.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IAutoUpdate", "IAutoUpdate\IAutoUpdate.vcproj", "{4A027E87-8FAE-425C-831E-8A94ED059229}" 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTestAutoUpdate", "UnitTestAutoUpdate\UnitTestAutoUpdate.vcproj", "{18A322C8-162B-4C31-BBF4-B8DFCEC29ECA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Release|Win32 = Release|Win32 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {4A027E87-8FAE-425C-831E-8A94ED059229}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {4A027E87-8FAE-425C-831E-8A94ED059229}.Debug|Win32.Build.0 = Debug|Win32 16 | {4A027E87-8FAE-425C-831E-8A94ED059229}.Release|Win32.ActiveCfg = Release|Win32 17 | {4A027E87-8FAE-425C-831E-8A94ED059229}.Release|Win32.Build.0 = Release|Win32 18 | {18A322C8-162B-4C31-BBF4-B8DFCEC29ECA}.Debug|Win32.ActiveCfg = Debug|Win32 19 | {18A322C8-162B-4C31-BBF4-B8DFCEC29ECA}.Debug|Win32.Build.0 = Debug|Win32 20 | {18A322C8-162B-4C31-BBF4-B8DFCEC29ECA}.Release|Win32.ActiveCfg = Release|Win32 21 | {18A322C8-162B-4C31-BBF4-B8DFCEC29ECA}.Release|Win32.Build.0 = Release|Win32 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /script/python/packet2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/script/python/packet2.py -------------------------------------------------------------------------------- /script/python/packet3.py: -------------------------------------------------------------------------------- 1 | __author__ = 'yw' 2 | # -*- coding: utf-8 -* 3 | 4 | #copyFiles拷贝指定源目录下所有文件(除去svn文件)到指定目的目录,delete_extension方法删除该目录下指定类型文件 5 | 6 | import os 7 | 8 | def copyFiles(sourceDir, targetDir): 9 | if sourceDir.find(".svn") > 0: 10 | return 11 | for file in os.listdir(sourceDir): 12 | sourceFile = os.path.join(sourceDir, file) 13 | targetFile = os.path.join(targetDir, file) 14 | if os.path.isfile(sourceFile): 15 | if not os.path.exists(targetDir): 16 | os.makedirs(targetDir) 17 | if not os.path.exists(targetFile) or(os.path.exists(targetFile) and (os.path.getsize(targetFile) != os.path.getsize(sourceFile))): 18 | open(targetFile, "wb").write(open(sourceFile, "rb").read()) 19 | if os.path.isdir(sourceFile): 20 | First_Directory = False 21 | copyFiles(sourceFile, targetFile) 22 | 23 | def delete_extension(path,extension_list): 24 | for extension in extension_list: 25 | length=len(extension) 26 | for root ,dirs, files in os.walk(path): 27 | for file_path in files: 28 | if file_path[-length:]==extension: 29 | os.remove(os.path.join(root,file_path)) 30 | print file_path+" has deleted" 31 | 32 | if __name__ =="__main__": 33 | copyFiles("d:\src", "d:\dest3") 34 | extension_list = ['bat'] 35 | delete_extension("d:\dest3", extension_list) -------------------------------------------------------------------------------- /script/shell/bakup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage:$0 verx.x_yyyyMMdd" 5 | exit 0 6 | fi 7 | 8 | APP_PATH=/home/**/ 9 | BAK_PATH=${APP_PATH}/run_bak/$1 10 | 11 | if [ ! -d ${BAK_PATH} ]; then 12 | mkdir -p ${BAK_PATH} 13 | fi 14 | 15 | if [ -d ${APP_PATH}/bin ]; then 16 | echo "cp bin..." 17 | cp -r ${APP_PATH}/bin ${BAK_PATH} 18 | fi 19 | 20 | if [ -d ${APP_PATH}/lib ]; then 21 | echo "cp lib..." 22 | cp -r ${APP_PATH}/lib ${BAK_PATH} 23 | fi 24 | 25 | if [ -d ${APP_PATH}/conf ]; then 26 | echo "cp conf..." 27 | cp -r ${APP_PATH}/conf ${BAK_PATH} 28 | fi 29 | 30 | if [ -d ${APP_PATH}/src ]; then 31 | echo "cp src..." 32 | cp -r ${APP_PATH}/src ${BAK_PATH} 33 | fi 34 | 35 | echo "done." 36 | exit 0 37 | -------------------------------------------------------------------------------- /script/shell/check_process.sh: -------------------------------------------------------------------------------- 1 | echo "***********************[]******************************" 2 | ps -ef | grep []$ | grep -v 'grep' -------------------------------------------------------------------------------- /script/shell/delouttime_file.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/script/shell/delouttime_file.sh -------------------------------------------------------------------------------- /script/shell/kill_process.sh: -------------------------------------------------------------------------------- 1 | killall [] 2 | echo "killall success!" 3 | -------------------------------------------------------------------------------- /script/shell/mysql_backup.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/script/shell/mysql_backup.sh -------------------------------------------------------------------------------- /script/shell/process_monitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | APP_PATH=[] 3 | . ${APP_PATH}/.bash_profile 4 | 5 | xid=`ps ux|grep redis-server$|grep -v grep|awk '{ print $2 }'` 6 | if [[ ${xid} = '' ]] 7 | then 8 | echo "run redis-server" 9 | nohup /usr/local/bin/redis-server > /dev/null 2>&1 & 10 | sleep 1 11 | fi 12 | 13 | 14 | -------------------------------------------------------------------------------- /script/shell/run_process.sh: -------------------------------------------------------------------------------- 1 | nohup /usr/local/bin/redis-server > /dev/null 2>&1 & 2 | sleep 1 3 | 4 | -------------------------------------------------------------------------------- /script/windows-bat/KillTest.bat: -------------------------------------------------------------------------------- 1 | taskkill /IM UnitTest.exe -------------------------------------------------------------------------------- /script/windows-bat/RunbatchTest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set b=0 3 | :a 4 | set /a b=b+1 5 | start UnitTest.exe 6 | SET SLEEP=ping 127.0.0.1 -n 7 |   %SLEEP% 30 > nul 8 | if %b%==200 exit 9 | goto:a 10 | 11 | rem 30 间隔秒数 200 执行次数 12 | -------------------------------------------------------------------------------- /script/windows-bat/killcmd.bat: -------------------------------------------------------------------------------- 1 | taskkill /IM cmd.exe -------------------------------------------------------------------------------- /src/algorithm/password_md5crypt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/src/algorithm/password_md5crypt.h -------------------------------------------------------------------------------- /src/common/guard.cc: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef WIN32 4 | #include 5 | #include 6 | #include 7 | #ifdef OSX 8 | #include 9 | #endif 10 | #else 11 | #include 12 | #include 13 | #ifdef LEGACY_WIN32 14 | #include 15 | #endif 16 | #endif 17 | #include "guard.h" 18 | // 19 | // Automatically lock in constructor 20 | CGuard::CGuard(pthread_mutex_t& lock): 21 | m_Mutex(lock), 22 | m_iLocked() 23 | { 24 | #ifndef WIN32 25 | m_iLocked = pthread_mutex_lock(&m_Mutex); 26 | #else 27 | m_iLocked = WaitForSingleObject(m_Mutex, INFINITE); 28 | #endif 29 | } 30 | 31 | // Automatically unlock in destructor 32 | CGuard::~CGuard() 33 | { 34 | #ifndef WIN32 35 | if (0 == m_iLocked) 36 | pthread_mutex_unlock(&m_Mutex); 37 | #else 38 | if (WAIT_FAILED != m_iLocked) 39 | ReleaseMutex(m_Mutex); 40 | #endif 41 | } 42 | 43 | void CGuard::enterCS(pthread_mutex_t& lock) 44 | { 45 | #ifndef WIN32 46 | pthread_mutex_lock(&lock); 47 | #else 48 | WaitForSingleObject(lock, INFINITE); 49 | #endif 50 | } 51 | 52 | void CGuard::leaveCS(pthread_mutex_t& lock) 53 | { 54 | #ifndef WIN32 55 | pthread_mutex_unlock(&lock); 56 | #else 57 | ReleaseMutex(lock); 58 | #endif 59 | } 60 | 61 | void CGuard::createMutex(pthread_mutex_t& lock) 62 | { 63 | #ifndef WIN32 64 | pthread_mutex_init(&lock, NULL); 65 | #else 66 | lock = CreateMutex(NULL, false, NULL); 67 | #endif 68 | } 69 | 70 | void CGuard::releaseMutex(pthread_mutex_t& lock) 71 | { 72 | #ifndef WIN32 73 | pthread_mutex_destroy(&lock); 74 | #else 75 | CloseHandle(lock); 76 | #endif 77 | } 78 | 79 | void CGuard::createCond(pthread_cond_t& cond) 80 | { 81 | #ifndef WIN32 82 | pthread_cond_init(&cond, NULL); 83 | #else 84 | cond = CreateEvent(NULL, false, false, NULL); 85 | #endif 86 | } 87 | 88 | void CGuard::releaseCond(pthread_cond_t& cond) 89 | { 90 | #ifndef WIN32 91 | pthread_cond_destroy(&cond); 92 | #else 93 | CloseHandle(cond); 94 | #endif 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/common/guard.h: -------------------------------------------------------------------------------- 1 | 2 | /***************************************************************************** 3 | written by 4 | Yunhong Gu, last updated 08/01/2009 5 | *****************************************************************************/ 6 | 7 | 8 | #ifndef guard_h__ 9 | #define guard_h__ 10 | 11 | #ifndef WIN32 12 | #include 13 | #include 14 | #include 15 | #else 16 | #include 17 | #endif 18 | #include 19 | 20 | 21 | #ifdef WIN32 22 | // Windows compability 23 | typedef HANDLE pthread_t; 24 | typedef HANDLE pthread_mutex_t; 25 | typedef HANDLE pthread_cond_t; 26 | typedef DWORD pthread_key_t; 27 | #endif 28 | 29 | 30 | class CGuard 31 | { 32 | public: 33 | CGuard(pthread_mutex_t& lock); 34 | ~CGuard(); 35 | 36 | public: 37 | static void enterCS(pthread_mutex_t& lock); 38 | static void leaveCS(pthread_mutex_t& lock); 39 | 40 | static void createMutex(pthread_mutex_t& lock); 41 | static void releaseMutex(pthread_mutex_t& lock); 42 | 43 | static void createCond(pthread_cond_t& cond); 44 | static void releaseCond(pthread_cond_t& cond); 45 | 46 | private: 47 | pthread_mutex_t& m_Mutex; // Alias name of the mutex to be protected 48 | int m_iLocked; // Locking status 49 | 50 | CGuard& operator=(const CGuard&); 51 | }; 52 | 53 | #endif // guard_h__ 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/common/mini_dump.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @section DESCRIPTION 4 | * Generate dump files when the program crashes (use WinDbg) 5 | Usage: MiniDumper::Instance().Install(); 6 | */ 7 | 8 | #ifndef __MINIDUMP_H__ 9 | #define __MINIDUMP_H__ 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | class MiniDumper 17 | { 18 | private: 19 | static CRITICAL_SECTION cs_; 20 | MiniDumper(); 21 | MiniDumper(const MiniDumper & ){} 22 | 23 | static LONG WINAPI HandleException(LPEXCEPTION_POINTERS pExceptionPointers); 24 | public: 25 | ~MiniDumper(); 26 | 27 | static MiniDumper & Instance(); 28 | void Install(); 29 | }; 30 | 31 | 32 | #endif //__MINIDUMP_H__ 33 | -------------------------------------------------------------------------------- /src/common/path_utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/src/common/path_utils.h -------------------------------------------------------------------------------- /src/common/socket_common.h: -------------------------------------------------------------------------------- 1 | int connect_nonb( int sockfd, struct sockaddr* saptr, socklen_t salen, int nsec ) 2 | { 3 | int ret, n, error = 0; 4 | socklen_t len; 5 | FD_SET rset, wset; 6 | struct timeval tval; 7 | unsigned long ul=1; 8 | unsigned long ul1=0; 9 | 10 | ret = ioctlsocket(sockfd, FIONBIO, (unsigned long *)&ul); //设置成非阻塞模式 11 | if (SOCKET_ERROR == ret) 12 | { 13 | LOG4CXX_ERROR(g_logger, "connect_nonb:ioctlsocket failed. errorcode = " << WSAGetLastError()); 14 | return -1; 15 | } 16 | 17 | if ((n = ::connect(sockfd, saptr, salen) < 0)) 18 | { 19 | error = WSAGetLastError(); 20 | if (WSAEWOULDBLOCK != error) 21 | { 22 | LOG4CXX_ERROR(g_logger, "connect_nonb:connect failed. errorcode = " << error); 23 | return -1; 24 | } 25 | } 26 | 27 | if(0 == n) 28 | goto done; 29 | 30 | FD_ZERO(&rset); 31 | FD_SET(sockfd, &rset); 32 | wset = rset; 33 | tval.tv_sec = nsec; 34 | tval.tv_usec = 0; 35 | 36 | if ((n = select(sockfd+1, &rset, &wset, NULL, nsec?&tval:NULL)) == 0) 37 | { 38 | ::closesocket(sockfd); 39 | error = WSAETIMEDOUT; 40 | return -2; 41 | } 42 | 43 | if (FD_ISSET(sockfd, &rset) || FD_ISSET(sockfd, &wset)) 44 | { 45 | len = sizeof(error); 46 | if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (char*)&error, &len) < 0) 47 | { 48 | LOG4CXX_ERROR(g_logger, "connect_nonb:getsockopt failed. errorcode = " << WSAGetLastError()); 49 | return -1; 50 | } 51 | } 52 | 53 | done: 54 | ret = ioctlsocket(sockfd, FIONBIO, (unsigned long*)&ul1); 55 | if (SOCKET_ERROR == ret) 56 | { 57 | LOG4CXX_ERROR(g_logger, "connect_nonb:ioctlsocket1 failed. errorcode = " << WSAGetLastError()); 58 | return -1; 59 | } 60 | 61 | return 0; 62 | } -------------------------------------------------------------------------------- /src/common/threadSafe_container.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yaocoder/utility/ed2564e125792a1090c7869f2773d6d1a78a7f64/src/common/threadSafe_container.h -------------------------------------------------------------------------------- /src/common/time_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef time_utils_h__ 2 | #define time_utils_h__ 3 | 4 | #ifndef WIN32 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | 11 | namespace time_utils 12 | { 13 | 14 | #ifndef WIN32 15 | 16 | inline std::string NowtimeString() 17 | { 18 | time_t time_; 19 | struct tm *ptm; 20 | time_ = time(NULL); 21 | ptm = localtime(&time_); 22 | char temp[100] = {0}; 23 | snprintf(temp,sizeof(temp), "%Y-%m-%d %d:%d:%d",ptm->tm_year + 1900, ptm->tm_mon + 1, ptm->tm_mday, ptm->tm_hour, ptm->tm_min, ptm->tm_sec); 24 | std::string str; 25 | str.assign(temp); 26 | return str; 27 | } 28 | 29 | #else 30 | inline std::string NowtimeString() 31 | { 32 | std::time_t time_now = std::time(NULL); 33 | tm* tm_now = localtime(&time_now); 34 | char time_str[sizeof("yyyy-mm-dd hh:mm:ss")] = {0}; 35 | std::strftime(time_str, sizeof(time_str), "%Y-%m-%d %H:%M:%S", tm_now); 36 | return time_str; 37 | } 38 | 39 | inline std::string FormatTimeString(unsigned __int64 time_stamp) 40 | { 41 | std::time_t time_then = time_stamp; 42 | tm* tm_now = localtime(&time_then); 43 | char time_str[sizeof("yyyy-mm-dd hh:mm:ss")] = {0}; 44 | std::strftime(time_str, sizeof(time_str), "%Y-%m-%d %H:%M:%S", tm_now); 45 | return time_str; 46 | } 47 | 48 | #endif 49 | 50 | 51 | } 52 | 53 | #endif // time_utils_h__ -------------------------------------------------------------------------------- /src/sql/sql_conn_pool.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * 3 | * created: 2011/11/08 4 | * 5 | * filename: sql_conn_pool.h 6 | * 7 | * description: 数据库连接池 8 | * 9 | * author: wei yao 10 | * 11 | * modify by: 12 | * 13 | * modify description: 14 | * 15 | *********************************************************************/ 16 | #ifndef CONN_POOL_H 17 | #define CONN_POOL_H 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | using namespace std; 31 | 32 | #define SAFE_CLOSE(x) \ 33 | { \ 34 | if (x != 0){ \ 35 | try{x->close();}catch(...){}; \ 36 | delete x; \ 37 | x = 0; \ 38 | } \ 39 | } 40 | 41 | #define SAFE_CLOSE2(x,y) \ 42 | { \ 43 | if (x != 0){ \ 44 | try{x->close();}catch(...){}; \ 45 | delete x; \ 46 | x = 0; \ 47 | } \ 48 | if (y != 0){ \ 49 | try{y->close();}catch(...){}; \ 50 | delete y; \ 51 | y = 0; \ 52 | } \ 53 | } 54 | 55 | typedef struct sqlConnInfo_ 56 | { 57 | int max_conn_num; 58 | std::string ip; 59 | std::string port; 60 | std::string user_name; 61 | std::string password; 62 | } SqlConnInfo; 63 | 64 | class CSqlConnPool 65 | { 66 | public: 67 | CSqlConnPool(); 68 | ~CSqlConnPool(); 69 | 70 | void Init(const SqlConnInfo& sqlConnInfo); 71 | void Destroy(); 72 | 73 | void SetDBName(const char* DBName); 74 | 75 | sql::Connection*GetConnection(); 76 | void ReleaseConnection(sql::Connection * conn); 77 | 78 | private: 79 | 80 | SqlConnInfo sqlConnInfo_; 81 | 82 | boost::mutex mutex_; 83 | sql::Driver* driver_; 84 | const char* DBName_; 85 | deque queue_conn_; 86 | 87 | sql::Connection * CreateConnection(); 88 | void TerminateConnection(sql::Connection * conn); 89 | bool IsValidConnection(sql::Connection *conn); //判断数据库连接是否有效(为了解决8小时连接失效问题) 90 | }; 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /src/sql/sql_utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author yaocoder 3 | * @section DESCRIPTION 4 | * 组装SQL查询语句 5 | */ 6 | 7 | #ifndef SQL_UTILS_H_ 8 | #define SQL_UTILS_H_ 9 | 10 | #include 11 | #include 12 | using namespace std; 13 | namespace SQL_UTILS 14 | { 15 | 16 | enum ConditionType 17 | { 18 | CT_EQUAL = 1, CT_EQUAL_STRING, CT_NOT_EQUAL, CT_ABOVE, CT_BELOW, CT_FUZZY, CT_AREA, CT_GROUP, 19 | }; 20 | 21 | 22 | // 查询条件结构 23 | class SelCondition 24 | { 25 | public: 26 | //针对范围 27 | void SetCondition(string valueFirst, string valueSecond, int conType) 28 | { 29 | m_strValueFirst = valueFirst; 30 | m_strValueSecond = valueSecond; 31 | m_conType = conType; 32 | } 33 | //针对一个条件 34 | void SetCondition(string valueFirst, int conType) 35 | { 36 | m_strValueFirst = valueFirst; 37 | m_conType = conType; 38 | } 39 | 40 | string m_strValueFirst; 41 | string m_strValueSecond; 42 | int m_conType; 43 | 44 | }; 45 | 46 | typedef map MAP_SELECTCONDITION; 47 | 48 | // 返回不带 where 的条件语句,并且是以 and 开头,例如 and id>8 and name=aiht 49 | string AssembleCondition(const map& mapConditions) 50 | { 51 | string strCondition = ""; 52 | 53 | typedef map::const_iterator CI; 54 | for (CI p = mapConditions.begin(); p != mapConditions.end(); ++p) 55 | { 56 | string strCmd; 57 | string colName = p->first; 58 | 59 | //进行查询类型的判定拼装相应条件 60 | switch (p->second.m_conType) 61 | { 62 | case CT_ABOVE: 63 | strCmd = string(" AND ") + colName + string(" > '") + p->second.m_strValueFirst + string("'"); 64 | break; 65 | case CT_BELOW: 66 | strCmd = string(" AND ") + colName + string(" < '") + p->second.m_strValueFirst + string("'"); 67 | break; 68 | case CT_EQUAL_STRING: 69 | strCmd = string(" AND ") + colName + string(" = '") + p->second.m_strValueFirst + string("'"); 70 | break; 71 | case CT_EQUAL: 72 | strCmd = string(" AND ") + colName + string(" = ") + p->second.m_strValueFirst; 73 | break; 74 | case CT_NOT_EQUAL: 75 | strCmd = string(" AND ") + colName + string(" != '") + p->second.m_strValueFirst + string("'"); 76 | break; 77 | case CT_FUZZY: 78 | strCmd = string(" AND ") + colName + string(" like '%") + p->second.m_strValueFirst + string("%'"); 79 | break; 80 | case CT_AREA: 81 | strCmd = string(" AND ") + colName + string(" BETWEEN '") + p->second.m_strValueFirst + string("' AND '") 82 | + p->second.m_strValueSecond + string("'"); 83 | break; 84 | case CT_GROUP: 85 | strCmd = string(" group by StartTime "); 86 | break; 87 | default: 88 | ; 89 | 90 | } 91 | strCondition += strCmd; 92 | } 93 | return strCondition; 94 | } 95 | 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /src/timer/libevent_timer.h: -------------------------------------------------------------------------------- 1 | //============================================================================ 2 | // Author : yaocoder 3 | // Version : 4 | // Copyright : Your copyright notice 5 | // Description : libevent封装的定时器 6 | //============================================================================ 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | typedef void (*Func)(void* param); 15 | 16 | class TimerImplByLibevent 17 | { 18 | 19 | public: 20 | TimerImplByLibevent(Func f, void* param, long seconds) :param_(param),heartBeatSeconds_(seconds), func_(f) 21 | { 22 | b_stop_ = false; 23 | base_ = event_init(); 24 | tv_.tv_sec = heartBeatSeconds_; 25 | tv_.tv_usec = 0; 26 | evtimer_set(&ev_, time_cb, (void*)this); 27 | event_add(&ev_, &tv_); 28 | } 29 | 30 | void Run() 31 | { 32 | event_base_dispatch(base_); 33 | } 34 | 35 | void Stop() 36 | { 37 | b_stop_ = true; 38 | // struct timeval tv; 39 | // tv.tv_sec = 2; 40 | // tv.tv_usec = 0; 41 | event_base_loopbreak(base_); 42 | } 43 | 44 | private: 45 | void* param_; 46 | long heartBeatSeconds_; 47 | Func func_; 48 | 49 | struct event_base* base_; 50 | struct event ev_; 51 | struct timeval tv_; 52 | 53 | bool b_stop_; 54 | 55 | static void time_cb(int fd, short event, void *argc) 56 | { 57 | TimerImplByLibevent* pThis = static_cast(argc); 58 | 59 | if(pThis->b_stop_) 60 | { 61 | event_del(&pThis->ev_); 62 | return; 63 | } 64 | event_add(&pThis->ev_, &pThis->tv_); // reschedule timer 65 | pThis->func_(pThis->param_); 66 | } 67 | 68 | }; 69 | 70 | class CImplTimer 71 | { 72 | public: 73 | 74 | void HeartBeatImpl(Func func, void* param, long seconds); 75 | 76 | void StopHeartBeatImpl(); 77 | 78 | private: 79 | 80 | TimerImplByLibevent *timer_; 81 | static void HeartBeatImplThread(void* arg); 82 | }; 83 | 84 | void CImplTimer::HeartBeatImpl( Func func, void* param, long seconds) 85 | { 86 | timer_ = new TimerImplByLibevent(func, param, seconds); 87 | 88 | boost::thread thread_obj(boost::bind(&HeartBeatImplThread, (void*)this)); 89 | } 90 | 91 | void CImplTimer::HeartBeatImplThread( void* arg ) 92 | { 93 | CImplTimer *pThis = static_cast(arg); 94 | 95 | pThis->timer_->Run(); 96 | 97 | } 98 | 99 | void CImplTimer::StopHeartBeatImpl() 100 | { 101 | timer_->Stop(); 102 | } 103 | --------------------------------------------------------------------------------