diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/CE_Screen_Output.h | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/CE_Screen_Output.h')
-rw-r--r-- | ACE/ace/CE_Screen_Output.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/ACE/ace/CE_Screen_Output.h b/ACE/ace/CE_Screen_Output.h new file mode 100644 index 00000000000..48e9d54cb13 --- /dev/null +++ b/ACE/ace/CE_Screen_Output.h @@ -0,0 +1,109 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file CE_Screen_Output.h + * + * $Id$ + * + * @author Si Mong Park <spark@ociweb.com> + */ +//============================================================================= + +#ifndef ACE_CE_SCREEN_OUTPUT_H +#define ACE_CE_SCREEN_OUTPUT_H + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_HAS_WINCE) + +#include "ace/Log_Msg_Callback.h" +#include "ace/Log_Record.h" + +namespace +{ + const ACE_TCHAR endl[] = ACE_LIB_TEXT("\r\n"); + const ACE_TCHAR tab[] = ACE_LIB_TEXT("\t"); +} + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_CE_Screen_Output + * + * @brief Replacement of text output for Windows CE. + * + * This class allows standard text output to be displayed on + * text window for Windows CE. Generally, all ACE output will + * go through under CE if and only if user uses WindozeCE + * implementation by using main_ce instead of main. + * Also, for the easier debugging purpose, object pointer of + * this class can be gotten from ACE_Log_Msg::msg_callback() + * and then can be used directly by user just like cout stream. + */ +class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback +{ +public: + + ACE_CE_Screen_Output (HWND hEdit); + + ACE_CE_Screen_Output (void); + + virtual ~ACE_CE_Screen_Output(); + + /// Implementation of pure virtual function from ACE_Log_Msg_Callback. + virtual void log (ACE_Log_Record &log_record); + + /// Interface to specify active window handle. + void SetOutputWindow (HWND hWnd); + + void clear (void); + + /// Stream insertion operator that performs actual print out. + /** + * @note This is the only one operator that performs output. All + * other perators convert the type and use this operator + * underneath. + */ + ACE_CE_Screen_Output& operator << (ACE_TCHAR*); + ACE_CE_Screen_Output& operator << (const ACE_TCHAR*); + + ACE_CE_Screen_Output& operator << (ACE_ANTI_TCHAR* output); + ACE_CE_Screen_Output& operator << (const ACE_ANTI_TCHAR* output); + + ACE_CE_Screen_Output& operator << (char output); + ACE_CE_Screen_Output& operator << (unsigned char output); + + ACE_CE_Screen_Output& operator << (unsigned short output); + + ACE_CE_Screen_Output& operator << (int output); + ACE_CE_Screen_Output& operator << (unsigned int output); + + ACE_CE_Screen_Output& operator << (float output); + + ACE_CE_Screen_Output& operator << (long output); + ACE_CE_Screen_Output& operator << (unsigned long output); + + ACE_CE_Screen_Output& operator << (FILE* pFile); + +private: + + ACE_CE_Screen_Output (ACE_CE_Screen_Output&); + +private: + + HWND handler_; + + /// FILE pointer that used to save output to file. This class does + /// not own the file handler pointer. + FILE* pFile_; +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#endif // ACE_HAS_WINCE +#endif // ACE_CE_SCREEN_OUTPUT_H |