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 9 10 #ifndef __ICU_WRAPPER_H__ 11 #define __ICU_WRAPPER_H__ 12 13 #include <String.h> 14 15 #include <unicode/bytestream.h> 16 #include <String.h> 17 18 19 /* Convert UnicodeString to BString needs an ICU ByteSink to do the work */ 20 class BStringByteSink : public ByteSink { 21 public: 22 BStringByteSink(BString* dest) : dest_(dest) {} 23 virtual void Append(const char* data, int32_t n) 24 { dest_->Append(data, n); } 25 private: 26 BString* dest_; 27 BStringByteSink(); 28 BStringByteSink(const BStringByteSink &); 29 BStringByteSink &operator=(const BStringByteSink &); 30 }; 31 32 33 #endif 34