1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/io/unicode/ustream.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +/* 1.5 +********************************************************************** 1.6 +* Copyright (C) 2001-2011 International Business Machines 1.7 +* Corporation and others. All Rights Reserved. 1.8 +********************************************************************** 1.9 +* FILE NAME : ustream.h 1.10 +* 1.11 +* Modification History: 1.12 +* 1.13 +* Date Name Description 1.14 +* 06/25/2001 grhoten Move iostream from unistr.h 1.15 +****************************************************************************** 1.16 +*/ 1.17 + 1.18 +#ifndef USTREAM_H 1.19 +#define USTREAM_H 1.20 + 1.21 +#include "unicode/unistr.h" 1.22 + 1.23 +/** 1.24 + * \file 1.25 + * \brief C++ API: Unicode iostream like API 1.26 + * 1.27 + * At this time, this API is very limited. It contains 1.28 + * operator<< and operator>> for UnicodeString manipulation with the 1.29 + * C++ I/O stream API. 1.30 + */ 1.31 + 1.32 +#if U_IOSTREAM_SOURCE >= 199711 1.33 +#if (__GNUC__ == 2) 1.34 +#include <iostream> 1.35 +#else 1.36 +#include <istream> 1.37 +#include <ostream> 1.38 +#endif 1.39 + 1.40 +U_NAMESPACE_BEGIN 1.41 + 1.42 +/** 1.43 + * Write the contents of a UnicodeString to a C++ ostream. This functions writes 1.44 + * the characters in a UnicodeString to an ostream. The UChars in the 1.45 + * UnicodeString are converted to the char based ostream with the default 1.46 + * converter. 1.47 + * @stable 3.0 1.48 + */ 1.49 +U_IO_API std::ostream & U_EXPORT2 operator<<(std::ostream& stream, const UnicodeString& s); 1.50 + 1.51 +/** 1.52 + * Write the contents from a C++ istream to a UnicodeString. The UChars in the 1.53 + * UnicodeString are converted from the char based istream with the default 1.54 + * converter. 1.55 + * @stable 3.0 1.56 + */ 1.57 +U_IO_API std::istream & U_EXPORT2 operator>>(std::istream& stream, UnicodeString& s); 1.58 +U_NAMESPACE_END 1.59 + 1.60 +#endif 1.61 + 1.62 +/* No operator for UChar because it can conflict with wchar_t */ 1.63 + 1.64 +#endif