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 14 #include <unicode/bytestream.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