Loading...
Searching...
No Matches
appendable.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
* Copyright (C) 2011-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*******************************************************************************
* file name: appendable.h
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
* created on: 2010dec07
* created by: Markus W. Scherer
*/
#ifndef __APPENDABLE_H__
#define __APPENDABLE_H__
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class UnicodeString;
class U_COMMON_API Appendable : public UObject {
public:
~Appendable();
virtual UBool appendCodeUnit(char16_t c) = 0;
virtual UBool appendCodePoint(UChar32 c);
virtual UBool appendString(const char16_t *s, int32_t length);
virtual UBool reserveAppendCapacity(int32_t appendCapacity);
virtual char16_t *getAppendBuffer(int32_t minCapacity,
int32_t desiredCapacityHint,
char16_t *scratch, int32_t scratchCapacity,
int32_t *resultCapacity);
};
class U_COMMON_API UnicodeStringAppendable : public Appendable {
public:
explicit UnicodeStringAppendable(UnicodeString &s) : str(s) {}
~UnicodeStringAppendable();
virtual UBool appendCodeUnit(char16_t c) override;
virtual UBool appendCodePoint(UChar32 c) override;
virtual UBool appendString(const char16_t *s, int32_t length) override;
virtual UBool reserveAppendCapacity(int32_t appendCapacity) override;
virtual char16_t *getAppendBuffer(int32_t minCapacity,
int32_t desiredCapacityHint,
char16_t *scratch, int32_t scratchCapacity,
int32_t *resultCapacity) override;
private:
UnicodeString &str;
};
U_NAMESPACE_END
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // __APPENDABLE_H__
UChar32
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition umachine.h:449
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition umachine.h:269
uobject.h
C++ API: Common ICU base class UObject.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_COMMON_API
#define U_COMMON_API
Set to export library symbols from inside the common library, and to import them from outside.
Definition utypes.h:315