CE_Screen_Output.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    CE_Screen_Output.h
00006  *
00007  *  CE_Screen_Output.h,v 1.5 2005/10/28 16:14:51 ossama Exp
00008  *
00009  *  @author Si Mong Park  <spark@ociweb.com>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_CE_SCREEN_OUTPUT_H
00014 #define ACE_CE_SCREEN_OUTPUT_H
00015 
00016 #include "ace/config-all.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #if defined (ACE_HAS_WINCE)
00023 
00024 #include "ace/Log_Msg_Callback.h"
00025 #include "ace/Log_Record.h"
00026 
00027 namespace
00028 {
00029   const ACE_TCHAR endl[] = ACE_LIB_TEXT("\r\n");
00030   const ACE_TCHAR tab[]  = ACE_LIB_TEXT("\t");
00031 }
00032 
00033 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00034 
00035 /**
00036  * @class ACE_CE_Screen_Output
00037  *
00038  * @brief Replacement of text output for Windows CE.
00039  *
00040  * This class allows standard text output to be displayed on
00041  * text window for Windows CE.  Generally, all ACE output will
00042  * go through under CE if and only if user uses WindozeCE
00043  * implementation by using main_ce instead of main.
00044  * Also, for the easier debugging purpose, object pointer of
00045  * this class can be gotten from ACE_Log_Msg::msg_callback()
00046  * and then can be used directly by user just like cout stream.
00047  */
00048 class ACE_Export ACE_CE_Screen_Output : public ACE_Log_Msg_Callback
00049 {
00050 public:
00051 
00052   ACE_CE_Screen_Output (HWND hEdit);
00053 
00054   ACE_CE_Screen_Output (void);
00055 
00056   virtual ~ACE_CE_Screen_Output();
00057 
00058   /// Implementation of pure virtual function from ACE_Log_Msg_Callback.
00059   virtual void log (ACE_Log_Record &log_record);
00060 
00061   /// Interface to specify active window handle.
00062   void SetOutputWindow (HWND hWnd);
00063 
00064   void clear (void);
00065 
00066   /// Stream insertion operator that performs actual print out.
00067   /**
00068    * @note This is the only one operator that performs output.  All
00069    *       other perators convert the type and use this operator
00070    *       underneath.
00071    */
00072   ACE_CE_Screen_Output& operator << (ACE_TCHAR*);
00073   ACE_CE_Screen_Output& operator << (const ACE_TCHAR*);
00074 
00075   ACE_CE_Screen_Output& operator << (ACE_ANTI_TCHAR* output);
00076   ACE_CE_Screen_Output& operator << (const ACE_ANTI_TCHAR* output);
00077 
00078   ACE_CE_Screen_Output& operator << (char output);
00079   ACE_CE_Screen_Output& operator << (unsigned char output);
00080 
00081   ACE_CE_Screen_Output& operator << (unsigned short output);
00082 
00083   ACE_CE_Screen_Output& operator << (int output);
00084   ACE_CE_Screen_Output& operator << (unsigned int output);
00085 
00086   ACE_CE_Screen_Output& operator << (float output);
00087 
00088   ACE_CE_Screen_Output& operator << (long output);
00089   ACE_CE_Screen_Output& operator << (unsigned long output);
00090 
00091   ACE_CE_Screen_Output& operator << (FILE* pFile);
00092 
00093 private:
00094 
00095   ACE_CE_Screen_Output (ACE_CE_Screen_Output&);
00096 
00097 private:
00098 
00099   HWND handler_;
00100 
00101   /// FILE pointer that used to save output to file.  This class does
00102   /// not own the file handler pointer.
00103   FILE* pFile_;
00104 };
00105 
00106 ACE_END_VERSIONED_NAMESPACE_DECL
00107 
00108 #endif  // ACE_HAS_WINCE
00109 #endif  // ACE_CE_SCREEN_OUTPUT_H

Generated on Thu Nov 9 09:41:48 2006 for ACE by doxygen 1.3.6