/* * mp3plot - Bitrate analysis tool * * Copyright (C) 2007 Toni Corvera * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // $Id: named_ifstream.h 748 2007-05-24 21:36:05Z $ #ifndef ONET_NAMED_IFSTREAM_H #define ONET_NAMED_IFSTREAM_H #include #include namespace net_outlyer { //! Classes and methods for file handling namespace file_utils { /*! * \brief ifstream with knowledge of the filename * \see file_name() */ class named_ifstream : public std::ifstream { protected: const std::string fn_; public: explicit named_ifstream(const char * fn, std::ios_base::openmode mode = std::ios_base::in) : std::ifstream(fn,mode), fn_(fn) {} const std::string & file_name() const { return fn_; } }; } // namespace file_utils } // namespace net_outlyer #endif // ONET_NAMED_IFSTREAM_H /* vim:set ts=4 et ai: */