1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include <__config>
10#include <fstream>
11#include <ios>
12#include <istream>
13#include <ostream>
14#include <sstream>
15#include <streambuf>
16
17_LIBCPP_BEGIN_NAMESPACE_STD
18_LIBCPP_BEGIN_EXPLICIT_ABI_ANNOTATIONS
19
20#if _LIBCPP_HAS_FILESYSTEM
21// This is provided for ABI compatiblity with programs compiled against old headers.
22// TODO: Is this actually required? If so, this should be guarded with
23// `_LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION < 24`. Otherwise this should be removed.
24template <class _CharT, class _Traits>
25bool basic_filebuf<_CharT, _Traits>::__read_mode() {
26 if (!(__cm_ & ios_base::in)) {
27 this->setp(nullptr, nullptr);
28 if (__always_noconv_)
29 this->setg((char_type*)__extbuf_, (char_type*)__extbuf_ + __ebs_, (char_type*)__extbuf_ + __ebs_);
30 else
31 this->setg(__intbuf_, __intbuf_ + __ibs_, __intbuf_ + __ibs_);
32 __cm_ = ios_base::in;
33 return true;
34 }
35 return false;
36}
37#endif
38
39// Original explicit instantiations provided in the library
40template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
41template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
42template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
43template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
44template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
45
46#if _LIBCPP_HAS_WIDE_CHARACTERS
47template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
48template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
49template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
50template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
51#endif
52
53// Additional instantiations added later. Whether programs rely on these being
54// available is protected by _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1.
55template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf<char>;
56template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream<char>;
57template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream<char>;
58template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream<char>;
59
60#if _LIBCPP_HAS_FILESYSTEM
61template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream<char>;
62template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream<char>;
63template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf<char>;
64#endif
65
66// Add more here if needed...
67
68_LIBCPP_END_EXPLICIT_ABI_ANNOTATIONS
69_LIBCPP_END_NAMESPACE_STD
70