summaryrefslogtreecommitdiff
path: root/absl/strings/internal
Commit message (Collapse)AuthorAge
* Fix some spelling mistakesGravatar Vertexwahn2023-04-24
|
* Merge pull request #1416 from AtariDreams:fillGravatar Copybara-Service2023-04-24
|\ | | | | | | | | PiperOrigin-RevId: 526675031 Change-Id: Ib84423ccea2d0183166194a0916a97a7ed32915c
| * Prefer copy_n and fill_n over copy and fill where appropriate.Gravatar Rose2023-04-19
|/ | | | This lets us avoid having to do the addition manually.
* Be more consistent in the documentation and variable declarations for base64 ↵Gravatar Abseil Team2023-03-16
| | | | | | | | | | | escaping vs unescaping: * Move table documenting escaping conversions to be next to the internal escaping code that implements it. Mention it from the internal _un_escaping code (which reverses it) too. * Centralize the two arrays which map from normal chars to escaped chars (k(WebSafe)Base64Chars), and make bidirectional documentation links between them and their reverse (unescaping) maps (kUn(WebSafe)Base64). * Remove redundant list of escaping/unescaping methods in the public escaping.cc. PiperOrigin-RevId: 517142667 Change-Id: I627e59a196ef855e5bf61ef7f4b509920e8d7acd
* Use const and static for member functionsGravatar Rose2023-03-07
| | | | This shows that these are member functions that do not modify a class's data.
* Remove Workarounds for Old Clang BugGravatar Rose2023-02-14
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=38289 has been addressed since 2019. We just have to check to see if the clang being used to compile with is any version before major version 9.
* Fix missing includes/dependenciesGravatar Derek Mauro2023-02-02
| | | | | PiperOrigin-RevId: 506622658 Change-Id: I17ae2d97a6cadb7bdd8ebd0ec0dd3976568cb7e1
* Make `SanitizerSafeCopy()` constexpr, and check for constant evaluationGravatar Martijn Vels2023-01-25
| | | | | PiperOrigin-RevId: 504728034 Change-Id: Ifb338247b7484426e25a58580783a1d70d27e6fd
* Add memory sanitizer to absl::CordGravatar Martijn Vels2023-01-25
| | | | | PiperOrigin-RevId: 504555535 Change-Id: Id40484e9f52c87e9d67def2735ee60481ca50526
* Add missing include and remove unused includesGravatar Derek Mauro2023-01-19
| | | | | PiperOrigin-RevId: 503229681 Change-Id: I72817b43c547bd142144d0887866c4e26ec09fb2
* Only enable cordz on Linux with thread_local supportGravatar Derek Mauro2023-01-19
| | | | | | | Fixes #1365 PiperOrigin-RevId: 503160321 Change-Id: I210f194373c3e08a75d68298a8482be5f1f2227c
* Refactor InlineData to allow for memory sanitizer changes step 2Gravatar Martijn Vels2023-01-10
| | | | | PiperOrigin-RevId: 501074382 Change-Id: I26a59ee6452855685ffe89469c352e6384060f59
* Replace generic 'base64 encoding' terminology with the specific RFCs they match.Gravatar Abseil Team2023-01-09
| | | | | | | | | Remove duplicate documentation for two variants of Base64EscapeInternal(). Clarify role of base64 char array input (controls web-safe or not). PiperOrigin-RevId: 500867221 Change-Id: Ie316a7ddd60794e041c5b9b39e9ab5b66ed565a6
* Refactor InlineData to allow for memory sanitizer changes step 1Gravatar Martijn Vels2023-01-09
| | | | | PiperOrigin-RevId: 500765473 Change-Id: Iaa3f9fdee6c9f4322bc8995b0d381cf1c8cb1349
* 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
* 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
* Use a c++14-style constexpr initialization if c++14 constexpr is available.Gravatar Jorg Brown2022-12-02
| | | | | PiperOrigin-RevId: 492463896 Change-Id: I063759ca5ceb3597a7c8ab25af23aa688dee26c2
* 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
* 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
* 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
* 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
* 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
* Improve the comments on the implementation of format hooks adl tricks.Gravatar Matt Kulukundis2022-09-29
| | | | | PiperOrigin-RevId: 477811281 Change-Id: Iba838e0eaceb5e6bfe1dac496fc86a22f5cf31d5
* Allows absl::StrFormat to accept types which implement AbslStringify()Gravatar Abseil Team2022-09-28
| | | | | PiperOrigin-RevId: 477507777 Change-Id: I5ecde3163ca560ac8774034e55654774e36ad230
* Adds support for "%v" in absl::StrFormat and related functions for bool ↵Gravatar Abseil Team2022-09-20
| | | | | | | values. Note that %v prints bool values as "true" and "false" rather than "1" and "0". PiperOrigin-RevId: 475651689 Change-Id: I24b3749d85b5bb7cbc18653d629271a8b2b07d08
* Explicitly disallows modifiers for use with %v.Gravatar Abseil Team2022-09-20
| | | | | PiperOrigin-RevId: 475636693 Change-Id: Idb7c2b9c36ad8e59f24ff7df179a207d301d9e89
* Adds support for "%v" in absl::StrFormat and related functions for numeric ↵Gravatar Abseil Team2022-09-15
| | | | | | | types, including integer and floating point values. Users may now specify %v and have the format specifier deduced. Integer values will print according to %d specifications, unsigned values will use %u, and floating point values will use %g. Note that %v does not work for `char` due to ambiguity regarding the intended output. Please continue to use %c for `char`. PiperOrigin-RevId: 474658166 Change-Id: Iecae39263e368b27232db440535f2bf7da8d863c
* Implement correct move constructor and assignment for ↵Gravatar Andy Getzendanner2022-09-14
| | | | | | | | | absl::strings_internal::OStringStream, and mark that class final. This should be explicit per https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types, and is currently hard to infer due to multiple inheritance. PiperOrigin-RevId: 474311032 Change-Id: I72d7adcb9f7a991c19c26bc7083a4df31de5da49
* Fixes bug so that `%v` with modifiers doesn't compile. `%v` is not intended ↵Gravatar Abseil Team2022-09-06
| | | | | | | to work with modifiers because the meaning of modifiers is type-dependent and `%v` is intended to be used in situations where the type is not important. Please continue using if `%s` if you require format modifiers. PiperOrigin-RevId: 472534916 Change-Id: I5838761b2b40cbc4344077f23d44b1e634e5bae3
* Refactors checker.h and replaces recursive functions with iterative ↵Gravatar Abseil Team2022-09-01
| | | | | | | functions for readability purposes. PiperOrigin-RevId: 471622216 Change-Id: Ic28ed8e26d5085ccf20290d1b9c7a5e9bc1f0fde
* Refactors checker.h to use if statements instead of ternary operators for ↵Gravatar Abseil Team2022-09-01
| | | | | | | better readability. PiperOrigin-RevId: 471621696 Change-Id: I603e5707d896deef3a015c70ceac9778e360f72f
* Adds support for "%v" in absl::StrFormat and related functions for ↵Gravatar Abseil Team2022-08-31
| | | | | | | string-like types (support for other builtin types will follow in future changes). Rather than specifying %s for strings, users may specify %v and have the format specifier deduced. Notably, %v does not work for `const char*` because we cannot be certain if %s or %p was intended (nor can we be certain if the `const char*` was properly null-terminated). If you have a `const char*` you know is null-terminated and would like to work with %v, please wrap it in a `string_view` before using it. PiperOrigin-RevId: 471321055 Change-Id: Ifbb50082d301baecc7edc277975f12e7ad3ecc8a
* Fixed header guards to match style guide conventions.Gravatar Abseil Team2022-08-31
| | | | | PiperOrigin-RevId: 471292183 Change-Id: Ic124d671dd3b0ae819f741885abb046cbf7e1add
* Fix "unsafe narrowing" warnings in absl, 6/n.Gravatar Abseil Team2022-08-29
| | | | | | | | | | | | | | | 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 focuses on .cc files in strings/internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 470810568 Change-Id: Ibd316a7e62cc43cb198ba22daed565c9573ce235
* Fix "unsafe narrowing" warnings in absl, 5/n.Gravatar Abseil Team2022-08-17
| | | | | | | | | | | | | | | 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 focuses on .cc files in strings/internal/.) Bug: chromium:1292951 PiperOrigin-RevId: 468215101 Change-Id: I07fa487bcf2cf62d403489c3be7a5997cdef8987