Chameleon

Chameleon Svn Source Tree

Root/branches/Chimera/i386/modules/uClibcxx/istream.cpp

1/*Copyright (C) 2004 Garrett A. Kajmowicz
2
3This file is part of the uClibc++ Library.
4
5This library is free software; you can redistribute it and/or
6modify it under the terms of the GNU Lesser General Public
7License as published by the Free Software Foundation; either
8version 2.1 of the License, or (at your option) any later version.
9
10This library is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public
16License along with this library; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19*/
20
21#define __UCLIBCXX_COMPILE_ISTREAM__ 1
22
23#include <istream>
24
25
26namespace std{
27
28#ifdef __UCLIBCXX_EXPAND_ISTREAM_CHAR__
29
30template <> _UCXXEXPORT string _readToken<char, char_traits<char> >(istream & stream)
31{
32string temp;
33char_traits<char>::int_type c;
34while(true){
35c = stream.rdbuf()->sgetc();
36if(c != char_traits<char>::eof() && isspace(c) == false){
37stream.rdbuf()->sbumpc();
38temp.append(1, char_traits<char>::to_char_type(c));
39}else{
40break;
41}
42}
43if (temp.size() == 0)
44stream.setstate(ios_base::eofbit|ios_base::failbit);
45
46return temp;
47 }
48
49template _UCXXEXPORT istream::int_type istream::get();
50template _UCXXEXPORT istream & istream::get(char &c);
51
52template _UCXXEXPORT istream & istream::operator>>(bool &n);
53template _UCXXEXPORT istream & istream::operator>>(short &n);
54template _UCXXEXPORT istream & istream::operator>>(unsigned short &n);
55template _UCXXEXPORT istream & istream::operator>>(int &n);
56template _UCXXEXPORT istream & istream::operator>>(unsigned int &n);
57template _UCXXEXPORT istream & istream::operator>>(long unsigned &n);
58template _UCXXEXPORT istream & istream::operator>>(long int &n);
59template _UCXXEXPORT istream & istream::operator>>(void *& p);
60template _UCXXEXPORT istream & operator>>(istream & is, char & c);
61
62
63#ifdef __UCLIBCXX_HAS_FLOATS__
64template _UCXXEXPORT istream & istream::operator>>(float &f);
65template _UCXXEXPORT istream & istream::operator>>(double &f);
66template _UCXXEXPORT istream & istream::operator>>(long double &f);
67#endif
68
69template _UCXXEXPORT void __skipws(basic_istream<char, char_traits<char> >& is);
70
71#endif
72
73
74}
75
76

Archive Download this file

Revision: HEAD