summaryrefslogtreecommitdiff
path: root/absl/strings
Commit message (Collapse)AuthorAge
...
* | Clarify that Base64 unescaping methods expect their inputs to match ↵Gravatar Abseil Team2023-01-09
| | | | | | | | | | | | | | particular RFC specifications. PiperOrigin-RevId: 500809781 Change-Id: I34d089343321f7658db8252ad29ff1824e6dbef2
* | Refactor InlineData to allow for memory sanitizer changes step 1Gravatar Martijn Vels2023-01-09
| | | | | | | | | | PiperOrigin-RevId: 500765473 Change-Id: Iaa3f9fdee6c9f4322bc8995b0d381cf1c8cb1349
* | Use "#if GTEST_HAS_DEATH_TEST" instead of "#ifdef GTEST_HAS_DEATH_TEST"Gravatar Tom Hughes2023-01-09
| | | | | | | | | | | | | | | | This is consistent with the rest of the GTEST_HAS_DEATH usages in the code and the example in gtest-port.h. PiperOrigin-RevId: 500740093 Change-Id: I2acc158116b0e8bccc8ab45d75c8059828a4c251
* | Move description of escaping to code that does the escaping rather than the ↵Gravatar Abseil Team2023-01-05
| | | | | | | | | | | | | | | | | | CalculateBase64EscapedLenInternal helper method. Note that output padding is conditional on do_padding. PiperOrigin-RevId: 499901986 Change-Id: I8c1d28fe372b3e0e2216654db83f949caa297892
* | Replace ABSL_INTERNAL_UNREACHABLE with ABSL_UNREACHABLE()Gravatar Derek Mauro2022-12-22
| | | | | | | | | | PiperOrigin-RevId: 497197704 Change-Id: I3865a874e04f6f55a1ab374b03451535a86bc5a3
* | Remove obsolete RFC 3548 from escaping.cc's Base64UnescapeInternal. (Note ↵Gravatar Abseil Team2022-12-12
| | | | | | | | | | | | | | that the proper non-obsolete RFC 4648 is already listed in escaping.h's Base64Escape() documentation) PiperOrigin-RevId: 494821805 Change-Id: Id3bffcb968a7c865c9a6bcbf241870c3674601ba
* | Allow Cord to store chunked checksumsGravatar Derek Mauro2022-12-11
| | | | | | | | | | PiperOrigin-RevId: 494587777 Change-Id: I41504edca6fcf750d52602fa84a33bc7fe5fbb48
* | Fixes issue where AbslStringify() breaks formatting with %d for enumsGravatar Phoebe Liang2022-12-07
| | | | | | | | | | PiperOrigin-RevId: 493682437 Change-Id: I30f2ac36b998b86c24fe7513cd952b860560a66e
* | Remove possible UB from CopyRaw()Gravatar Martijn Vels2022-12-07
| | | | | | | | | | | | | | This change removes the 'create by single memcpy' CopyRaw() logic to avoid potential UB from the atomic refcount data being included in the memcpy. While we know this works on all supported platforms, it is officially UB, and we should change it to something else. This change changes the CopyRaw() method to explicitly create a (default initialized) instance, initialize `length` and `refcount`, and then memcpy the remaining contents which are trivial uint8_t and CordRep* values. PiperOrigin-RevId: 493596072 Change-Id: I46618883eb1c7c9ed9eb083f4d3e7fc501f23df5
* | Add AbslStringify support for enum types in Substitute.Gravatar Abseil Team2022-12-02
| | | | | | | | | | PiperOrigin-RevId: 492481345 Change-Id: Ie77656ed334b54930ee852d31e2794a1fc58ce2f
* | Use a c++14-style constexpr initialization if c++14 constexpr is available.Gravatar Jorg Brown2022-12-02
| | | | | | | | | | PiperOrigin-RevId: 492463896 Change-Id: I063759ca5ceb3597a7c8ab25af23aa688dee26c2
* | Reorder base64 unescape methods to be below the escaping methods.Gravatar Abseil Team2022-11-30
| | | | | | | | | | PiperOrigin-RevId: 491992941 Change-Id: Id66154cc4561770047b55625ef00014602975c5d
* | Convert the full parser into constexpr now that Abseil requires C++14, and useGravatar Samuel Benzaquen2022-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | this parser for the static checker. This fixes some outstanding bugs where the static checker differed from the dynamic one. Also, fix `%v` to be accepted with POSIX syntax. Tested: Presubmit TGP OCL:487237262:BASE:490275393:1669141454896:92dd62e3 PiperOrigin-RevId: 491650577 Change-Id: Id138c108187428b3aea46f8887495f1da12c91b2
* | Removing trailing period that can confuse a url in str_format.h.Gravatar Abseil Team2022-11-22
| | | | | | | | | | PiperOrigin-RevId: 490329293 Change-Id: Ied36e737e85afc683cc7cc116ac6bc07092472df
* | Document the WebSafe* and *WithPadding variants more concisely, as deltas ↵Gravatar Abseil Team2022-11-21
| | | | | | | | | | | | | | | | | | | | | | from Base64Encode. Also: * Clarify that padding refers to ‘output’ padding * Make CalculateBase64EscapedLen() a bit more discoverable * Reference all relevant non-obsolete RFCs (2045 as well as 4648) PiperOrigin-RevId: 489981278 Change-Id: I27365ea5d52bfdb0c9d02ed96d05b4a60f2dc36f
* | Updated documentation on use of %vGravatar Tom Manshreck2022-11-15
| | | | | | | | | | | | | | Also updated documentation around FormatSink and PutPaddedString PiperOrigin-RevId: 488651398 Change-Id: Ic6c586dbb8bea61df841a142f12d22c7e5b03f43
* | Add support for enum types with AbslStringifyGravatar Abseil Team2022-11-09
| | | | | | | | | | PiperOrigin-RevId: 487394692 Change-Id: I55e9b57055483dc921e9773c3643ea9be4f9bdf6
* | Support logging of user-defined types that implement `AbslStringify()`Gravatar Phoebe Liang2022-11-02
| | | | | | | | | | | | | | | | | | If a user-defined type has `AbslStringify()` defined, it will always be used for logging over `operator<<`. `HasAbslStringify` now uses the empty class `UnimplementedSink` for its checks instead of `StringifySink` in order to make it work in cases involving other sinks. PiperOrigin-RevId: 485710377 Change-Id: Ibdd916151c7abc3269c35fbe79b772867f3d25e1
* | Fix -Wimplicit-int-conversion.Gravatar Abseil Team2022-11-02
| | | | | | | | | | PiperOrigin-RevId: 485575914 Change-Id: If1752252e3cc2f91dc3c171382c9fb3a4def0377
* | Cord: Avoid leaking a node if SetExpectedChecksum() is called on anGravatar Derek Mauro2022-11-01
| | | | | | | | | | | | | | empty cord twice in a row. PiperOrigin-RevId: 485367641 Change-Id: I6605ff25acbcef7c40b68e15a8888076a2da63be
* | Support empty Cords with an expected checksumGravatar Derek Mauro2022-10-28
| | | | | | | | | | PiperOrigin-RevId: 484578104 Change-Id: Ie4be3e4de27dc28d88395e16fd075fb10ab7a302
* | Move internal details from one source file to another more appropriate sourceGravatar Andy Soffer2022-10-27
| | | | | | | | | | | | | | file. PiperOrigin-RevId: 484419458 Change-Id: Ic2c1afa1a3434ac071c01ae2e6c75dee41b1f069
* | Removes `PutPaddedString()` functionGravatar Phoebe Liang2022-10-27
| | | | | | | | | | | | | | This function is unnecessary as it was originally used to support modifiers with `absl::StrFormat()`. This functionality is irrelevant to `absl::StrCat()`. PiperOrigin-RevId: 484339246 Change-Id: I8c4a0ee01b30aee7a83f6ab54e5465465cc9cc56
* | Return uint8_t from CappedDamerauLevenshteinDistance.Gravatar Abseil Team2022-10-27
| | | | | | | | | | PiperOrigin-RevId: 484181180 Change-Id: I00206c1506a25dca5555261d6500c1e54368a368
* | Document Base64Unescape() paddingGravatar Abseil Team2022-10-21
| | | | | | | | | | PiperOrigin-RevId: 482905442 Change-Id: Ic3a1e62f8a17efee5508d94835635aa489940f2d
* | Fix a sign conversion warning.Gravatar Abseil Team2022-10-19
| | | | | | | | | | | | Bug: chromium:1292951 PiperOrigin-RevId: 482287305 Change-Id: I896033c7c8b2645eacab974c4364c6ba66d38cb6
* | Implement function to calculate Damerau-Levenshtein distance between two ↵Gravatar Abseil Team2022-10-17
| | | | | | | | | | | | | | strings. PiperOrigin-RevId: 481568970 Change-Id: Icb132348f62fed4c0168aac4963b3313a060890b
* | Support stringification of user-defined types in AbslStringify in ↵Gravatar Andy Soffer2022-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | absl::Substitute. We are also moving some internals into an internal header. `HasAbslStringify` was not previously in an internal namespace but was intended to be and has now been moved to an internal namespace. This is in adherence to our compatibility guidelines which wave requirements for APIs within their first 30 days of public release (See https://abseil.io/about/compatibility for details). PiperOrigin-RevId: 481190705 Change-Id: I4c0c348f269ea8d76ea3d4bd5a2c41cce475dc04
* | Fix "unsafe narrowing" warnings in absl, 12/12.Gravatar Abseil Team2022-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses failures with the following, in some files: -Wshorten-64-to-32 -Wimplicit-int-conversion -Wsign-compare -Wsign-conversion -Wtautological-unsigned-zero-compare (This specific CL enables these warnings and fixes the remaining known issues.) Bug: chromium:1292951 PiperOrigin-RevId: 480981210 Change-Id: I92d5023c6833e24d6aa29b10d433116329972f41
* | Revert change to internal 'Rep', this causes issues for gdbGravatar Martijn Vels2022-10-13
| | | | | | | | | | PiperOrigin-RevId: 480945608 Change-Id: I3e90a105c793deee02fbef322946bf7d5340dc78
* | Reorganize InlineData into an inner Rep structure.Gravatar Martijn Vels2022-10-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves inlined code around a bit without changing anything bar the names of things. The purpose for all this is that it greatly simplifies the process of adding memory poisining to Cord / InlineData. InlineData can have scoped poison / unpoison regions around the interface, calling into rep for the 'real code'. I.e.: Rep::as_chars() { return &inline_data[1]; } InlineData::as_chars() { Unpoisoned self(this); return rep_.as_chars(); } Likewise, it greatly simplifies intercepting the code for constructors, copy constructors and operator= logic. PiperOrigin-RevId: 480893031 Change-Id: I050c88caff2315939d95a0361ae20528be36a96b
* | Change Cord internal layout, which reduces store-load penalties on ARMGravatar Martijn Vels2022-10-11
| | | | | | | | | | PiperOrigin-RevId: 480511524 Change-Id: I73945b1150a2e2e75774684fb8e7364f9c1290a7
* | Fix a bug in StrFormat. This issue would have been caught by any compile-timeGravatar Andy Soffer2022-10-10
| | | | | | | | | | | | | | | | | | checking but can happen for incorrect formats parsed via ParsedFormat::New. Specifically, if a user were to add length modifiers with 'v', for example the incorrect format string "%hv", the ParsedFormat would incorrectly be allowed. PiperOrigin-RevId: 480183817 Change-Id: I8510c13189fdf807cdaa7f2e1b7ed9fba2aaefb9
* | Adds documentation for stringification extensionGravatar Abseil Team2022-10-10
| | | | | | | | | | PiperOrigin-RevId: 480166410 Change-Id: Ie915e98747ffda0d1f0e5a72383f5dd9fc940970
| * Update charconv.ccGravatar Randolf J2022-10-07
|/
* Add clang < 7 to conditionsGravatar Randolf J2022-10-05
|
* Merge branch 'abseil:master' into patch-1Gravatar Randolf J2022-10-05
|\
| * Make sinks provided to `AbslStringify()` usable with `absl::Format()`.Gravatar Marcin Kowalczyk2022-10-05
| | | | | | | | | | | | | | | | Such sinks must define ADL-callable `AbslFormatFlush()`. It can just forward to `Append()`. PiperOrigin-RevId: 479043790 Change-Id: I5d7d80ca1e17adf03b77726df8a52e2b4e9196ce
* | Update charconv.ccGravatar Randolf J2022-10-04
| |
* | chore: limit to ClangGravatar Randolf J2022-10-04
| |
| * No changes in OSSGravatar Gennadiy Rozental2022-10-03
| | | | | | | | | | PiperOrigin-RevId: 478668020 Change-Id: Iee79011bf7154e83ad862e7bf6e7a76dd337ec06
| * Replace the kPower10ExponentTable array with a formula.Gravatar Abseil Team2022-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sizeof(kPower10ExponentTable) = 651 * sizeof(int16_t) = 1302 bytes. Their equivalence can be confirmed by this test program: ``` const int minIncl = -342; const int maxExcl = 309; const int kPower10ExponentTable[] = { etc }; int Power10Exponent(int n) { return kPower10ExponentTable[n - minIncl]; } int main(int argc, char** argv) { for (int n = minIncl; n < maxExcl; n++) { int formula = (217706 * n >> 16) - 63; int table = Power10Exponent(n); if (formula != table) { return 1; } } return 0; } ``` Tested by atod_manual_test over the parse-number-fxx-test-data test cases, with and without manually disabling the EiselLemire code path, noting that changing the magic 217706 value causes test failures. PiperOrigin-RevId: 478646550 Change-Id: Icaaf106f9aa36e2de057f3bc9aeddc3ae0efade6
| * CMake: Mark absl::cord_test_helpers and absl::spy_hash_state PUBLICGravatar Abseil Team2022-10-03
| | | | | | | | | | PiperOrigin-RevId: 478611460 Change-Id: I327dbd1c16a22649e3a25b9ebbc94b48a2fda26f
* | Update charconv.ccGravatar Randolf J2022-10-02
|/
* Allows absl::StrCat to accept types that implement AbslStringify()Gravatar Abseil Team2022-09-30
| | | | | PiperOrigin-RevId: 478050535 Change-Id: I8e4a4b01aceb8d712476101633eac0ce8647823a
* Cleanup: SmallMemmove nullify should also be limited to 15 bytesGravatar Martijn Vels2022-09-30
| | | | | | | | | The current implementation correctly copies up to 15 bytes of data, but the nullify code clears up to 16 bytes, which was likely motivated by the assumption that the length indicator is always the last byte. This changes limits the nullify to 15 bytes as well removing this layout specific assumption from cord.h, making future platform specific internal layout changes easier to land. PiperOrigin-RevId: 477997741 Change-Id: Idcdfeca2a005139f97eafcc77111542d90b817af
* Cleanup: implement PrependArray and PrependPrecise in terms of InlineDataGravatar Martijn Vels2022-09-29
| | | | | | | This removes layout specific details from InlineData from cord.cc, making future platform specific internal layout changes easier to land. PiperOrigin-RevId: 477870559 Change-Id: I26e428ef280d593ad321cf7875e05adcb1cb6438
* Cleanup: Move BitwiseCompare() to InlineData, and make it layout independent.Gravatar Martijn Vels2022-09-29
| | | | | | | This removes layout specific details from InlineData from cord.h, making future platform specific internal layout changes easier to land. PiperOrigin-RevId: 477869206 Change-Id: I1d417af47d7f04e34a98ba7b93ae591ece8f9151
* Change kPower10Table bounds to be half-openGravatar Abseil Team2022-09-29
| | | | | | | | | | | | Half-open intervals are recommended by Dijkstra: https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html This also simplifies a static_assert by removing a +1 term. Also fix a "smaller exponent" copy/pasto. PiperOrigin-RevId: 477848998 Change-Id: I67af73d37ac08d36a1117ba33313a02932bd5814
* Cleanup some InlineData internal layout specific details from cord.hGravatar Martijn Vels2022-09-29
| | | | | | | This makes future platform specific internal layout changes easier to land. PiperOrigin-RevId: 477843948 Change-Id: I4ca4fdea5e965261c029d08319aba0290721c227