git.fiddlerwoaroof.com
sys_fstream.cc
bc6c3d35
 /* Copyright (C) CJ Affiliate
  *
  * You may use, distribute and modify this code under  the
  * terms of the  GNU General Public License  version 2  or
  * later.
  *
  * You should have received a copy of the license with this
  * file. If not, you will find a copy in the "LICENSE" file
  * at https://github.com/cjdev/dual-control.
  */
 
215ea751
 #include <memory>
 #include <fstream>
 
 #include "sys_fstream.h"
 
bc6c3d35
 namespace
 {
 class impl : public fstreams_ifc
 {
 public:
     pstream open_fstream (const std::string &file_path)
     {
         return pstream (new std::ifstream (file_path));
     }
215ea751
 };
 
 }
 
bc6c3d35
 fstreams fstreams::create()
 {
     static fstreams singleton (delegate (new impl));
215ea751
     return singleton;
 }