]> git.mxchange.org Git - simgear.git/commitdiff
Further SG stream APIs
authorJames Turner <zakalawe@mac.com>
Mon, 27 Jun 2016 17:29:14 +0000 (12:29 -0500)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/misc/sgstream.cxx
simgear/misc/sgstream.hxx

index 99b19a7a24613c3bdb954736a1cf98cac23878d3..01e7ff12a91f38fdaee8d119da3044a429450e73 100644 (file)
@@ -198,12 +198,23 @@ sg_gzofstream::attach( int fd, ios_openmode io_mode )
 sg_ifstream::sg_ifstream(const SGPath& path, ios_openmode io_mode)
 {
     std::string ps = path.local8BitStr();
-    open(ps.c_str(), io_mode);
+    std::ifstream::open(ps.c_str(), io_mode);
 }
 
+void sg_ifstream::open( const SGPath& name, ios_openmode io_mode )
+{
+    std::string ps = name.local8BitStr();
+    std::ifstream::open(ps.c_str(), io_mode);
+}
 
 sg_ofstream::sg_ofstream(const SGPath& path, ios_openmode io_mode)
 {
     std::string ps = path.local8BitStr();
-    open(ps.c_str(), io_mode);
-}
\ No newline at end of file
+    std::ofstream::open(ps.c_str(), io_mode);
+}
+
+void sg_ofstream::open( const SGPath& name, ios_openmode io_mode )
+{
+    std::string ps = name.local8BitStr();
+    std::ofstream::open(ps.c_str(), io_mode);
+}
index e7a4b12ca1c75b6dca7bb06c11b667f3f7799940..f676b8a04e2d8c70918a1a5a3b574b2c605880e4 100644 (file)
@@ -93,8 +93,8 @@ public:
 
 private:
     // Not defined!
-    sg_gzifstream( const sg_gzifstream& );    
-    void operator= ( const sg_gzifstream& );    
+    sg_gzifstream( const sg_gzifstream& );
+    void operator= ( const sg_gzifstream& );
 };
 
 /**
@@ -175,14 +175,22 @@ private:
 class sg_ifstream : public std::ifstream
 {
 public:
+    sg_ifstream() {}
+
     sg_ifstream(const SGPath& path, ios_openmode io_mode = ios_in | ios_binary);
+
+    void open( const SGPath& name,
+              ios_openmode io_mode = ios_in|ios_binary );
 };
 
 class sg_ofstream : public std::ofstream
 {
 public:
+    sg_ofstream() { }
     sg_ofstream(const SGPath& path, ios_openmode io_mode = ios_out | ios_binary);
+
+    void open( const SGPath& name,
+              ios_openmode io_mode = ios_out|ios_binary );
 };
 
 #endif /* _SGSTREAM_HXX */
-