summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/fpdf_parser_utility.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /core/fpdfapi/parser/fpdf_parser_utility.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz
Convert string class names
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/fpdf_parser_utility.cpp')
-rw-r--r--core/fpdfapi/parser/fpdf_parser_utility.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_utility.cpp b/core/fpdfapi/parser/fpdf_parser_utility.cpp
index c6487f55a0..82804528ab 100644
--- a/core/fpdfapi/parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/parser/fpdf_parser_utility.cpp
@@ -84,17 +84,17 @@ int32_t GetHeaderOffset(const CFX_RetainPtr<IFX_SeekableReadStream>& pFile) {
return kInvalidHeaderOffset;
}
-int32_t GetDirectInteger(CPDF_Dictionary* pDict, const CFX_ByteString& key) {
+int32_t GetDirectInteger(CPDF_Dictionary* pDict, const ByteString& key) {
CPDF_Number* pObj = ToNumber(pDict->GetObjectFor(key));
return pObj ? pObj->GetInteger() : 0;
}
-CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
+ByteString PDF_NameDecode(const ByteStringView& bstr) {
if (!bstr.Contains('#'))
- return CFX_ByteString(bstr);
+ return ByteString(bstr);
int size = bstr.GetLength();
- CFX_ByteString result;
+ ByteString result;
char* pDestStart = result.GetBuffer(size);
char* pDest = pDestStart;
for (int i = 0; i < size; i++) {
@@ -110,11 +110,11 @@ CFX_ByteString PDF_NameDecode(const CFX_ByteStringC& bstr) {
return result;
}
-CFX_ByteString PDF_NameDecode(const CFX_ByteString& orig) {
- return orig.Contains("#") ? PDF_NameDecode(orig.AsStringC()) : orig;
+ByteString PDF_NameDecode(const ByteString& orig) {
+ return orig.Contains("#") ? PDF_NameDecode(orig.AsStringView()) : orig;
}
-CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) {
+ByteString PDF_NameEncode(const ByteString& orig) {
uint8_t* src_buf = (uint8_t*)orig.c_str();
int src_len = orig.GetLength();
int dest_len = 0;
@@ -131,7 +131,7 @@ CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig) {
if (dest_len == src_len)
return orig;
- CFX_ByteString res;
+ ByteString res;
char* dest_buf = res.GetBuffer(dest_len);
dest_len = 0;
for (i = 0; i < src_len; i++) {
@@ -167,7 +167,7 @@ std::ostream& operator<<(std::ostream& buf, const CPDF_Object* pObj) {
buf << PDF_EncodeString(pObj->GetString(), pObj->AsString()->IsHex());
break;
case CPDF_Object::NAME: {
- CFX_ByteString str = pObj->GetString();
+ ByteString str = pObj->GetString();
buf << "/" << PDF_NameEncode(str);
break;
}
@@ -193,7 +193,7 @@ std::ostream& operator<<(std::ostream& buf, const CPDF_Object* pObj) {
const CPDF_Dictionary* p = pObj->AsDictionary();
buf << "<<";
for (const auto& it : *p) {
- const CFX_ByteString& key = it.first;
+ const ByteString& key = it.first;
CPDF_Object* pValue = it.second.get();
buf << "/" << PDF_NameEncode(key);
if (pValue && !pValue->IsInline()) {