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 
00036 class SCFormIO {
00037   private:
00038     static char *default_basename_;
00039     static int  ready_;
00040     static int  xalloc_inited_;
00041     static long nindent_;
00042     static long indent_size_;
00043     static long skip_indent_;
00044     static long verbose_;
00045     static long initialized_;
00046     static int node_to_print_;
00047     static int debug_;
00048     static int parallel_;
00049     static int me_;
00050     static std::ofstream nullstream_;
00051     static void init();
00052   public:
00053     static std::ios& indent(std::ios&o);
00054     static std::ios& decindent(std::ios&o);
00055     static std::ios& incindent(std::ios&o);
00056     static std::ios& skipnextindent(std::ios&o);
00057     static std::ostream& node0(std::ostream&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 void set_debug(int);
00065     static void init_mp(int me);
00066 
00067     static void set_default_basename(const char *);
00068     static const char *default_basename();
00069     static char *fileext_to_filename(const char *extension);
00070 
00071     static void init_ostream(std::ostream &);
00072 
00073     static std::ostream& license(std::ostream&);
00074     static std::ostream& warranty(std::ostream&);
00075     static std::ostream& copyright(std::ostream&);
00076 };
00077 
00078 std::ios& indent(std::ios&);
00079 
00080 std::ios& decindent(std::ios&);
00081 
00082 std::ios& incindent(std::ios&);
00083 
00084 std::ios& skipnextindent(std::ios&);
00085 
00086 std::ostream& node0(std::ostream&);
00087 
00088 
00089 
00092 class scprintf {
00093   private:
00094     char str[1024];
00095 
00096   public:
00097     scprintf(const char*,...);
00098     friend std::ostream& operator<<(std::ostream&, const scprintf&);
00099 };
00100 
00101 std::ostream& operator<<(std::ostream&, const scprintf&);
00102 
00103 #endif
00104 
00105 
00106 
00107 
00108