FilePtr.h
1//-*-C++-*-
2/***************************************************************************
3 *
4 * Copyright (C) 2009 by Willem van Straten
5 * Licensed under the Academic Free License version 2.1
6 *
7 ***************************************************************************/
8
9// psrchive/Util/units/FilePtr.h
10
11#ifndef __FilePtr_H
12#define __FilePtr_H
13
14#include <stdio.h>
15#include <string>
16
18class FilePtr
19{
20public:
21
22 FilePtr (const std::string& filename, const std::string& mode);
23 FilePtr (FILE*);
24 FilePtr () { fptr = 0; }
25 ~FilePtr ();
26 const FilePtr& operator = (FILE*);
27 operator FILE* () { return fptr; }
28 bool operator ! () { return fptr == 0; }
29
30protected:
31 void close ();
32 FILE* fptr;
33};
34
35#endif
36

Generated using doxygen 1.14.0