]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/bytesinkutil.h
ICU-64252.0.1.tar.gz
[apple/icu.git] / icuSources / common / bytesinkutil.h
index 8287ffea4ca713dfdc489c63cac84bbc18332f89..69e4cbcd26393268582899ab09f292fdebc8005b 100644 (file)
@@ -13,6 +13,7 @@
 U_NAMESPACE_BEGIN
 
 class ByteSink;
+class CharString;
 class Edits;
 
 class U_COMMON_API ByteSinkUtil {
@@ -58,4 +59,25 @@ private:
                                         ByteSink &sink, uint32_t options, Edits *edits);
 };
 
+class CharStringByteSink : public ByteSink {
+public:
+    CharStringByteSink(CharString* dest);
+    ~CharStringByteSink() override;
+
+    CharStringByteSink() = delete;
+    CharStringByteSink(const CharStringByteSink&) = delete;
+    CharStringByteSink& operator=(const CharStringByteSink&) = delete;
+
+    void Append(const char* bytes, int32_t n) override;
+
+    char* GetAppendBuffer(int32_t min_capacity,
+                          int32_t desired_capacity_hint,
+                          char* scratch,
+                          int32_t scratch_capacity,
+                          int32_t* result_capacity) override;
+
+private:
+    CharString& dest_;
+};
+
 U_NAMESPACE_END