wzoutput.hxx

来自「有限元学习研究用源代码(老外的),供科研人员参考」· HXX 代码 · 共 77 行

HXX
77
字号
#ifndef wzoutput_hxx
#define wzoutput_hxx

#ifndef wz_hxx
#include "wz.hxx"
#endif
#ifndef wzcolor_hxx
#include "wzcolor.hxx"
#endif

extern "C" void wzPrintDocumentationEntry(char* localurl);

class ostream;
class wzOutput;
class wzOutputItem;

class wzOutput{
  ostream&	out;
  char		*fullFormat;
  char		Request[256];
  unsigned 	pos;
  unsigned 	Flush;
  unsigned	throw_data;
  unsigned	throw_format;
  unsigned	print;
public:
  wzOutput();
  wzOutput(ostream& io);
  char*		requested() {return Request;}
  wzOutput& 	operator()(char *format);
  wzOutput& 	operator<<(wzOutputItem p);
  wzOutput& 	operator,(wzOutputItem p);
  void throw_data_error(){throw_data = 1;}
  void throw_format_error(){throw_format = 1;}
  void ignore_data_error(){throw_data = 0;}
  void ignore_format_error(){throw_format = 0;}
  void ignore_output(){print = 0;}
  void print_output(){print = 1;}
  void flush(unsigned f){Flush=f;}
  void flush();
  static 	const unsigned allocated;
  static 	const unsigned format_length;
  static 	wzOutput& Default;
  static 	wzOutput& Warning;
  static 	wzOutput& Error;
};

typedef	void (*wzOutputFunction)(void *o,char *t,unsigned m,char *f);

class wzOutputItem{
protected:
friend class wzOutput;
	void*		object;
	wzOutputFunction 	output;
public:
	wzOutputItem(void* o, wzOutputFunction p):object(o),output(p){;}
	wzOutputItem(unsigned i);
	wzOutputItem(int i);
	wzOutputItem(char i);
	wzOutputItem(float f);
	wzOutputItem(double f);
	wzOutputItem(char* i);
	wzOutputItem(const wzColor& i);
};

class wzOutputDataError: public wzError{
public: wzOutputDataError():wzError("wzoutputtest","DataError"){;}
};

class wzOutputFormatError: public wzError{
public: wzOutputFormatError():wzError("wzoutputtest","FormatError"){;}
};

void wzPrintDocumentationEntry(wzOutput& o, wzString p, wzString i);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?