xref: /haiku/headers/private/locale/ICUWrapper.h (revision 45bd7bb3db9d9e4dcb02b89a3e7c2bf382c0a88c)
1 /*
2  * Copyright 2009, Adrien Destugues, pulkomandy@gmail.com.
3  * Distributed under the terms of the MIT License.
4  */
5 /* This file holds various wrapper functions to interface easily between ICU
6  * and the Be API.
7  */
8 #ifndef __ICU_WRAPPER_H__
9 #define __ICU_WRAPPER_H__
10 
11 #include <String.h>
12 
13 #include <unicode/bytestream.h>
14 #include <String.h>
15 
16 
17 /* Convert UnicodeString to BString needs an ICU ByteSink to do the work */
18 class BStringByteSink : public ByteSink {
19 	public:
20 		BStringByteSink(BString* dest) : dest_(dest) {}
21 		virtual void Append(const char* data, int32_t n)
22 			{ dest_->Append(data, n); }
23 	private:
24 		BString* dest_;
25 		BStringByteSink();
26 		BStringByteSink(const BStringByteSink &);
27 		BStringByteSink &operator=(const BStringByteSink &);
28 };
29 
30 
31 #endif
32