3 // Copyright (C) 2003 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 2, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING. If not, write to the Free
18 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21 // 27.8.1.1 - Template class basic_filebuf
22 // NB: This file is for testing basic_filebuf with NO OTHER INCLUDES.
25 #include <testsuite_hooks.h>
27 // libstdc++/10132, add on
30 unsigned long character
;
34 operator==(const gnu_char_type
& __lhs
)
35 { return character
== __lhs
.character
; }
39 operator<(const gnu_char_type
& __lhs
)
40 { return character
< __lhs
.character
; }
46 gnu_char_type(const unsigned long& __l
) : character(__l
) { }
49 operator unsigned long() const { return character
; }
52 // char_traits specialization
53 struct gnu_char_traits
55 typedef gnu_char_type char_type
;
56 typedef long int_type
;
57 typedef std::streamoff off_type
;
58 typedef long state_type
;
59 typedef std::fpos
<state_type
> pos_type
;
62 assign(char_type
& __c1
, const char_type
& __c2
) { }
65 eq(const char_type
& __c1
, const char_type
& __c2
) { return true; }
68 lt(const char_type
& __c1
, const char_type
& __c2
) { return true; }
71 compare(const char_type
* __s1
, const char_type
* __s2
, size_t __n
)
75 length(const char_type
* __s
) { return 0; }
77 static const char_type
*
78 find(const char_type
* __s
, size_t __n
, const char_type
& __a
)
82 move(char_type
* __s1
, const char_type
* __s2
, size_t __n
)
86 copy(char_type
* __s1
, const char_type
* __s2
, size_t __n
)
90 assign(char_type
* __s
, size_t __n
, char_type __a
)
94 to_char_type(const int_type
& __c
)
95 { return char_type(); }
98 to_int_type(const char_type
& __c
)
99 { return int_type(); }
102 eq_int_type(const int_type
& __c1
, const int_type
& __c2
)
107 { return int_type(); }
110 not_eof(const int_type
& __c
)
111 { return int_type(); }
116 bool test
__attribute__((unused
)) = true;
117 typedef std::basic_filebuf
<gnu_char_type
, gnu_char_traits
> gnu_filebuf
;
121 // Need codecvt facet for width argument in seekoff.
123 obj
.pubseekoff(2, std::ios_base::beg
);
125 catch(std::exception
& obj
)