summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_string.h
AgeCommit message (Collapse)Author
2016-03-14Fix offset outside bounds warning on GCCTom Sepez
Alterntive to part of https://codereview.chromium.org/1785943002/ BUG=589724 R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1802553004 .
2016-03-11Re-enable MSVC warning 4800 for compiling with chromium_codeWei Li
Mainly change the code to avoid the warnings; in a few cases we have to use explicit casts. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1783023002 .
2016-02-19Get rid of CFX_CharMap instantiations.Lei Zhang
The only thing left are a couple of static methods. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1711273002 .
2016-02-19Remove CFX_{Byte,Wide}String::ConvertFrom().Lei Zhang
Use/add CFX_{Byte,Wide}String::FromFoo() instead. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1711893003 .
2016-02-17Expand all paths to be based off pdfium/ directoryDan Sinclair
This CL runs a script over the source and updates the include files to be a full path from the pdfium/ directory. BUG=pdfium:65 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1707923002 .
2016-01-20Merge to XFA: Bugs in CJS_PublicMethods::ParseNumber().Tom Sepez
Original Review URL: https://codereview.chromium.org/1586203006 . (cherry picked from commit f13d510cf267c27f4c123494de67670ec201cedc) BUG=pdfium:361 R=ochang@chromium.org TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1603173004 .
2015-12-14Merge to XFA: Remove FX_BSTRC.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 .
2015-08-04XFA: clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-06-13Merge to XFA: Cleanup: Remove uses of "this->" in core/Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1173223002. (cherry picked from commit 2b5e0d5b20654d116045484868c9e015ed698124) Review URL: https://codereview.chromium.org/1186673004.
2015-06-11Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp follwed by scripts. Original Review URL: https://codereview.chromium.org/1179693003. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1179953002.
2015-06-10Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.Tom Sepez
Nearly automatic merge + re-run script on new files. Original Review URL: https://codereview.chromium.org/1180593004. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1174303002.
2015-06-10Merge to XFA: Remove typdefs for pointer types in fx_system.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
2015-06-09Merge to XFA: Use stdint.h types throughout PDFium.Tom Sepez
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
2015-06-05Merge to XFA: Add move constructor for FX string types.Tom Sepez
Original Review URL: https://codereview.chromium.org/1162203007 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1154023005
2015-05-28Merge to XFA: Fix ALL the include guards.Tom Sepez
Original Review URL: https://codereview.chromium.org/1160443004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1162013003
2015-05-15Merge to XFA: Fix potential UAF in ConcatInPlace.Tom Sepez
Original Review URL: https://codereview.chromium.org/1130763007 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1123333004
2015-05-14Merge to XFA: Make CFX_StringData be scoped by CFX_Bytestring and add methods.Tom Sepez
Original Review URL: https://codereview.chromium.org/1142533002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1135673003
2015-05-06Merge to XFA:Remove FX_STRSIZE casts, use safe conversionsTom Sepez
Original Review URL: https://codereview.chromium.org/1124043003 BUG=pdfium:153 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1132443002
2015-05-06Merge to XFA: Fix fx_string.h compile error under chromium checkouts.Tom Sepez
Original Review URL: https://codereview.chromium.org/1127043004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1131553005
2015-05-05Merge to XFA: Make sure string constructors are efficient on literalsTom Sepez
Besides the merge, there's one place where a wchar vs. wstring comparison was being made that no longer compiled. Original Review URL: https://codereview.chromium.org/1117263004 BUG=pdfium:151 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1116163003
2015-05-04Merge to XFA: Fix issues with != and == in fx_basic_wstringTom Sepez
Original Review URL: https://codereview.chromium.org/1127753002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1119753004
2015-05-04Merge to XFA: Fix issuse with != and == shown by fx_basic_bstring unit tests.Tom Sepez
Original Review URL: https://codereview.chromium.org/1125703004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1126643003
2015-05-01Merge to XFA: Backfill some FX String/StringC unit tests for == and !=.Tom Sepez
Original Review URL: https://codereview.chromium.org/1118973005 Original Review URL: https://codereview.chromium.org/1122573002 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1126433002
2015-05-01Merge to XFA: CFX_ByteString/WideString header changesTom Sepez
Original Review URL: https://codereview.chromium.org/1117413002 Original Review URL: https://codereview.chromium.org/1118983003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1125493002
2015-04-28Merge to XFA: Make CFX_WideString::LockBuffer() completely unused.Tom Sepez
Original Review URL: https://codereview.chromium.org/1053613004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1115493002
2015-04-22Merge to XFA: Add missing operators for CFX_xxxString combo patch.Tom Sepez
This pulls in: Review URL: https://codereview.chromium.org/1099193002 Review URL: https://codereview.chromium.org/1090303003 Review URL: https://codereview.chromium.org/1084293003 Review URL: https://codereview.chromium.org/1099213002 Plus one fix to an XFA file to fix compilation. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1095893005
2015-04-21Merge to XFA: Kill CFX_StringBufTemplate.Tom Sepez
Original Review URL: https://codereview.chromium.org/1098203002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1080633008
2015-04-14Merge to XFA: Kill CFX_Object.Tom Sepez
Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002
2015-04-06Merge to XFA: Fix IWYU in fxcrt headers.Tom Sepez
Note: new includes for XFA Original Review URL: https://codereview.chromium.org/1064433005 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1062843003
2015-02-05Merge to XFA: Kill off some more unreachable fopen's.Tom Sepez
Original Review URL: https://codereview.chromium.org/902943003 TBR=jam@chromium.org Review URL: https://codereview.chromium.org/895903005
2015-01-21Merge to XFA: Simplify UTF16LE_Encode and add unittest.Bo Xu
Previously, UTF16LE_Encode take an optional flag to indicate if the returned byte string has trailing zeros. In fact, no where needs the flag to be false. So just get rid of it so callers won't misuse. The bug is found by https://codereview.chromium.org/837723009 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/860973002
2015-01-07Merge to XFA: Finish unit test for CFX_ByteStringC class.Tom Sepez
Original CL at https://codereview.chromium.org/808553013 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/837253002
2015-01-07Merge to XFA: Add ostream helpers for FX String classes.Tom Sepez
Original CL at https://codereview.chromium.org/837843002 TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/809313008
2015-01-05XFA: merge patch from CL 729293003, use FX_ArraySize for safetyBruce Dawson
Note that the merge of this fix to XFA found six bugs. Five were fixed in https://codereview.chromium.org/826573003 and one was fixed in https://codereview.chromium.org/831293002. These bugs are now impossible to compile. Replace manual/error-prone/hard-to-verify arraysize calculations with safe FX_ArraySize macro. pdfium has numerous places where the number of elements in an array is calculated with expressions like: sizeof(cFormats)/sizeof(FX_LPCWSTR) This is suboptimal because it is verbose, it is easy to get wrong, and it cannot be determined through casual inspection whether the code is correct. It will give incorrect results if cFormats is a pointer instead of an array and it will give incorrect results if FX_LPCWSTR is not the type of the array elements. The FX_WSTRC macro in fx_string.h which I fixed was particularly scary because it would silently misbehave if passed a pointer. The FX_ArraySize macro which I have added and started using (taken from arraysize in v8's macros.h) is easier to use and will always give correct results. If passed a pointer it will fail to compile. For this change I only fixed instances of sizeof(FX_LPCWSTR). There appear to be about 150 other places in the pdfium code that could benefit from using FX_ArraySize. TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/818193004
2014-12-30XFA: merge patch from CL 733693003, get rid of FX_LPCSTR castBo Xu
Get rid of FX_LPCSTR cast. Follow up on https://codereview.chromium.org/733693003 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/809993004
2014-12-23XFA: merge patch from CL 733693003, getting rid of more castsBruce Dawson
Getting rid of more (FX_LPCWSTR) casts and fixing two bugs revealed by this. Since casts to FX_LPCWSTR have been shown to hide bugs I tried removing more of them, targeting those places where a cast was used to force a conversion from CFX_WideString to FX_LPCWSTR, replacing these casts with calls to the newly added .c_str() function. This revealed two places where the cast was hiding a bug -- where ->c_str() was required instead! This removes ~33 FX_LPCWSTR casts and there are ~31 left, many of which will go away in some future change. Also includes this change: Removing unnecessary casts from wchar_t* to wchar_t*, by various names. Original patch from Bruce Dawson(brucedawson@chromium.org) TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/811593007
2014-11-17Merge to XFA: patch from CL 730993002Bo Xu
2014-07-14Fix an out-of-boundary issue for wide stringBo Xu
BUG=381521 R=palmer@chromium.org Review URL: https://codereview.chromium.org/383563002
2014-07-08Remove custom memory managerBo Xu
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
2014-07-08Fix integer overflow in fx_basic_[bw]string.cpp.Chris Palmer
BUG=382601 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/336003004
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek