1bad1ff34a
- libicule and libiculx do not exist anymore in newer ICU versions (harfbuzz replaces them), but we didn't actually use them, so remove them from the build feature and from the package dependencies - Add namespace usage marcos since the newer ICU packages put ICU things in a namespace, making it easier to have multiple versions of ICU used side by side. No functional change intended, but this makes it possible to build the code with either ICU 57 (for gcc2) or 66 (for other architectures).
40 lines
830 B
C++
40 lines
830 B
C++
/*
|
|
* Copyright 2009, Adrien Destugues, pulkomandy@gmail.com.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
/* This file holds various wrapper functions to interface easily between ICU
|
|
* and the Be API.
|
|
*/
|
|
#ifndef __ICU_WRAPPER_H__
|
|
#define __ICU_WRAPPER_H__
|
|
|
|
|
|
#include <String.h>
|
|
|
|
#include <unicode/bytestream.h>
|
|
#include <String.h>
|
|
|
|
|
|
/* Convert UnicodeString to BString needs an ICU ByteSink to do the work */
|
|
class BStringByteSink : public U_NAMESPACE_QUALIFIER ByteSink {
|
|
public:
|
|
BStringByteSink(BString* dest)
|
|
: fDest(dest)
|
|
{}
|
|
virtual void Append(const char* data, int32_t n)
|
|
{ fDest->Append(data, n); }
|
|
|
|
void SetTo(BString* dest)
|
|
{ fDest = dest; }
|
|
|
|
private:
|
|
BString* fDest;
|
|
|
|
BStringByteSink();
|
|
BStringByteSink(const BStringByteSink&);
|
|
BStringByteSink& operator=(const BStringByteSink&);
|
|
};
|
|
|
|
|
|
#endif
|