Rename CPDF_{Byte,Wide}String::AsSpan() to span()
Makes these method names consistent between strings and string views,
so that templates may more easily be applied to both.
-- CPDF_ByteString::AsRawSpan() renamed to raw_span().
Change-Id: If957ecb99987bf70885e1cd62b837e216a60acaa
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/57950
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_crypto_handler.cpp b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
index 53d8f5f..6ecc262 100644
--- a/core/fpdfapi/parser/cpdf_crypto_handler.cpp
+++ b/core/fpdfapi/parser/cpdf_crypto_handler.cpp
@@ -263,7 +263,7 @@
const ByteString& str) {
CFX_BinaryBuf dest_buf;
void* context = DecryptStart(objnum, gennum);
- DecryptStream(context, str.AsRawSpan(), dest_buf);
+ DecryptStream(context, str.raw_span(), dest_buf);
DecryptFinish(context, dest_buf);
return ByteString(dest_buf.GetBuffer(), dest_buf.GetSize());
}
diff --git a/core/fpdfapi/parser/cpdf_name.cpp b/core/fpdfapi/parser/cpdf_name.cpp
index bc54623..9f3f49f 100644
--- a/core/fpdfapi/parser/cpdf_name.cpp
+++ b/core/fpdfapi/parser/cpdf_name.cpp
@@ -48,7 +48,7 @@
}
WideString CPDF_Name::GetUnicodeText() const {
- return PDF_DecodeText(m_Name.AsRawSpan());
+ return PDF_DecodeText(m_Name.raw_span());
}
bool CPDF_Name::WriteTo(IFX_ArchiveStream* archive,
diff --git a/core/fpdfapi/parser/cpdf_string.cpp b/core/fpdfapi/parser/cpdf_string.cpp
index e30c50e..fd5c7f0 100644
--- a/core/fpdfapi/parser/cpdf_string.cpp
+++ b/core/fpdfapi/parser/cpdf_string.cpp
@@ -64,13 +64,13 @@
}
WideString CPDF_String::GetUnicodeText() const {
- return PDF_DecodeText(m_String.AsRawSpan());
+ return PDF_DecodeText(m_String.raw_span());
}
bool CPDF_String::WriteTo(IFX_ArchiveStream* archive,
const CPDF_Encryptor* encryptor) const {
std::vector<uint8_t> encrypted_data;
- pdfium::span<const uint8_t> data = m_String.AsRawSpan();
+ pdfium::span<const uint8_t> data = m_String.raw_span();
if (encryptor) {
encrypted_data = encryptor->Encrypt(data);
data = encrypted_data;
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 6ecd0bc..d7491e5 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -77,7 +77,7 @@
csOn = pArray->GetStringAt(m_pField->GetControlIndex(this));
if (csOn.IsEmpty())
csOn = "Yes";
- return PDF_DecodeText(csOn.AsRawSpan());
+ return PDF_DecodeText(csOn.raw_span());
}
bool CPDF_FormControl::IsChecked() const {
diff --git a/core/fxcrt/bytestring.h b/core/fxcrt/bytestring.h
index d525050..f939213 100644
--- a/core/fxcrt/bytestring.h
+++ b/core/fxcrt/bytestring.h
@@ -86,11 +86,11 @@
// Explicit conversion to span.
// Note: Any subsequent modification of |this| will invalidate the result.
- pdfium::span<const char> AsSpan() const {
+ pdfium::span<const char> span() const {
return pdfium::make_span(m_pData ? m_pData->m_String : nullptr,
GetLength());
}
- pdfium::span<const uint8_t> AsRawSpan() const {
+ pdfium::span<const uint8_t> raw_span() const {
return pdfium::make_span(raw_str(), GetLength());
}
diff --git a/core/fxcrt/bytestring_unittest.cpp b/core/fxcrt/bytestring_unittest.cpp
index b9cab63..6152f78 100644
--- a/core/fxcrt/bytestring_unittest.cpp
+++ b/core/fxcrt/bytestring_unittest.cpp
@@ -24,11 +24,11 @@
EXPECT_DEATH({ abc[3]; }, ".*");
#endif
- pdfium::span<const char> abc_span = abc.AsSpan();
+ pdfium::span<const char> abc_span = abc.span();
EXPECT_EQ(3u, abc_span.size());
EXPECT_EQ(0, memcmp(abc_span.data(), "abc", 3));
- pdfium::span<const uint8_t> abc_raw_span = abc.AsRawSpan();
+ pdfium::span<const uint8_t> abc_raw_span = abc.raw_span();
EXPECT_EQ(3u, abc_raw_span.size());
EXPECT_EQ(0, memcmp(abc_raw_span.data(), "abc", 3));
@@ -1595,11 +1595,11 @@
const uint8_t* rstr = empty_str.raw_str();
EXPECT_EQ(nullptr, rstr);
- pdfium::span<const char> cspan = empty_str.AsSpan();
+ pdfium::span<const char> cspan = empty_str.span();
EXPECT_TRUE(cspan.empty());
EXPECT_EQ(nullptr, cspan.data());
- pdfium::span<const uint8_t> rspan = empty_str.AsRawSpan();
+ pdfium::span<const uint8_t> rspan = empty_str.raw_span();
EXPECT_TRUE(rspan.empty());
EXPECT_EQ(nullptr, rspan.data());
}
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index 96bb3c4..8a98028 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -82,7 +82,7 @@
// Explicit conversion to span.
// Note: Any subsequent modification of |this| will invalidate the result.
- pdfium::span<const wchar_t> AsSpan() const {
+ pdfium::span<const wchar_t> span() const {
return pdfium::make_span(m_pData ? m_pData->m_String : nullptr,
GetLength());
}
diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp
index ef24d36..48a45b7 100644
--- a/core/fxcrt/widestring_unittest.cpp
+++ b/core/fxcrt/widestring_unittest.cpp
@@ -25,7 +25,7 @@
EXPECT_DEATH({ abc[4]; }, ".*");
#endif
- pdfium::span<const wchar_t> abc_span = abc.AsSpan();
+ pdfium::span<const wchar_t> abc_span = abc.span();
EXPECT_EQ(3u, abc_span.size());
EXPECT_EQ(0, wmemcmp(abc_span.data(), L"abc", 3));
@@ -1567,7 +1567,7 @@
EXPECT_NE(nullptr, cstr);
EXPECT_EQ(0u, wcslen(cstr));
- pdfium::span<const wchar_t> cspan = empty_str.AsSpan();
+ pdfium::span<const wchar_t> cspan = empty_str.span();
EXPECT_TRUE(cspan.empty());
EXPECT_EQ(nullptr, cspan.data());
}
diff --git a/core/fxge/cfx_folderfontinfo.cpp b/core/fxge/cfx_folderfontinfo.cpp
index cc33723..af49cee 100644
--- a/core/fxge/cfx_folderfontinfo.cpp
+++ b/core/fxge/cfx_folderfontinfo.cpp
@@ -227,11 +227,11 @@
if (names.IsEmpty())
return;
- ByteString facename = GetNameFromTT(names.AsRawSpan(), 1);
+ ByteString facename = GetNameFromTT(names.raw_span(), 1);
if (facename.IsEmpty())
return;
- ByteString style = GetNameFromTT(names.AsRawSpan(), 2);
+ ByteString style = GetNameFromTT(names.raw_span(), 2);
if (style != "Regular")
facename += " " + style;
diff --git a/fpdfsdk/cpdfsdk_interactiveform.cpp b/fpdfsdk/cpdfsdk_interactiveform.cpp
index 2fee643..67fa3e3 100644
--- a/fpdfsdk/cpdfsdk_interactiveform.cpp
+++ b/fpdfsdk/cpdfsdk_interactiveform.cpp
@@ -101,7 +101,7 @@
name = pField->GetUnicodeTextFor("T");
ByteString name_b = name.ToDefANSI();
ByteString csBValue = pField->GetStringFor("V");
- WideString csWValue = PDF_DecodeText(csBValue.AsRawSpan());
+ WideString csWValue = PDF_DecodeText(csBValue.raw_span());
ByteString csValue_b = csWValue.ToDefANSI();
fdfEncodedData << name_b << "=" << csValue_b;
if (i != pFields->size() - 1)
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 3bca040..1274b4a 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -774,7 +774,7 @@
ByteString newValue = PDF_EncodeText(WideStringFromFPDFWideString(value));
auto* pNewApStream = pApDict->SetNewFor<CPDF_Stream>(modeKey);
- pNewApStream->SetData(newValue.AsRawSpan());
+ pNewApStream->SetData(newValue.raw_span());
} else {
if (pApDict) {
if (appearanceMode == FPDF_ANNOT_APPEARANCEMODE_NORMAL)
diff --git a/fpdfsdk/fpdf_attachment.cpp b/fpdfsdk/fpdf_attachment.cpp
index 937b504..8617a98 100644
--- a/fpdfsdk/fpdf_attachment.cpp
+++ b/fpdfsdk/fpdf_attachment.cpp
@@ -32,7 +32,7 @@
ByteString CFXByteStringHexDecode(const ByteString& bsHex) {
std::unique_ptr<uint8_t, FxFreeDeleter> result;
uint32_t size = 0;
- HexDecode(bsHex.AsRawSpan(), &result, &size);
+ HexDecode(bsHex.raw_span(), &result, &size);
return ByteString(result.get(), size);
}
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 470869b..d1a6db7 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -178,7 +178,7 @@
const ByteString& contents) {
CPDF_Stream* pNewContents = pDocument->NewIndirect<CPDF_Stream>(
nullptr, 0, pDocument->New<CPDF_Dictionary>());
- pNewContents->SetData(contents.AsRawSpan());
+ pNewContents->SetData(contents.raw_span());
return pNewContents;
}
@@ -213,7 +213,7 @@
sStream += ByteString(pAcc->GetSpan());
sStream += "\nQ";
}
- pContentsStream->SetDataAndRemoveFilter(sStream.AsRawSpan());
+ pContentsStream->SetDataAndRemoveFilter(sStream.raw_span());
pContentsArray = pDocument->NewIndirect<CPDF_Array>();
pContentsArray->AddNew<CPDF_Reference>(pDocument,
pContentsStream->GetObjNum());
@@ -413,7 +413,7 @@
ByteString str(buf);
sStream += ByteString::Format("q %s cm /%s Do Q\n", str.c_str(),
sFormName.c_str());
- pNewXObject->SetDataAndRemoveFilter(sStream.AsRawSpan());
+ pNewXObject->SetDataAndRemoveFilter(sStream.raw_span());
}
pPageDict->RemoveFor("Annots");
return FLATTEN_SUCCESS;
diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp
index 113d501..e8261a2 100644
--- a/fpdfsdk/fpdf_ppo.cpp
+++ b/fpdfsdk/fpdf_ppo.cpp
@@ -696,7 +696,7 @@
pAcc->LoadAllDataFiltered();
bsSrcContentStream = ByteString(pAcc->GetData(), pAcc->GetSize());
}
- pNewXObject->SetDataAndRemoveFilter(bsSrcContentStream.AsRawSpan());
+ pNewXObject->SetDataAndRemoveFilter(bsSrcContentStream.raw_span());
}
// TODO(xlou): A better name schema to avoid possible object name collision.
@@ -727,7 +727,7 @@
auto pDict = dest()->New<CPDF_Dictionary>();
CPDF_Stream* pStream =
dest()->NewIndirect<CPDF_Stream>(nullptr, 0, std::move(pDict));
- pStream->SetData(bsContent.AsRawSpan());
+ pStream->SetData(bsContent.raw_span());
pDestPageDict->SetNewFor<CPDF_Reference>(pdfium::page_object::kContents,
dest(), pStream->GetObjNum());
}
diff --git a/fpdfsdk/pwl/cpwl_appstream.cpp b/fpdfsdk/pwl/cpwl_appstream.cpp
index c7f4ff7..261b274 100644
--- a/fpdfsdk/pwl/cpwl_appstream.cpp
+++ b/fpdfsdk/pwl/cpwl_appstream.cpp
@@ -1937,7 +1937,7 @@
}
pStreamDict->SetMatrixFor("Matrix", widget_->GetMatrix());
pStreamDict->SetRectFor("BBox", widget_->GetRotatedRect());
- pStream->SetDataAndRemoveFilter(sContents.AsRawSpan());
+ pStream->SetDataAndRemoveFilter(sContents.raw_span());
}
void CPWL_AppStream::Remove(const ByteString& sAPType) {
diff --git a/fxjs/fx_date_helpers.cpp b/fxjs/fx_date_helpers.cpp
index fbef23e..00b50cc 100644
--- a/fxjs/fx_date_helpers.cpp
+++ b/fxjs/fx_date_helpers.cpp
@@ -166,7 +166,7 @@
}
size_t FindSubWordLength(const WideString& str, size_t nStart) {
- pdfium::span<const wchar_t> data = str.AsSpan();
+ pdfium::span<const wchar_t> data = str.span();
size_t i = nStart;
while (i < data.size() && std::iswalnum(data[i]))
++i;
diff --git a/xfa/fgas/crt/cfgas_stringformatter.cpp b/xfa/fgas/crt/cfgas_stringformatter.cpp
index 9169820..4344fd5 100644
--- a/xfa/fgas/crt/cfgas_stringformatter.cpp
+++ b/xfa/fgas/crt/cfgas_stringformatter.cpp
@@ -191,8 +191,8 @@
bool GetNumericDotIndex(const WideString& wsNum,
const WideString& wsDotSymbol,
size_t* iDotIndex) {
- pdfium::span<const wchar_t> spNum = wsNum.AsSpan();
- pdfium::span<const wchar_t> spDotSymbol = wsDotSymbol.AsSpan();
+ pdfium::span<const wchar_t> spNum = wsNum.span();
+ pdfium::span<const wchar_t> spDotSymbol = wsDotSymbol.span();
for (size_t ccf = 0; ccf < spNum.size(); ++ccf) {
if (spNum[ccf] == '\'') {
GetLiteralText(spNum, &ccf);
@@ -240,8 +240,8 @@
uint32_t month = 1;
uint32_t day = 1;
size_t ccf = 0;
- pdfium::span<const wchar_t> spDate = wsDate.AsSpan();
- pdfium::span<const wchar_t> spDatePattern = wsDatePattern.AsSpan();
+ pdfium::span<const wchar_t> spDate = wsDate.span();
+ pdfium::span<const wchar_t> spDatePattern = wsDatePattern.span();
while (*cc < spDate.size() && ccf < spDatePattern.size()) {
if (spDatePattern[ccf] == '\'') {
WideString wsLiteral = GetLiteralText(spDatePattern, &ccf);
@@ -360,8 +360,8 @@
uint32_t second = 0;
uint32_t millisecond = 0;
size_t ccf = 0;
- pdfium::span<const wchar_t> spTime = wsTime.AsSpan();
- pdfium::span<const wchar_t> spTimePattern = wsTimePattern.AsSpan();
+ pdfium::span<const wchar_t> spTime = wsTime.span();
+ pdfium::span<const wchar_t> spTimePattern = wsTimePattern.span();
bool bHasA = false;
bool bPM = false;
while (*cc < spTime.size() && ccf < spTimePattern.size()) {
@@ -491,7 +491,7 @@
size_t GetNumTrailingLimit(const WideString& wsFormat,
size_t iDotPos,
bool* bTrimTailZeros) {
- const pdfium::span<const wchar_t> spFormat = wsFormat.AsSpan();
+ const pdfium::span<const wchar_t> spFormat = wsFormat.span();
size_t iTrailing = 0;
for (++iDotPos; iDotPos < spFormat.size(); ++iDotPos) {
wchar_t wc = spFormat[iDotPos];
@@ -571,7 +571,7 @@
uint8_t month = datetime.GetMonth();
uint8_t day = datetime.GetDay();
size_t ccf = 0;
- pdfium::span<const wchar_t> spDatePattern = wsDatePattern.AsSpan();
+ pdfium::span<const wchar_t> spDatePattern = wsDatePattern.span();
while (ccf < spDatePattern.size()) {
if (spDatePattern[ccf] == '\'') {
wsResult += GetLiteralText(spDatePattern, &ccf);
@@ -632,7 +632,7 @@
uint8_t second = datetime.GetSecond();
uint16_t millisecond = datetime.GetMillisecond();
size_t ccf = 0;
- pdfium::span<const wchar_t> spTimePattern = wsTimePattern.AsSpan();
+ pdfium::span<const wchar_t> spTimePattern = wsTimePattern.span();
uint16_t wHour = hour;
bool bPM = false;
if (wsTimePattern.Contains('A')) {
@@ -824,7 +824,7 @@
const WideString& wsPattern)
: m_pLocaleMgr(pLocaleMgr),
m_wsPattern(wsPattern),
- m_spPattern(m_wsPattern.AsSpan()) {}
+ m_spPattern(m_wsPattern.span()) {}
CFGAS_StringFormatter::~CFGAS_StringFormatter() = default;
@@ -832,7 +832,7 @@
std::vector<WideString> CFGAS_StringFormatter::SplitOnBars(
const WideString& wsFormatString) {
std::vector<WideString> wsPatterns;
- pdfium::span<const wchar_t> spFormatString = wsFormatString.AsSpan();
+ pdfium::span<const wchar_t> spFormatString = wsFormatString.span();
size_t index = 0;
size_t token = 0;
bool bQuote = false;
@@ -1058,8 +1058,8 @@
if (wsTextFormat.IsEmpty())
return false;
- pdfium::span<const wchar_t> spSrcText = wsSrcText.AsSpan();
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spSrcText = wsSrcText.span();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
size_t iText = 0;
size_t iPattern = 0;
@@ -1140,8 +1140,8 @@
WideString wsMinus = pLocale->GetMinusSymbol();
int32_t iMinusLen = wsMinus.GetLength();
- pdfium::span<const wchar_t> spSrcNum = wsSrcNum.AsSpan();
- pdfium::span<const wchar_t> spNumFormat = wsNumFormat.AsSpan();
+ pdfium::span<const wchar_t> spSrcNum = wsSrcNum.span();
+ pdfium::span<const wchar_t> spNumFormat = wsNumFormat.span();
bool bHavePercentSymbol = false;
bool bNeg = false;
@@ -1717,8 +1717,8 @@
bool CFGAS_StringFormatter::ParseZero(const WideString& wsSrcText) const {
WideString wsTextFormat = GetTextFormat(L"zero");
- pdfium::span<const wchar_t> spSrcText = wsSrcText.AsSpan();
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spSrcText = wsSrcText.span();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
size_t iText = 0;
size_t iPattern = 0;
@@ -1745,8 +1745,8 @@
bool CFGAS_StringFormatter::ParseNull(const WideString& wsSrcText) const {
WideString wsTextFormat = GetTextFormat(L"null");
- pdfium::span<const wchar_t> spSrcText = wsSrcText.AsSpan();
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spSrcText = wsSrcText.span();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
size_t iText = 0;
size_t iPattern = 0;
@@ -1777,8 +1777,8 @@
return false;
WideString wsTextFormat = GetTextFormat(L"text");
- pdfium::span<const wchar_t> spSrcText = wsSrcText.AsSpan();
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spSrcText = wsSrcText.span();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
size_t iText = 0;
size_t iPattern = 0;
@@ -1842,7 +1842,7 @@
if (!pLocale || wsNumFormat.IsEmpty())
return false;
- pdfium::span<const wchar_t> spNumFormat = wsNumFormat.AsSpan();
+ pdfium::span<const wchar_t> spNumFormat = wsNumFormat.span();
WideString wsSrcNum = wsInputNum;
wsSrcNum.TrimLeft('0');
if (wsSrcNum.IsEmpty() || wsSrcNum[0] == '.')
@@ -1919,7 +1919,7 @@
}
bool bAddNeg = false;
- pdfium::span<const wchar_t> spSrcNum = wsSrcNum.AsSpan();
+ pdfium::span<const wchar_t> spSrcNum = wsSrcNum.span();
auto dot_index = wsSrcNum.Find('.');
if (!dot_index.has_value())
dot_index = spSrcNum.size();
@@ -2202,22 +2202,22 @@
auto iT = wsSrcDateTime.Find(L"T");
if (!iT.has_value()) {
if (eCategory == FX_DATETIMETYPE_Date &&
- FX_DateFromCanonical(wsSrcDateTime.AsSpan(), &dt)) {
+ FX_DateFromCanonical(wsSrcDateTime.span(), &dt)) {
*wsOutput = FormatDateTimeInternal(dt, wsDatePattern, wsTimePattern, true,
pLocale);
return true;
}
if (eCategory == FX_DATETIMETYPE_Time &&
- FX_TimeFromCanonical(pLocale, wsSrcDateTime.AsSpan(), &dt)) {
+ FX_TimeFromCanonical(pLocale, wsSrcDateTime.span(), &dt)) {
*wsOutput = FormatDateTimeInternal(dt, wsDatePattern, wsTimePattern, true,
pLocale);
return true;
}
} else {
pdfium::span<const wchar_t> wsSrcDate =
- wsSrcDateTime.AsSpan().first(iT.value());
+ wsSrcDateTime.span().first(iT.value());
pdfium::span<const wchar_t> wsSrcTime =
- wsSrcDateTime.AsSpan().subspan(iT.value() + 1);
+ wsSrcDateTime.span().subspan(iT.value() + 1);
if (wsSrcDate.empty() || wsSrcTime.empty())
return false;
@@ -2237,7 +2237,7 @@
return false;
WideString wsTextFormat = GetTextFormat(L"zero");
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
for (size_t iPattern = 0; iPattern < spTextFormat.size(); ++iPattern) {
if (spTextFormat[iPattern] == '\'') {
*wsOutput += GetLiteralText(spTextFormat, &iPattern);
@@ -2253,7 +2253,7 @@
return false;
WideString wsTextFormat = GetTextFormat(L"null");
- pdfium::span<const wchar_t> spTextFormat = wsTextFormat.AsSpan();
+ pdfium::span<const wchar_t> spTextFormat = wsTextFormat.span();
for (size_t iPattern = 0; iPattern < spTextFormat.size(); ++iPattern) {
if (spTextFormat[iPattern] == '\'') {
*wsOutput += GetLiteralText(spTextFormat, &iPattern);
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp
index 53a5858..2acc820 100644
--- a/xfa/fxfa/cxfa_textparser.cpp
+++ b/xfa/fxfa/cxfa_textparser.cpp
@@ -554,7 +554,7 @@
return false;
}
- pdfium::span<const wchar_t> spTabStops = wsValue.AsSpan();
+ pdfium::span<const wchar_t> spTabStops = wsValue.span();
size_t iCur = 0;
size_t iLast = 0;
WideString wsAlign;
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
index e760b5a..866cbdf 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
@@ -1165,7 +1165,7 @@
WideString wsColumnWidths =
pLayoutNode->JSObject()->GetCData(XFA_Attribute::ColumnWidths);
if (!wsColumnWidths.IsEmpty()) {
- for (auto& width : SeparateStringOnSpace(wsColumnWidths.AsSpan())) {
+ for (auto& width : SeparateStringOnSpace(wsColumnWidths.span())) {
width.TrimLeft(L' ');
if (width.IsEmpty())
continue;
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index ea986d2..da3cfce 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -247,8 +247,7 @@
}
CFX_XMLNode* CXFA_DocumentParser::ParseXMLData(const ByteString& wsXML) {
- auto pStream =
- pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(wsXML.AsRawSpan());
+ auto pStream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(wsXML.raw_span());
xml_doc_ = LoadXML(pStream);
if (!xml_doc_)
return nullptr;
diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp
index 047ead8..688d136 100644
--- a/xfa/fxfa/parser/cxfa_localevalue.cpp
+++ b/xfa/fxfa/parser/cxfa_localevalue.cpp
@@ -216,7 +216,7 @@
return CFX_DateTime();
CFX_DateTime dt;
- FX_DateFromCanonical(m_wsValue.AsSpan(), &dt);
+ FX_DateFromCanonical(m_wsValue.span(), &dt);
return dt;
}
@@ -225,7 +225,7 @@
return CFX_DateTime();
CFX_DateTime dt;
- FX_TimeFromCanonical(m_pLocaleMgr->GetDefLocale(), m_wsValue.AsSpan(), &dt);
+ FX_TimeFromCanonical(m_pLocaleMgr->GetDefLocale(), m_wsValue.span(), &dt);
return dt;
}
@@ -369,7 +369,7 @@
static const uint16_t wCountY = 4;
static const uint16_t wCountM = 2;
static const uint16_t wCountD = 2;
- pdfium::span<const wchar_t> spDate = wsDate.AsSpan();
+ pdfium::span<const wchar_t> spDate = wsDate.span();
if (spDate.size() < wCountY ||
spDate.size() > wCountY + wCountM + wCountD + 2) {
return false;
@@ -442,7 +442,7 @@
}
bool CXFA_LocaleValue::ValidateCanonicalTime(const WideString& wsTime) {
- pdfium::span<const wchar_t> spTime = wsTime.AsSpan();
+ pdfium::span<const wchar_t> spTime = wsTime.span();
if (spTime.size() < 2)
return false;
@@ -658,8 +658,8 @@
if (wsFormat.IsEmpty() || wsNumeric.IsEmpty())
return true;
- pdfium::span<const wchar_t> spNum = wsNumeric.AsSpan();
- pdfium::span<const wchar_t> spFmt = wsFormat.AsSpan();
+ pdfium::span<const wchar_t> spNum = wsNumeric.span();
+ pdfium::span<const wchar_t> spFmt = wsFormat.span();
int32_t n = 0;
int32_t nf = 0;
wchar_t c = spNum[n];
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index e66bd80..8204849 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -402,7 +402,7 @@
if (bsStr.IsEmpty())
return result;
- std::vector<uint8_t> buffer = XFA_RemoveBase64Whitespace(bsStr.AsRawSpan());
+ std::vector<uint8_t> buffer = XFA_RemoveBase64Whitespace(bsStr.raw_span());
result.reserve(3 * (buffer.size() / 4));
uint32_t dwLimb = 0;
@@ -488,7 +488,7 @@
} else {
bsData = wsImage.ToDefANSI();
pImageFileRead =
- pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(bsData.AsRawSpan());
+ pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(bsData.raw_span());
}
} else {
WideString wsURL = wsHref;