/*$Id: io_.h,v 26.15 2007/02/18 09:52:30 al Exp $ -*- C++ -*- * Copyright (C) 2001 Albert Davis * Author: Albert Davis * * This file is part of "Gnucap", the Gnu Circuit Analysis Package * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. *------------------------------------------------------------------ * shared data for all io functions * other io related stuff, like files and formatting */ //testing=script 2006.07.17 #ifndef IO_H #define IO_H #include "l_lib.h" /*--------------------------------------------------------------------------*/ class CS; const int MAXHANDLE = CHAR_BIT*sizeof(int)-1; /*--------------------------------------------------------------------------*/ class OMSTREAM { private: int _mask; int _fltdig; /* max precision for float/double numbers */ int _fltwid; /* fixed(min)width for float/double numbers */ int _format; /* how to format io. Basic option. */ static int _cpos[MAXHANDLE+1];/* character counter */ bool _cipher; /* flag: encrypt output file */ bool _pack; /* flag: convert whitespace to tabs on out */ OMSTREAM(int m) :_mask(m),_fltdig(7),_fltwid(0),_format(0),_cipher(false),_pack(false) {} public: explicit OMSTREAM(FILE* f = 0) :_mask(0),_fltdig(7),_fltwid(0),_format(0),_cipher(false), _pack(false) {_mask = (f) ? 1<