summaryrefslogtreecommitdiffstats
path: root/libcxx/include/fstream
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/fstream')
-rw-r--r--libcxx/include/fstream61
1 files changed, 61 insertions, 0 deletions
diff --git a/libcxx/include/fstream b/libcxx/include/fstream
index 8b9aefaaca3..332b4747c1a 100644
--- a/libcxx/include/fstream
+++ b/libcxx/include/fstream
@@ -38,6 +38,7 @@ public:
bool is_open() const;
basic_filebuf* open(const char* s, ios_base::openmode mode);
basic_filebuf* open(const string& s, ios_base::openmode mode);
+ basic_filebuf* open(const filesystem::path& p, ios_base::openmode mode); // C++17
basic_filebuf* close();
protected:
@@ -77,6 +78,8 @@ public:
basic_ifstream();
explicit basic_ifstream(const char* s, ios_base::openmode mode = ios_base::in);
explicit basic_ifstream(const string& s, ios_base::openmode mode = ios_base::in);
+ explicit basic_ifstream(const filesystem::path& p,
+ ios_base::openmode mode = ios_base::in); // C++17
basic_ifstream(basic_ifstream&& rhs);
basic_ifstream& operator=(basic_ifstream&& rhs);
@@ -86,6 +89,8 @@ public:
bool is_open() const;
void open(const char* s, ios_base::openmode mode = ios_base::in);
void open(const string& s, ios_base::openmode mode = ios_base::in);
+ void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in); // C++17
+
void close();
};
@@ -110,6 +115,8 @@ public:
basic_ofstream();
explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out);
explicit basic_ofstream(const string& s, ios_base::openmode mode = ios_base::out);
+ explicit basic_ofstream(const filesystem::path& p,
+ ios_base::openmode mode = ios_base::out); // C++17
basic_ofstream(basic_ofstream&& rhs);
basic_ofstream& operator=(basic_ofstream&& rhs);
@@ -119,6 +126,9 @@ public:
bool is_open() const;
void open(const char* s, ios_base::openmode mode = ios_base::out);
void open(const string& s, ios_base::openmode mode = ios_base::out);
+ void open(const filesystem::path& p,
+ ios_base::openmode mode = ios_base::out); // C++17
+
void close();
};
@@ -143,6 +153,8 @@ public:
basic_fstream();
explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);
explicit basic_fstream(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);
+ explicit basic_fstream(const filesystem::path& p,
+ ios_base::openmode mode = ios_base::in|ios_base::out); C++17
basic_fstream(basic_fstream&& rhs);
basic_fstream& operator=(basic_fstream&& rhs);
@@ -152,6 +164,9 @@ public:
bool is_open() const;
void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);
void open(const string& s, ios_base::openmode mode = ios_base::in|ios_base::out);
+ void open(const filesystem::path& s,
+ ios_base::openmode mode = ios_base::in|ios_base::out); // C++17
+
void close();
};
@@ -171,6 +186,7 @@ typedef basic_fstream<wchar_t> wfstream;
#include <__locale>
#include <cstdio>
#include <cstdlib>
+#include <filesystem>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -219,6 +235,12 @@ public:
_LIBCPP_INLINE_VISIBILITY
basic_filebuf* open(const string& __s, ios_base::openmode __mode);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ basic_filebuf* open(const _VSTD_FS::path& __p, ios_base::openmode __mode) {
+ return open(__p.c_str(), __mode);
+ }
+#endif
_LIBCPP_INLINE_VISIBILITY
basic_filebuf* __open(int __fd, ios_base::openmode __mode);
#endif
@@ -1128,6 +1150,11 @@ public:
#endif
_LIBCPP_INLINE_VISIBILITY
explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_ifstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in)
+ : basic_ifstream(__p.c_str(), __mode) {}
+#endif // _LIBCPP_STD_VER >= 17
#endif
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
@@ -1149,6 +1176,13 @@ public:
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ void open(const filesystem::path& __p,
+ ios_base::openmode __mode = ios_base::in) {
+ return open(__p.c_str(), __mode);
+ }
+#endif // _LIBCPP_STD_VER >= 17
_LIBCPP_INLINE_VISIBILITY
void __open(int __fd, ios_base::openmode __mode);
@@ -1329,6 +1363,13 @@ public:
#endif
_LIBCPP_INLINE_VISIBILITY
explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
+
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_ofstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
+ : basic_ofstream(__p.c_str(), __mode) {}
+#endif // _LIBCPP_STD_VER >= 17
+
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
basic_ofstream(basic_ofstream&& __rhs);
@@ -1350,6 +1391,12 @@ public:
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::out);
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::out)
+ { return open(__p.c_str(), __mode); }
+#endif // _LIBCPP_STD_VER >= 17
+
_LIBCPP_INLINE_VISIBILITY
void __open(int __fd, ios_base::openmode __mode);
#endif
@@ -1530,6 +1577,13 @@ public:
#endif
_LIBCPP_INLINE_VISIBILITY
explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ explicit basic_fstream(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in | ios_base::out)
+ : basic_fstream(__p.c_str(), __mode) {}
+#endif // _LIBCPP_STD_VER >= 17
+
#endif
#ifndef _LIBCPP_CXX03_LANG
_LIBCPP_INLINE_VISIBILITY
@@ -1551,6 +1605,13 @@ public:
void open(const wchar_t* __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
#endif
void open(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
+
+#if _LIBCPP_STD_VER >= 17
+ _LIBCPP_INLINE_VISIBILITY
+ void open(const filesystem::path& __p, ios_base::openmode __mode = ios_base::in|ios_base::out)
+ { return open(__p.c_str(), __mode); }
+#endif // _LIBCPP_STD_VER >= 17
+
#endif
_LIBCPP_INLINE_VISIBILITY
void close();
OpenPOWER on IntegriCloud