1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* 2ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru********************************************************************** 3fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius* Copyright (C) 2001-2014 International Business Machines 4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Corporation and others. All Rights Reserved. 5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru********************************************************************** 6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* FILE NAME : ustream.h 7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* 8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Modification History: 9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* 10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* Date Name Description 11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru* 06/25/2001 grhoten Move iostream from unistr.h 12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru****************************************************************************** 13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru*/ 1427f654740f2a26ad62a5c155af9199af9e69b889claireho 15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#ifndef USTREAM_H 16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#define USTREAM_H 17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 18ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include "unicode/unistr.h" 19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/** 21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * \file 22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * \brief C++ API: Unicode iostream like API 23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * 24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * At this time, this API is very limited. It contains 25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * operator<< and operator>> for UnicodeString manipulation with the 26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * C++ I/O stream API. 27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 29fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#if !defined(_MSC_VER) 30fceb39872958b9fa2505e63f8b8699a9e0f882f4ccorneliusnamespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364 31fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius#endif 32fceb39872958b9fa2505e63f8b8699a9e0f882f4ccornelius 33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#if U_IOSTREAM_SOURCE >= 199711 3427f654740f2a26ad62a5c155af9199af9e69b889claireho#if (__GNUC__ == 2) 3527f654740f2a26ad62a5c155af9199af9e69b889claireho#include <iostream> 3627f654740f2a26ad62a5c155af9199af9e69b889claireho#else 37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <istream> 38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#include <ostream> 3927f654740f2a26ad62a5c155af9199af9e69b889claireho#endif 40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_BEGIN 42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/** 44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Write the contents of a UnicodeString to a C++ ostream. This functions writes 45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * the characters in a UnicodeString to an ostream. The UChars in the 46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * UnicodeString are converted to the char based ostream with the default 47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * converter. 48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @stable 3.0 49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_IO_API std::ostream & U_EXPORT2 operator<<(std::ostream& stream, const UnicodeString& s); 51ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 52ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/** 53ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * Write the contents from a C++ istream to a UnicodeString. The UChars in the 54ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * UnicodeString are converted from the char based istream with the default 55ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * converter. 56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru * @stable 3.0 57ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru */ 58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_IO_API std::istream & U_EXPORT2 operator>>(std::istream& stream, UnicodeString& s); 59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruU_NAMESPACE_END 60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru/* No operator for UChar because it can conflict with wchar_t */ 64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru 65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#endif 66