| 1 | /*
|
|---|
| 2 | * Copyright (c) 2017 Jaroslav Jindrak
|
|---|
| 3 | * All rights reserved.
|
|---|
| 4 | *
|
|---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
|---|
| 6 | * modification, are permitted provided that the following conditions
|
|---|
| 7 | * are met:
|
|---|
| 8 | *
|
|---|
| 9 | * - Redistributions of source code must retain the above copyright
|
|---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
|---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
|---|
| 13 | * documentation and/or other materials provided with the distribution.
|
|---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
|---|
| 15 | * derived from this software without specific prior written permission.
|
|---|
| 16 | *
|
|---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|---|
| 27 | */
|
|---|
| 28 |
|
|---|
| 29 | namespace std
|
|---|
| 30 | {
|
|---|
| 31 | /**
|
|---|
| 32 | * 27.3, forward declarations:
|
|---|
| 33 | */
|
|---|
| 34 |
|
|---|
| 35 | template<class Char>
|
|---|
| 36 | class char_traits;
|
|---|
| 37 |
|
|---|
| 38 | template<>
|
|---|
| 39 | class char_traits<char>;
|
|---|
| 40 |
|
|---|
| 41 | template<>
|
|---|
| 42 | class char_traits<char16_t>;
|
|---|
| 43 |
|
|---|
| 44 | template<>
|
|---|
| 45 | class char_traits<char32_t>;
|
|---|
| 46 |
|
|---|
| 47 | template<>
|
|---|
| 48 | class char_traits<wchar_t>;
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 | template<class T>
|
|---|
| 53 | class allocator;
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 58 | class basic_ios;
|
|---|
| 59 |
|
|---|
| 60 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 61 | class basic_streambuf;
|
|---|
| 62 |
|
|---|
| 63 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 64 | class basic_istream;
|
|---|
| 65 |
|
|---|
| 66 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 67 | class basic_ostream;
|
|---|
| 68 |
|
|---|
| 69 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 70 | class basic_iostream;
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 | template<class Char, class Traits = char_traits<Char>,
|
|---|
| 75 | class Allocator = allocator<Char>>
|
|---|
| 76 | class basic_stringbuf;
|
|---|
| 77 |
|
|---|
| 78 | template<class Char, class Traits = char_traits<Char>,
|
|---|
| 79 | class Allocator = allocator<Char>>
|
|---|
| 80 | class basic_istringstream;
|
|---|
| 81 |
|
|---|
| 82 | template<class Char, class Traits = char_traits<Char>,
|
|---|
| 83 | class Allocator = allocator<Char>>
|
|---|
| 84 | class basic_ostringstream;
|
|---|
| 85 |
|
|---|
| 86 | template<class Char, class Traits = char_traits<Char>,
|
|---|
| 87 | class Allocator = allocator<Char>>
|
|---|
| 88 | class basic_stringstream;
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 93 | class basic_filebuf;
|
|---|
| 94 |
|
|---|
| 95 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 96 | class basic_ifstream;
|
|---|
| 97 |
|
|---|
| 98 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 99 | class basic_ofstream;
|
|---|
| 100 |
|
|---|
| 101 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 102 | class basic_fstream;
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 107 | class istreambuf_iterator;
|
|---|
| 108 |
|
|---|
| 109 | template<class Char, class Traits = char_traits<Char>>
|
|---|
| 110 | class ostreambuf_iterator;
|
|---|
| 111 |
|
|---|
| 112 | using ios = basic_ios<char>;
|
|---|
| 113 | using wios = basic_ios<wchar_t>;
|
|---|
| 114 |
|
|---|
| 115 | using streambuf = basic_streambuf<char>;
|
|---|
| 116 | using istream = basic_istream<char>;
|
|---|
| 117 | using ostream = basic_ostream<char>;
|
|---|
| 118 | using iostream = basic_iostream<char>;
|
|---|
| 119 |
|
|---|
| 120 | using stringbuf = basic_stringbuf<char>;
|
|---|
| 121 | using istringstream = basic_istringstream<char>;
|
|---|
| 122 | using ostringstream = basic_ostringstream<char>;
|
|---|
| 123 | using stringstream = basic_stringstream<char>;
|
|---|
| 124 |
|
|---|
| 125 | using filebuf = basic_filebuf<char>;
|
|---|
| 126 | using ifstream = basic_ifstream<char>;
|
|---|
| 127 | using ofstream = basic_ofstream<char>;
|
|---|
| 128 | using fstream = basic_fstream<char>;
|
|---|
| 129 |
|
|---|
| 130 | using wstreambuf = basic_streambuf<wchar_t>;
|
|---|
| 131 | using wistream = basic_istream<wchar_t>;
|
|---|
| 132 | using wostream = basic_ostream<wchar_t>;
|
|---|
| 133 | using wiostream = basic_iostream<wchar_t>;
|
|---|
| 134 |
|
|---|
| 135 | using wstringbuf = basic_stringbuf<wchar_t>;
|
|---|
| 136 | using wistringstream = basic_istringstream<wchar_t>;
|
|---|
| 137 | using wostringstream = basic_ostringstream<wchar_t>;
|
|---|
| 138 | using wstringstream = basic_stringstream<wchar_t>;
|
|---|
| 139 |
|
|---|
| 140 | using wfilebuf = basic_filebuf<wchar_t>;
|
|---|
| 141 | using wifstream = basic_ifstream<wchar_t>;
|
|---|
| 142 | using wofstream = basic_ofstream<wchar_t>;
|
|---|
| 143 | using wfstream = basic_fstream<wchar_t>;
|
|---|
| 144 |
|
|---|
| 145 | template<class State>
|
|---|
| 146 | class fpos;
|
|---|
| 147 |
|
|---|
| 148 | // TODO: standard p. 1012, this is circular, it offers fix
|
|---|
| 149 | /* using streampos = fpos<char_traits<char>::state_type>; */
|
|---|
| 150 | /* using wstreampos = fpos<char_traits<wchar_t>::state_type>; */
|
|---|
| 151 | // Temporary workaround.
|
|---|
| 152 | using streampos = unsigned long long;
|
|---|
| 153 | using wstreampos = unsigned long long;
|
|---|
| 154 | // TODO: This should be in ios and not here?
|
|---|
| 155 | using streamoff = long long;
|
|---|
| 156 | }
|
|---|