From Jason Turner

[ifstream.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp26xof0n9/{from.md → to.md} +56 -0
tmp/tmp26xof0n9/{from.md → to.md} RENAMED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="ifstream.general">[[ifstream.general]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class charT, class traits = char_traits<charT>>
6
+ class basic_ifstream : public basic_istream<charT, traits> {
7
+ public:
8
+ using char_type = charT;
9
+ using int_type = typename traits::int_type;
10
+ using pos_type = typename traits::pos_type;
11
+ using off_type = typename traits::off_type;
12
+ using traits_type = traits;
13
+
14
+ // [ifstream.cons], constructors
15
+ basic_ifstream();
16
+ explicit basic_ifstream(const char* s,
17
+ ios_base::openmode mode = ios_base::in);
18
+ explicit basic_ifstream(const filesystem::path::value_type* s,
19
+ ios_base::openmode mode = ios_base::in);// wide systems only; see [fstream.syn]
20
+ explicit basic_ifstream(const string& s,
21
+ ios_base::openmode mode = ios_base::in);
22
+ template<class T>
23
+ explicit basic_ifstream(const T& s, ios_base::openmode mode = ios_base::in);
24
+ basic_ifstream(const basic_ifstream&) = delete;
25
+ basic_ifstream(basic_ifstream&& rhs);
26
+
27
+ basic_ifstream& operator=(const basic_ifstream&) = delete;
28
+ basic_ifstream& operator=(basic_ifstream&& rhs);
29
+
30
+ // [ifstream.swap], swap
31
+ void swap(basic_ifstream& rhs);
32
+
33
+ // [ifstream.members], members
34
+ basic_filebuf<charT, traits>* rdbuf() const;
35
+
36
+ bool is_open() const;
37
+ void open(const char* s, ios_base::openmode mode = ios_base::in);
38
+ void open(const filesystem::path::value_type* s,
39
+ ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]
40
+ void open(const string& s, ios_base::openmode mode = ios_base::in);
41
+ void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);
42
+ void close();
43
+
44
+ private:
45
+ basic_filebuf<charT, traits> sb; // exposition only
46
+ };
47
+ }
48
+ ```
49
+
50
+ The class `basic_ifstream<charT, traits>` supports reading from named
51
+ files. It uses a `basic_filebuf<{}charT, traits>` object to control the
52
+ associated sequence. For the sake of exposition, the maintained data is
53
+ presented here as:
54
+
55
+ - `sb`, the `filebuf` object.
56
+