Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

66 Zeilen
2.2KB

  1. // filebuf with encoding state type -*- C++ -*-
  2. // Copyright (C) 2002-2020 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file ext/enc_filebuf.h
  21. * This file is a GNU extension to the Standard C++ Library.
  22. */
  23. #ifndef _EXT_ENC_FILEBUF_H
  24. #define _EXT_ENC_FILEBUF_H 1
  25. #include <fstream>
  26. #include <locale>
  27. #include <ext/codecvt_specializations.h>
  28. namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
  29. {
  30. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  31. /// class enc_filebuf.
  32. template<typename _CharT>
  33. class enc_filebuf
  34. : public std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >
  35. {
  36. public:
  37. typedef encoding_char_traits<_CharT> traits_type;
  38. typedef typename traits_type::state_type state_type;
  39. typedef typename traits_type::pos_type pos_type;
  40. enc_filebuf(state_type& __state)
  41. : std::basic_filebuf<_CharT, encoding_char_traits<_CharT> >()
  42. { this->_M_state_beg = __state; }
  43. private:
  44. // concept requirements:
  45. // Set state type to something useful.
  46. // Something more than copyconstructible is needed here, so
  47. // require default and copy constructible + assignment operator.
  48. __glibcxx_class_requires(state_type, _SGIAssignableConcept)
  49. };
  50. _GLIBCXX_END_NAMESPACE_VERSION
  51. } // namespace
  52. #endif