This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: filename from fstream object


John Love-Jensen wrote:
> 
> Hi Bernd,
> 
> You can roll your own...
> 
> class NamedIfstream : public ifstream {
> public:
> private:
>     string mName;
> };
> 

John,

OK, good idea. I've written some minimal classes (NamedIFileStream,
NamedOFileStream)
for this, and packed them together with a small number of other classes which I 
find useful as utilities into a library.
It can be downloaded from
http://www.echem.uni-tuebingen.de/~bs/echem/software/BSUtilities.shtml
Interested people could just use the code from the header file included in the
distribution.
The present version works with gcc 3.2, I found that it doesn't work with
2.95.3,
since the parameter sequence for the open function in <fstream> has changed.

Bernd

-- 
=======================================================================
Bernd Speiser
Institut f"ur Organische Chemie
Auf der Morgenstelle 18
D-72076 T"ubingen
Germany
phone: +49-7071-2976205 (office) +49-7071-2976242 (laboratory)
fax:   +49-7071-295518 (new!)
e-mail: bernd.speiser@uni-tuebingen.de
Internet: http://www.uni-tuebingen.de/speiser
=======================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]