33 lines
803 B
C++
33 lines
803 B
C++
// Copyright 2018 The PDFium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
|
#ifndef CORE_FXCRT_CFX_UTF8ENCODER_H_
|
|
#define CORE_FXCRT_CFX_UTF8ENCODER_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "core/fxcrt/bytestring.h"
|
|
#include "core/fxcrt/data_vector.h"
|
|
|
|
class CFX_UTF8Encoder {
|
|
public:
|
|
CFX_UTF8Encoder();
|
|
~CFX_UTF8Encoder();
|
|
|
|
void Input(wchar_t unicodeAsWchar);
|
|
|
|
// The data returned by GetResult() is invalidated when this is modified by
|
|
// appending any data.
|
|
ByteStringView GetResult() const {
|
|
return ByteStringView(m_Buffer.data(), m_Buffer.size());
|
|
}
|
|
|
|
private:
|
|
DataVector<uint8_t> m_Buffer;
|
|
};
|
|
|
|
#endif // CORE_FXCRT_CFX_UTF8ENCODER_H_
|