00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _util_misc_formio_h
00029 #define _util_misc_formio_h
00030
00031 #include <iostream>
00032 #include <fstream>
00033
00034 namespace sc {
00035
00038 class SCFormIO {
00039 private:
00040 static char *default_basename_;
00041 static int ready_;
00042 static int xalloc_inited_;
00043 static long nindent_;
00044 static long indent_size_;
00045 static long skip_indent_;
00046 static long verbose_;
00047 static long initialized_;
00048 static int node_to_print_;
00049 static int debug_;
00050 static int parallel_;
00051 static int me_;
00052 static void init();
00053 public:
00054 static std::ios& indent(std::ios&o);
00055 static std::ios& decindent(std::ios&o);
00056 static std::ios& incindent(std::ios&o);
00057 static std::ios& skipnextindent(std::ios&o);
00058
00059 static void setverbose(std::ios&o, long v);
00060 static long getverbose(std::ios&o);
00061 static void setindent(std::ios&o, long column);
00062 static long getindent(std::ios&o);
00063 static int set_printnode(int);
00064 static int get_printnode() { return node_to_print_; }
00065 static void set_debug(int);
00066 static int get_debug() { return debug_; }
00067 static void init_mp(int me);
00068 static int get_node() { return me_; }
00069
00070 static void set_default_basename(const char *);
00071 static const char *default_basename();
00072 static char *fileext_to_filename(const char *extension);
00073
00074 static void init_ostream(std::ostream &);
00075
00076 static std::ostream& license(std::ostream&);
00077 static std::ostream& warranty(std::ostream&);
00078 static std::ostream& copyright(std::ostream&);
00079 };
00080
00081 std::ios& indent(std::ios&);
00082
00083 std::ios& decindent(std::ios&);
00084
00085 std::ios& incindent(std::ios&);
00086
00087 std::ios& skipnextindent(std::ios&);
00088
00089
00090
00091 class scprintf;
00092 std::ostream& operator<<(std::ostream&, const scprintf&);
00093
00096 class scprintf {
00097 private:
00098 char str[1024];
00099
00100 public:
00101 scprintf(const char*,...);
00102 friend std::ostream& sc::operator<<(std::ostream&, const scprintf&);
00103 };
00104
00105 }
00106
00107 #endif
00108
00109
00110
00111
00112