jpayne@69
|
1 // © 2016 and later: Unicode, Inc. and others.
|
jpayne@69
|
2 // License & terms of use: http://www.unicode.org/copyright.html
|
jpayne@69
|
3 /*
|
jpayne@69
|
4 **********************************************************************
|
jpayne@69
|
5 * Copyright (C) 2001-2014 International Business Machines
|
jpayne@69
|
6 * Corporation and others. All Rights Reserved.
|
jpayne@69
|
7 **********************************************************************
|
jpayne@69
|
8 * FILE NAME : ustream.h
|
jpayne@69
|
9 *
|
jpayne@69
|
10 * Modification History:
|
jpayne@69
|
11 *
|
jpayne@69
|
12 * Date Name Description
|
jpayne@69
|
13 * 06/25/2001 grhoten Move iostream from unistr.h
|
jpayne@69
|
14 ******************************************************************************
|
jpayne@69
|
15 */
|
jpayne@69
|
16
|
jpayne@69
|
17 #ifndef USTREAM_H
|
jpayne@69
|
18 #define USTREAM_H
|
jpayne@69
|
19
|
jpayne@69
|
20 #include "unicode/utypes.h"
|
jpayne@69
|
21
|
jpayne@69
|
22 #if U_SHOW_CPLUSPLUS_API
|
jpayne@69
|
23
|
jpayne@69
|
24 #include "unicode/unistr.h"
|
jpayne@69
|
25
|
jpayne@69
|
26 #if !UCONFIG_NO_CONVERSION // not available without conversion
|
jpayne@69
|
27
|
jpayne@69
|
28 /**
|
jpayne@69
|
29 * \file
|
jpayne@69
|
30 * \brief C++ API: Unicode iostream like API
|
jpayne@69
|
31 *
|
jpayne@69
|
32 * At this time, this API is very limited. It contains
|
jpayne@69
|
33 * operator<< and operator>> for UnicodeString manipulation with the
|
jpayne@69
|
34 * C++ I/O stream API.
|
jpayne@69
|
35 */
|
jpayne@69
|
36
|
jpayne@69
|
37 #if defined(__GLIBCXX__)
|
jpayne@69
|
38 namespace std { class type_info; } // WORKAROUND: http://llvm.org/bugs/show_bug.cgi?id=13364
|
jpayne@69
|
39 #endif
|
jpayne@69
|
40
|
jpayne@69
|
41 #include <iostream>
|
jpayne@69
|
42
|
jpayne@69
|
43 U_NAMESPACE_BEGIN
|
jpayne@69
|
44
|
jpayne@69
|
45 /**
|
jpayne@69
|
46 * Write the contents of a UnicodeString to a C++ ostream. This functions writes
|
jpayne@69
|
47 * the characters in a UnicodeString to an ostream. The UChars in the
|
jpayne@69
|
48 * UnicodeString are converted to the char based ostream with the default
|
jpayne@69
|
49 * converter.
|
jpayne@69
|
50 * @stable 3.0
|
jpayne@69
|
51 */
|
jpayne@69
|
52 U_IO_API std::ostream & U_EXPORT2 operator<<(std::ostream& stream, const UnicodeString& s);
|
jpayne@69
|
53
|
jpayne@69
|
54 /**
|
jpayne@69
|
55 * Write the contents from a C++ istream to a UnicodeString. The UChars in the
|
jpayne@69
|
56 * UnicodeString are converted from the char based istream with the default
|
jpayne@69
|
57 * converter.
|
jpayne@69
|
58 * @stable 3.0
|
jpayne@69
|
59 */
|
jpayne@69
|
60 U_IO_API std::istream & U_EXPORT2 operator>>(std::istream& stream, UnicodeString& s);
|
jpayne@69
|
61 U_NAMESPACE_END
|
jpayne@69
|
62
|
jpayne@69
|
63 #endif
|
jpayne@69
|
64
|
jpayne@69
|
65 /* No operator for UChar because it can conflict with wchar_t */
|
jpayne@69
|
66
|
jpayne@69
|
67 #endif /* U_SHOW_CPLUSPLUS_API */
|
jpayne@69
|
68
|
jpayne@69
|
69 #endif
|