PSDL_Stream.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // PSDL_Stream.h,v 1.2 2003/07/21 23:51:30 dhinton Exp
00003 //
00004 // ==================================================================
00005 //
00006 // = LIBRARY
00007 //    PSS
00008 //
00009 // = FILENAME
00010 //    PSDL_Stream
00011 //
00012 // = DESCRIPTION
00013 //    This class is to help write the generated code to files.
00014 //
00015 // = AUTHOR
00016 //    Priyanka Gontla <gontla_p@ociweb.com>
00017 //
00018 // ==================================================================
00019 
00020 #ifndef TAO_PSDL_STREAM_H
00021 #define TAO_PSDL_STREAM_H
00022 
00023 #include /**/ "ace/pre.h"
00024 
00025 #include "PSDL_Scope.h"
00026 
00027 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00028 # pragma once
00029 #endif /* ACE_LACKS_PRAGMA_ONCE */
00030 
00031 class TAO_PSDL_Stream
00032 {
00033  public:
00034 
00035   TAO_PSDL_Stream (void);
00036 
00037   ~TAO_PSDL_Stream (void);
00038 
00039   /// Open the file name to be able to write to it.
00040   int open (const char *fname);
00041 
00042   /// Return the underlying lowlevel file pointer.
00043   FILE *file (void);
00044 
00045   /// increment the indentation level and by default actually indent the output
00046   /// accordingly
00047   int incr_indent (unsigned short flag=1);
00048 
00049   /// decrease the indentation level and by default actually indent the output
00050   /// accordingly
00051   int decr_indent (unsigned short flag=1);
00052 
00053   /// reset indentation level to 0
00054   int reset (void);
00055 
00056   /// indent starting next line
00057   int indent (void);
00058 
00059   /// put a newline and indent on the next line
00060   int nl (void);
00061 
00062   /// "printf" style variable argument print
00063   int print (const char *format, ...);
00064 
00065   // =overloaded operators
00066 
00067   // output the char string and return a reference to ourselves
00068   TAO_PSDL_Stream &operator<< (const char *str);
00069 
00070   TAO_PSDL_Stream &operator<< (ACE_CString str);
00071 
00072   TAO_PSDL_Stream &operator<< (const unsigned long num);
00073   // output the integer and return a reference to ourselves
00074 
00075   TAO_PSDL_Stream &operator<< (const long num);
00076   // output the integer and return a reference to ourselves
00077 
00078 private:
00079 
00080   // the underlying low-level I/O handle
00081   FILE *fp_;
00082 
00083   // indnetation level
00084   int indent_level_;
00085 };
00086 
00087 
00088 #include /**/ "ace/post.h"
00089 
00090 #endif /* TAO_PSDL_STREAM_H */

Generated on Thu Nov 9 14:07:05 2006 for TAO_PSS by doxygen 1.3.6