// Input streams -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009
+// 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// ISO C++ 14882: 27.6.1 Input streams
//
-/** @file istream
+/** @file include/istream
* This is a Standard C++ Library header.
*/
#include <ios>
#include <ostream>
-_GLIBCXX_BEGIN_NAMESPACE(std)
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
// [27.6.1.1] Template class basic_istream
/**
* @brief Interface for manipulators.
*
* Manipulators such as @c std::ws and @c std::dec use these
- * functions in constructs like "std::cin >> std::ws". For more
- * information, see the iomanip header.
+ * functions in constructs like
+ * <code>std::cin >> std::ws</code>.
+ * For more information, see the iomanip header.
*/
__istream_type&
operator>>(__istream_type& (*__pf)(__istream_type&))
* @param n Maximum number of characters to store in @a s.
* @return *this
*
- * Returns @c get(s,n,widen('\n')).
+ * Returns @c get(s,n,widen('\\n')).
*/
__istream_type&
get(char_type* __s, streamsize __n)
* @param sb A streambuf in which to store data.
* @return *this
*
- * Returns @c get(sb,widen('\n')).
+ * Returns @c get(sb,widen('\\n')).
*/
__istream_type&
get(__streambuf_type& __sb)
* @param n Maximum number of characters to extract.
* @return *this
*
- * Returns @c getline(s,n,widen('\n')).
+ * Returns @c getline(s,n,widen('\\n')).
*/
__istream_type&
getline(char_type* __s, streamsize __n)
* If @c rdbuf() is null or if @c sputbackc() fails, sets badbit in
* the error state.
*
- * @note Since no characters are extracted, the next call to
- * @c gcount() will return 0, as required by DR 60.
+ * @note This function first clears eofbit. Since no characters
+ * are extracted, the next call to @c gcount() will return 0,
+ * as required by DR 60.
*/
__istream_type&
putback(char_type __c);
* If @c rdbuf() is null or if @c sungetc() fails, sets badbit in
* the error state.
*
- * @note Since no characters are extracted, the next call to
- * @c gcount() will return 0, as required by DR 60.
+ * @note This function first clears eofbit. Since no characters
+ * are extracted, the next call to @c gcount() will return 0,
+ * as required by DR 60.
*/
__istream_type&
unget();
*
* @note This function does not count the number of characters
* extracted, if any, and therefore does not affect the next
- * call to @c gcount().
+ * call to @c gcount(). At variance with putback, unget and
+ * seekg, eofbit is not cleared first.
*/
- pos_type
+ pos_type
tellg();
/**
* If @c fail() is not true, calls @c rdbuf()->pubseekpos(pos). If
* that function fails, sets failbit.
*
- * @note This function does not count the number of characters
- * extracted, if any, and therefore does not affect the next
- * call to @c gcount().
+ * @note This function first clears eofbit. It does not count the
+ * number of characters extracted, if any, and therefore does
+ * not affect the next call to @c gcount().
*/
- __istream_type&
+ __istream_type&
seekg(pos_type);
/**
* If @c fail() is not true, calls @c rdbuf()->pubseekoff(off,dir).
* If that function fails, sets failbit.
*
- * @note This function does not count the number of characters
- * extracted, if any, and therefore does not affect the next
- * call to @c gcount().
+ * @note This function first clears eofbit. It does not count the
+ * number of characters extracted, if any, and therefore does
+ * not affect the next call to @c gcount().
*/
__istream_type&
seekg(off_type, ios_base::seekdir);
* @brief Performs setup work for input streams.
*
* Objects of this class are created before all of the standard
- * extractors are run. It is responsible for "exception-safe prefix and
- * suffix operations," although only prefix actions are currently required
- * by the standard.
+ * extractors are run. It is responsible for <em>exception-safe
+ * prefix and suffix operations,</em> although only prefix actions
+ * are currently required by the standard.
*/
template<typename _CharT, typename _Traits>
class basic_istream<_CharT, _Traits>::sentry
* @param noskipws Whether to consume whitespace or not.
*
* If the stream state is good (@a is.good() is true), then the
- * following actions are performed, otherwise the sentry state is
- * false ("not okay") and failbit is set in the stream state.
+ * following actions are performed, otherwise the sentry state
+ * is false (<em>not okay</em>) and failbit is set in the
+ * stream state.
*
* The sentry's preparatory actions are:
*
* used to determine whether each character is whitespace.
*
* If the stream state is still good, then the sentry state becomes
- * true ("okay").
+ * true (@a okay).
*/
explicit
sentry(basic_istream<_CharT, _Traits>& __is, bool __noskipws = false);
* status, this function extracts up to @c n characters and stores them
* into the array starting at @a s. @c n is defined as:
*
- * - if @c width() is greater than zero, @c n is width()
- * - otherwise @c n is "the number of elements of the largest array of
- * @c char_type that can store a terminating @c eos." [27.6.1.2.3]/6
+ * - if @c width() is greater than zero, @c n is width() otherwise
+ * - @c n is <em>the number of elements of the largest array of *
+ * - @c char_type that can store a terminating @c eos.</em>
+ * - [27.6.1.2.3]/6
*
* Characters are extracted and stored until one of the following happens:
* - @c n-1 characters are stored
{ return (__is >> __x); }
#endif // __GXX_EXPERIMENTAL_CXX0X__
-_GLIBCXX_END_NAMESPACE
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
-#ifndef _GLIBCXX_EXPORT_TEMPLATE
-# include <bits/istream.tcc>
-#endif
+#include <bits/istream.tcc>
#endif /* _GLIBCXX_ISTREAM */