summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-29 14:40:59 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-29 14:40:59 +0000
commit84215fe874daed955a2ebbe0c05d02b697b2d0bc (patch)
treeb396c782c93385052fe88b5f37ebe56e4b012f64 /libstdc++-v3/include/ext
parentaebe670f1d34a25d7d1534e7748065971254c106 (diff)
downloadgcc-84215fe874daed955a2ebbe0c05d02b697b2d0bc.tar.gz
2004-05-29 Richard B. Kreckel <Richard.Kreckel@Framatome-ANP.com>
Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/14600 * include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf::file): New. * include/ext/stdio_filebuf.h (stdio_filebuf::file): New. * config/io/basic_file_stdio.cc (__basic_file::file): New. * config/io/basic_file_stdio.h: Define. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82419 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext')
-rw-r--r--libstdc++-v3/include/ext/stdio_filebuf.h20
-rw-r--r--libstdc++-v3/include/ext/stdio_sync_filebuf.h10
2 files changed, 27 insertions, 3 deletions
diff --git a/libstdc++-v3/include/ext/stdio_filebuf.h b/libstdc++-v3/include/ext/stdio_filebuf.h
index 04619897206..cc229728fa8 100644
--- a/libstdc++-v3/include/ext/stdio_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_filebuf.h
@@ -1,6 +1,6 @@
// File descriptor layer for filebuf -*- C++ -*-
-// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -63,6 +63,11 @@ namespace __gnu_cxx
public:
/**
+ * deferred initialization
+ */
+ stdio_filebuf() : std::basic_filebuf<_CharT, _Traits>() {}
+
+ /**
* @param fd An open file descriptor.
* @param mode Same meaning as in a standard filebuf.
* @param size Optimal or preferred size of internal buffer, in chars.
@@ -103,8 +108,17 @@ namespace __gnu_cxx
* descriptor, so be careful.
*/
int
- fd()
- { return this->_M_file.fd(); }
+ fd() { return this->_M_file.fd(); }
+
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file*
+ file() { return this->_M_file.file(); }
};
template<typename _CharT, typename _Traits>
diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
index cdf1e7c3665..367d310b4b0 100644
--- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
@@ -71,6 +71,16 @@ namespace __gnu_cxx
: _M_file(__f), _M_unget_buf(traits_type::eof())
{ }
+ /**
+ * @return The underlying FILE*.
+ *
+ * This function can be used to access the underlying "C" file pointer.
+ * Note that there is no way for the library to track what you do
+ * with the file, so be careful.
+ */
+ std::__c_file* const
+ file() { return this->_M_file; }
+
protected:
int_type
syncgetc();