00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef skOutputDestination_h
00022 #define skOutputDestination_h
00023 
00024 #include "skStringBuffer.h"
00025 #include <stdio.h>
00026 
00027 #ifdef STREAMS_ENABLED
00028 #ifdef STL_STREAMS
00029 #include <fstream>
00030 using std::ofstream;
00031 #else
00032 #include <fstream.h>
00033 #endif
00034 #endif
00035 
00040 class CLASSEXPORT skOutputDestination
00041 #ifdef __SYMBIAN32__
00042 : public CBase
00043 #endif
00044 {
00045 public:
00049   virtual ~skOutputDestination();
00053   virtual void  write(const skString& s)=0;
00054 #ifdef __SYMBIAN32__
00055 
00059   virtual void  write(const TDesC& s)=0;
00060 #endif
00061 };
00062 class CLASSEXPORT skOutputFile : public skOutputDestination
00063 {
00064 public:
00069   IMPORT_C skOutputFile(const skString& file);
00073   virtual IMPORT_C ~skOutputFile();
00077   virtual IMPORT_C void write(const skString& s);
00078 #ifdef __SYMBIAN32__
00079 
00083   virtual IMPORT_C void write(const TDesC& s);
00084 #endif
00085 private:
00086 #ifdef STREAMS_ENABLED
00087   ofstream      m_Out;
00088 #else
00089   FILE *        m_Out;
00090 #endif
00091 };
00092 class CLASSEXPORT skOutputString : public skOutputDestination
00093 {
00094 public:
00099   IMPORT_C skOutputString(skStringBuffer& out);
00100   virtual IMPORT_C ~skOutputString();
00105   virtual IMPORT_C void write(const skString& s);
00106 #ifdef __SYMBIAN32__
00107 
00112   virtual IMPORT_C void write(const TDesC& s);
00113 #endif
00114 private:
00115   skStringBuffer& m_Out;
00116 };
00117 
00118 #endif