| 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ |
| 2 | /* libwps |
| 3 | * Version: MPL 2.0 / LGPLv2.1+ |
| 4 | * |
| 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 7 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 8 | * |
| 9 | * Major Contributor(s): |
| 10 | * Copyright (C) 2006, 2007 Andrew Ziem |
| 11 | * Copyright (C) 2003-2005 William Lachance ([email protected]) |
| 12 | * Copyright (C) 2003 Marc Maurer ([email protected]) |
| 13 | * |
| 14 | * For minor contributions see the git repository. |
| 15 | * |
| 16 | * Alternatively, the contents of this file may be used under the terms |
| 17 | * of the GNU Lesser General Public License Version 2.1 or later |
| 18 | * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are |
| 19 | * applicable instead of those above. |
| 20 | */ |
| 21 | |
| 22 | #ifndef WPS_STREAM_H |
| 23 | #define WPS_STREAM_H |
| 24 | |
| 25 | #include "libwps_internal.h" |
| 26 | #include "WPSDebug.h" |
| 27 | |
| 28 | //! small structure use to store a stream and it debug file |
| 29 | struct WPSStream |
| 30 | { |
| 31 | //! constructor with an ascii file |
| 32 | WPSStream(RVNGInputStreamPtr input, libwps::DebugFile &ascii); |
| 33 | //! constructor without an ascii file |
| 34 | explicit WPSStream(RVNGInputStreamPtr input); |
| 35 | //! destructor |
| 36 | ~WPSStream(); |
| 37 | //! return true if the position is in the file |
| 38 | bool checkFilePosition(long pos) const |
| 39 | { |
| 40 | return pos<=m_eof; |
| 41 | } |
| 42 | //! the stream |
| 43 | RVNGInputStreamPtr m_input; |
| 44 | //! the ascii file |
| 45 | libwps::DebugFile &m_ascii; |
| 46 | //! the last position |
| 47 | long m_eof; |
| 48 | protected: |
| 49 | //! the local file(if not, is given) |
| 50 | libwps::DebugFile m_asciiFile; |
| 51 | }; |
| 52 | |
| 53 | #endif /* WPS_STREAM_H */ |
| 54 | /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */ |