mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-5830 Make sure that the changes work on older versions of iostream.
X-SVN-Rev: 22633
This commit is contained in:
parent
17bca61824
commit
49f13eee28
2 changed files with 4 additions and 4 deletions
|
@ -51,8 +51,8 @@ U_IO_API std::istream & U_EXPORT2 operator>>(std::istream& stream, UnicodeString
|
|||
U_NAMESPACE_END
|
||||
|
||||
#elif U_IOSTREAM_SOURCE >= 198506
|
||||
#include <istream.h>
|
||||
#include <ostream.h>
|
||||
/* <istream.h> and <ostream.h> don't exist. */
|
||||
#include <iostream.h>
|
||||
|
||||
U_NAMESPACE_BEGIN
|
||||
U_IO_API ostream & U_EXPORT2 operator<<(ostream& stream, const UnicodeString& s);
|
||||
|
|
|
@ -100,7 +100,7 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str)
|
|||
if (stream.eof()) {
|
||||
// The EOF is only set after the get() of an unavailable byte.
|
||||
if (!initialWhitespace) {
|
||||
stream.clear(STD_NAMESPACE ios_base::eofbit);
|
||||
stream.clear(stream.eofbit);
|
||||
}
|
||||
continueReading = FALSE;
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ operator>>(STD_ISTREAM& stream, UnicodeString& str)
|
|||
ucnv_toUnicode(converter, &us, uLimit, &s, sLimit, 0, !continueReading, &errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
/* Something really bad happened */
|
||||
stream.setstate(STD_NAMESPACE ios_base::failbit);
|
||||
stream.setstate(stream.failbit);
|
||||
goto STOP_READING;
|
||||
}
|
||||
/* Was the character consumed? */
|
||||
|
|
Loading…
Add table
Reference in a new issue