log4cplus
2.0.0
|
00001 // -*- C++ -*- 00002 // Module: Log4cplus 00003 // File: msttsappender.h 00004 // Created: 10/2012 00005 // Author: Vaclav Zeman 00006 // 00007 // 00008 // Copyright (C) 2012-2015, Vaclav Zeman. All rights reserved. 00009 // 00010 // Redistribution and use in source and binary forms, with or without modifica- 00011 // tion, are permitted provided that the following conditions are met: 00012 // 00013 // 1. Redistributions of source code must retain the above copyright notice, 00014 // this list of conditions and the following disclaimer. 00015 // 00016 // 2. Redistributions in binary form must reproduce the above copyright notice, 00017 // this list of conditions and the following disclaimer in the documentation 00018 // and/or other materials provided with the distribution. 00019 // 00020 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, 00021 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 00022 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00023 // APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 00024 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- 00025 // DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00026 // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00027 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00028 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00029 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00030 00031 00032 // 00033 00036 #ifndef LOG4CPLUS_MSTTSAPPENDER_H 00037 #define LOG4CPLUS_MSTTSAPPENDER_H 00038 00039 #include <log4cplus/config.hxx> 00040 00041 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE) 00042 #pragma once 00043 #endif 00044 00045 #include <log4cplus/appender.h> 00046 00047 00048 #if defined (_WIN32) 00049 #if defined (log4cplusqt4debugappender_EXPORTS) \ 00050 || defined (log4cplusqt4debugappenderU_EXPORTS) \ 00051 || defined (DLL_EXPORT) 00052 #undef LOG4CPLUS_MSTTSAPPENDER_BUILD_DLL 00053 #define LOG4CPLUS_MSTTSAPPENDER_BUILD_DLL 00054 #endif 00055 #if defined (LOG4CPLUS_MSTTSAPPENDER_BUILD_DLL) 00056 #if defined (INSIDE_LOG4CPLUS_MSTTSAPPENDER) 00057 #define LOG4CPLUS_MSTTSAPPENDER_EXPORT __declspec(dllexport) 00058 #else 00059 #define LOG4CPLUS_MSTTSAPPENDER_EXPORT __declspec(dllimport) 00060 #endif 00061 #else 00062 #define LOG4CPLUS_MSTTSAPPENDER_EXPORT 00063 #endif 00064 #else 00065 #if defined (INSIDE_LOG4CPLUS_MSTTSAPPENDER) 00066 #define LOG4CPLUS_MSTTSAPPENDER_EXPORT LOG4CPLUS_DECLSPEC_EXPORT 00067 #else 00068 #define LOG4CPLUS_MSTTSAPPENDER_EXPORT LOG4CPLUS_DECLSPEC_IMPORT 00069 #endif // defined (INSIDE_LOG4CPLUS_MSTTSAPPENDER) 00070 #endif // !_WIN32 00071 00072 00073 namespace log4cplus 00074 { 00075 00076 00077 class LOG4CPLUS_MSTTSAPPENDER_EXPORT MSTTSAppender 00078 : public Appender 00079 { 00080 public: 00081 MSTTSAppender (); 00082 explicit MSTTSAppender (helpers::Properties const &); 00083 virtual ~MSTTSAppender (); 00084 00085 virtual void close (); 00086 00087 static void registerAppender (); 00088 00089 protected: 00090 virtual void append (spi::InternalLoggingEvent const &); 00091 00092 struct Data; 00093 00094 Data * data; 00095 00096 private: 00097 LOG4CPLUS_PRIVATE void init (long const * rate = 0, 00098 unsigned long const * volume = 0, bool speak_punc = false, 00099 bool async = false); 00100 00101 MSTTSAppender (MSTTSAppender const &); 00102 MSTTSAppender & operator = (MSTTSAppender const &); 00103 }; 00104 00105 00106 typedef helpers::SharedObjectPtr<MSTTSAppender> MSTTSAppenderPtr; 00107 00108 00109 } // namespace log4cplus 00110 00111 00112 #endif // LOG4CPLUS_MSTTSAPPENDER_H