1 /*=========================================================================
4 Module: $RCSfile: gdcmfstream.h,v $
6 Date: $Date: 2005/06/13 00:22:14 $
7 Version: $Revision: 1.1 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef __gdcmfstream_
20 #define __gdcmfstream_
27 class ifstream : public std::ifstream
29 // First the position of the fragment, then the fragment lenght
30 typedef std::pair<std::streampos, std::streamsize> fragment;
33 explicit ifstream(const char* filename,
34 std::ios_base::openmode mode = std::ios_base::in);
36 std::istream& read (char* s, std::streamsize n );
37 inline void add_fragment(fragment f) { fragments.push_back(f); }
40 std::list<fragment> fragments;
43 } //end namespace gdcm