/* * Copyright (c) 1995, 1996 Gunther Schadow. All rights reserved. * * 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "pg_config.h" #pragma implementation #include "exception.h" #include "xios.h" int xios::_index = -1; xios::xios(ios& s) #if WITH_XDR : _xdr(s.rdbuf()) #endif { if ( _index == -1 ) _index = s.xalloc(); _level = Delimiters::toplevel; _flags = __debug; // neutral since nothing justifies HL7 default _ios = &s; s.pword(_index) = this; } /* * We allow the level to be set to -2, but it won't be possible to read * delimiters with such level! This is useful, because composites can * always lower the level, even if it's already subcomponent. */ void xios::setlevel(Delimiters::level_t l) { if(( Delimiters::toplevel >= l ) && ( l >= ( Delimiters::toplevel - 2 ))) _level = l; else FATAL("level %d out of range", l); }