5#ifndef CORE_FXCRT_FIXED_SIZE_DATA_VECTOR_H_
6#define CORE_FXCRT_FIXED_SIZE_DATA_VECTOR_H_
13#include "core/fxcrt/fx_memory_wrappers.h"
14#include "third_party/base/containers/span.h"
51 T* ptr = FX_TryAlloc(T, size);
62 data_ =
std::move(that.data_);
63 size_ = std::exchange(that.size_, 0);
69 bool empty()
const {
return size_ == 0; }
74 operator pdfium::span<
const T>()
const {
return span(); }
77 pdfium::span<T> span() {
return pdfium::span<T>(data_.get(), size_); }
78 pdfium::span<
const T> span()
const {
79 return pdfium::span<
const T>(data_.get(), size_);
84 size_t count = pdfium::dynamic_extent) {
85 return span().subspan(offset, count);
87 pdfium::span<
const T>
subspan(size_t offset,
88 size_t count = pdfium::dynamic_extent)
const {
89 return span().subspan(offset, count);
92 pdfium::span<T>
first(size_t count) {
return span().first(count); }
93 pdfium::span<
const T>
first(size_t count)
const {
94 return span().first(count);
97 pdfium::span<T>
last(size_t count) {
return span().last(count); }
98 pdfium::span<
const T>
last(size_t count)
const {
return span().last(count); }
101 FixedSizeDataVector(T* ptr, size_t size) : data_(ptr), size_(size) {}
109using fxcrt::FixedSizeDataVector;
CFX_FloatRect(const FX_RECT &rect)
FX_RECT GetOuterRect() const
static constexpr uint32_t MakeTag(char c1, char c2, char c3, char c4)
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
size_t CountChar(ByteStringView pString) const override
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const override
bool IsCIDFont() const override
const uint8_t * GetCIDTransform(uint16_t cid) const
bool IsUnicodeCompatible() const override
int AppendChar(char *str, uint32_t charcode) const override
CFX_Point16 GetVertOrigin(uint16_t cid) const
int GetCharWidthF(uint32_t charcode) override
const CPDF_CIDFont * AsCIDFont() const override
uint16_t CIDFromCharCode(uint32_t charcode) const
int GlyphFromCharCode(uint32_t charcode, bool *pVertGlyph) override
int16_t GetVertWidth(uint16_t cid) const
FX_RECT GetCharBBox(uint32_t charcode) override
static float CIDTransformToFloat(uint8_t ch)
bool IsVertWriting() const override
uint32_t CharCodeFromUnicode(wchar_t Unicode) const override
int GetCharSize(uint32_t charcode) const
WideString UnicodeFromCharCode(uint32_t charcode) const override
CPDF_CIDFont * AsCIDFont() override
static CIDSet CharsetFromOrdering(ByteStringView ordering)
bool IsVertWriting() const
void SetVertical(bool vert)
static constexpr size_t kDirectMapTableSize
CIDCoding GetCoding() const
size_t CountChar(ByteStringView pString) const
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const
int AppendChar(char *str, uint32_t charcode) const
void SetCharset(CIDSet set)
const fxcmap::CMap * GetEmbedMap() const
uint16_t CIDFromCharCode(uint32_t charcode) const
void SetAdditionalMappings(std::vector< CIDRange > mappings)
int GetCharSize(uint32_t charcode) const
bool IsDirectCharcodeToCIDTableIsEmpty() const
void SetMixedFourByteLeadingRanges(std::vector< CodeRange > ranges)
CIDSet GetCharset() const
void SetDirectCharcodeToCIDTableRange(uint32_t start_code, uint32_t end_code, uint16_t start_cid)
void SetCodingScheme(CodingScheme scheme)
static CPDF_FontGlobals * GetInstance()
void LoadFontDescriptor(const CPDF_Dictionary *pFontDesc)
virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const
static bool UseTTCharmapMacRoman(const RetainPtr< CFX_Face > &face)
static bool UseTTCharmapMSUnicode(const RetainPtr< CFX_Face > &face)
virtual WideString UnicodeFromCharCode(uint32_t charcode) const
static FX_RECT GetCharBBoxForFace(const RetainPtr< CFX_Face > &face)
bool operator==(const char *ptr) const
pdfium::span< T > last(size_t count)
pdfium::span< const T > subspan(size_t offset, size_t count=pdfium::dynamic_extent) const
operator pdfium::span< T >()
static FixedSizeDataVector Uninit(size_t size)
operator pdfium::span< const T >() const
pdfium::span< const T > first(size_t count) const
FixedSizeDataVector(FixedSizeDataVector< T > &&that) noexcept
FixedSizeDataVector(const FixedSizeDataVector &)=delete
pdfium::span< T > first(size_t count)
static FixedSizeDataVector TryZeroed(size_t size)
~FixedSizeDataVector()=default
static FixedSizeDataVector Zeroed(size_t size)
pdfium::span< const T > last(size_t count) const
FixedSizeDataVector & operator=(const FixedSizeDataVector &)=delete
pdfium::span< T > subspan(size_t offset, size_t count=pdfium::dynamic_extent)
FixedSizeDataVector & operator=(FixedSizeDataVector< T > &&that) noexcept
FixedSizeDataVector()=default
CharType operator[](const size_t index) const
uint32_t CharCodeFromUnicodeForEncoding(fxge::FontEncoding encoding, wchar_t unicode)
wchar_t UnicodeFromAdobeName(const char *name)
constexpr wchar_t kBoxDrawingsLightVerical
#define CONSTRUCT_VIA_MAKE_RETAIN
FX_RECT & operator=(const FX_RECT &that)=default
constexpr FX_RECT(int l, int t, int r, int b)