summaryrefslogtreecommitdiff
path: root/absl/strings
Commit message (Collapse)AuthorAge
* Fixing a comment to be correct with the current code.Gravatar Abseil Team2023-12-06
| | | | | PiperOrigin-RevId: 588530709 Change-Id: Iee28c7693a4802f11e13728e1c28febee8c8576f
* Adds support for wchar_t/wchar_t*/std::wstring{_view} arguments to StrFormat().Gravatar Abseil Team2023-12-05
| | | | | | | This converts to UTF-8 regardless of locale. PiperOrigin-RevId: 588186076 Change-Id: I2c9598279b413d460e13ad65da2ba421c0b40b83
* Update documentation to reflect best practices (prefer brace initialization)Gravatar Abseil Team2023-11-27
| | | | | PiperOrigin-RevId: 585691325 Change-Id: Icd18dc0294dfd1e22f9878b628d5e5898fcc8185
* Fixed a very small typo in the Cord::empty() docstring.Gravatar Abseil Team2023-11-14
| | | | | PiperOrigin-RevId: 582455513 Change-Id: Ic78d14d6dd748420a64e7026ec7f8b967bebbf42
* Add new benchmark for integer `StrAppend`Gravatar Abseil Team2023-11-13
| | | | | PiperOrigin-RevId: 582033534 Change-Id: I9af42210f65b40ccd7f55c9a2e0c8387b69760dc
* Doc fix.Gravatar Abseil Team2023-11-03
| | | | | PiperOrigin-RevId: 579263069 Change-Id: I78678c2fc6aba4851f8a06dafb695c913accf0d0
* Optimize memcasecmp. Benchmarks shows slight improvement.Gravatar Ilya Tokar2023-10-30
| | | | | | | | | | | | | | | We are also avoiding potential cache-misses, by avoiding load. name old speed new speed delta BM_Searchcase 3.09GB/s ±13% 3.20GB/s ±16% +3.69% (p=0.039 n=20+17) BM_SearchcaseMedium 1.08GB/s ± 7% 1.04GB/s ±14% ~ (p=0.814 n=16+20) BM_SearchcasePathological 618kB/s ±13% 652kB/s ± 6% +5.55% (p=0.043 n=20+16) BM_Memcasematch 2.43GB/s ± 3% 2.45GB/s ± 3% ~ (p=0.488 n=17+16) BM_MemcasematchMedium 230MB/s ± 8% 261MB/s ±14% +13.77% (p=0.000 n=16+20) BM_MemcasematchPathological 624kB/s ±14% 619kB/s ±14% ~ (p=0.836 n=20+20) PiperOrigin-RevId: 577919033 Change-Id: I31324e04b6a577c582ad630d171d3b41d826f1e4
* Fix an unreachable code warning on some platformsGravatar Derek Mauro2023-10-30
| | | | | | | #1558 PiperOrigin-RevId: 577874842 Change-Id: I1d56f3f4b445f6c4a9df2fe06fec542cb00e0e92
* Fix a typo.Gravatar Abseil Team2023-10-24
| | | | | PiperOrigin-RevId: 576162408 Change-Id: Ib383bb744b5cb11b6cbc99f2323583e1d23d8ff1
* Add `AbslStringify()` support to `absl::Cord`Gravatar Abseil Team2023-10-24
| | | | | PiperOrigin-RevId: 576149980 Change-Id: I0a7e3df7a01edc78ee5d15d8d8e82e7bbc5fc0f3
* Performance improvements for `absl::AsciiStrToLower` and ↵Gravatar Abseil Team2023-10-23
| | | | | | | `absl::AsciiStrToUpper`. PiperOrigin-RevId: 575969640 Change-Id: If6ddc0a71debfe571c2739ec91fc99594bc36f88
* absl::string_view: Add support for starts_with() and ends_with()Gravatar Derek Mauro2023-10-20
| | | | | | | | | | | | | | | | when targeting at least C++20 These methods were added to C++20, so they are not available in earlier language standards. Users requiring compatibility prior to C++20 should use absl::StartsWith() and absl::EndsWith() from //absl/strings/match.h. Most users are not affected by this change. By default when targeting at least C++20 absl::string_view will be an alias for std::string_view. Only users that have modified //absl/base/options.h will see this change. PiperOrigin-RevId: 575238435 Change-Id: I7b03fde02c987b30b88c794640c2a616851997d1
* Add a template gadget to detect whether a type supports the ostream operator.Gravatar Zie Weaver2023-10-18
| | | | | | | | | | I.e. for a type `Example`, if ``` std::ostream& operator<<(std::ostream&, const Example&); ``` is declared, `absl::HasOstreamOperator<Example>::value` is `true`. PiperOrigin-RevId: 574637891 Change-Id: I123d8f35a6e3ea894745133f7d81b1610fb475d5
* Delete `absl::strings_internal::HasAbslStringify`.Gravatar Abseil Team2023-10-12
| | | | | | | Users should use `absl::HasAbslStringify` instead. PiperOrigin-RevId: 572916854 Change-Id: Ie67e076e0335b108d23f886a28074f7557ba045a
* Bazel: Enable the header_modules featureGravatar Derek Mauro2023-10-11
| | | | | PiperOrigin-RevId: 572575394 Change-Id: Ic1c5ac2423b1634e50c43bad6daa14e82a8f3e2c
* Bazel: Support layering_check and parse_headersGravatar Derek Mauro2023-10-10
| | | | | | | | | | | | | The layering_check feature ensures that rules that include a header explicitly depend on a rule that exports that header. Compiler support is required, and currently only Clang 16+ supports diagnoses layering_check failures. The parse_headers feature ensures headers are self-contained by compiling them with -fsyntax-only on supported compilers. PiperOrigin-RevId: 572350144 Change-Id: I37297f761566d686d9dd58d318979d688b7e36d1
* Update argument order of `EXPECT_EQ` in `absl::StrJoin` documentation.Gravatar Abseil Team2023-10-06
| | | | | PiperOrigin-RevId: 571487219 Change-Id: I6fbb2ff19db2b6d77e55059004d65c8639eb7fca
* Fix a crash when calling `EstimatedMemoryUsage()` on an empty checksummed ↵Gravatar Abseil Team2023-09-22
| | | | | | | `absl::Cord`. PiperOrigin-RevId: 567695227 Change-Id: I13eb8a1872d2fe703b5f3b9bc8df7fec4381fb55
* Additional StrCat microbenchmarks.Gravatar Abseil Team2023-09-19
| | | | | PiperOrigin-RevId: 566650311 Change-Id: Ibfabee88ea9999d08ade05ece362f5a075d19695
* Remove unused internal function `InlineRep::empty()` which has misleading ↵Gravatar Abseil Team2023-09-14
| | | | | | | semantics. PiperOrigin-RevId: 565330231 Change-Id: I84f0e9065986bb592b5bfb196b3fc221feb14bc4
* Make `HasAbslStringify` public.Gravatar Abseil Team2023-09-13
| | | | | PiperOrigin-RevId: 565050503 Change-Id: I8f4c463be4ef513a2788745d1b454a7ede489152
* Fixes StrCat() performance regression when not using libc++Gravatar Derek Mauro2023-09-11
| | | | | | | | | 65d7b6d changed StrCat() to not use an intermediate buffer when the result fits in the SSO buffer, but only libc++ has an SSO buffer large enough for this optimization to work. PiperOrigin-RevId: 564447163 Change-Id: I0c7fa4afed3369b36e13e7d1691eb7f933ea0091
* Doc fix.Gravatar Abseil Team2023-09-11
| | | | | PiperOrigin-RevId: 564296635 Change-Id: I13ca663cdb676948a7041c5671b82a97a4388ff1
* Remove CordRepRing experiment.Gravatar Martijn Vels2023-09-08
| | | | | | | We have no intention to use it instead of the CordRepBtree implementation, so cleanup up and remove all code and references. PiperOrigin-RevId: 563803813 Change-Id: I95a67318d0f722f3eb7ecdcc7b6c87e28f2e26dd
* Fix strict weak ordering in convert_test.ccGravatar Abseil Team2023-09-08
| | | | | | | It sorts NaNs and the test became flaky. Flakiness arises from the fact that sorting checks randomize and check for 100 elements but we sort here around a thousand PiperOrigin-RevId: 563783036 Change-Id: Id25bcb47483acf9c40be3fd1747c37d046197330
* Revise a comment regarding casting `memchr()`'s return type. The original ↵Gravatar Abseil Team2023-08-31
| | | | | | | comment seemed to suggest that the return type varies depending on the compiler and hence the `static_cast` is needed. PiperOrigin-RevId: 561706189 Change-Id: Ie244d235d082536edfca263d4165e16171cbc6c7
* Remove unused ReservedFlag.Gravatar Tomas Dzetkulic2023-08-30
| | | | | PiperOrigin-RevId: 561444343 Change-Id: I26c648b28b626e11caa32b0a34aef92932d5ddb9
* Speed up `FastIntToBuffer`.Gravatar Abseil Team2023-08-25
| | | | | PiperOrigin-RevId: 560038034 Change-Id: I2c74d271b52faeefb6e8627d9830b2b53de64e73
* Add absl::CharSet.Gravatar Abseil Team2023-08-23
| | | | | PiperOrigin-RevId: 559415517 Change-Id: I5bbc744bf00be2fd15ec7544b725d699e0d982fb
* Check CRC cordrep child nodes for nullptr.Gravatar Martijn Vels2023-08-18
| | | | | | | Some time ago the invariant for CRC cordreps was relaxed to allow for nullptr values on empty cords with an explicit empty CRC value. The CordzInfo analysis never checked for nullptr values causing cord sampling to crash if the sampling happened to include a (very unlikely) empty Cord value. PiperOrigin-RevId: 558202613 Change-Id: Ib0e1eadd08047167e4df5d3035b36dca2c285a0d
* StrCat: do not use intermediate buffer when result fits in SSO.Gravatar Abseil Team2023-08-17
| | | | | PiperOrigin-RevId: 557811632 Change-Id: I370fa17d2fb82a1f1ca86f84529bae31b34b18e4
* Implement `Cord::Find()` and `Cord::Contains()`Gravatar Abseil Team2023-08-16
| | | | | PiperOrigin-RevId: 557523229 Change-Id: I959c0b0b14a4a96bee396d4bc09b80328060287d
* Speed up kTotalMorePrecise mode of Cord::EstimatedMemoryUsage() by about 25% ↵Gravatar Abseil Team2023-08-14
| | | | | | | by avoiding a redundant map lookup. PiperOrigin-RevId: 556816759 Change-Id: I971e428bf12d91720df72a91cc0bdf0513b0c270
* Add ATTRIBUTE_LIFETIME_BOUND to Cord iterator methodsGravatar Abseil Team2023-08-10
| | | | | PiperOrigin-RevId: 555515105 Change-Id: I00929a869880cddd932ed2a08adb8f762a582738
* Eliminate redundant code branch in `StrAppend`.Gravatar Abseil Team2023-08-09
| | | | | PiperOrigin-RevId: 555080884 Change-Id: I3f83fbeea1352587cf46fed83861cd7fb75655b0
* Fix ClangTidy warningsGravatar Dmitri Gribenko2023-08-08
| | | | | | | | * converting integer literal to bool, use bool literal instead * use '= default' to define a trivial default constructor PiperOrigin-RevId: 554935854 Change-Id: If16a435664641df049b8810044b34a05ea2b4028
* Remove a doubled up "with"Gravatar Dmitri Gribenko2023-08-08
| | | | | PiperOrigin-RevId: 554934635 Change-Id: Ia666bc28ee8ee84c633f365312760996f0816ca7
* Add ATTRIBUTE_LIFETIME_BOUND to Cord::Flatten and TryFlatGravatar Abseil Team2023-08-08
| | | | | PiperOrigin-RevId: 554898945 Change-Id: Id19acf5af56b1e7877cd73ac8420cf8e1a841b64
* Include what you spellGravatar Dmitri Gribenko2023-08-08
| | | | | PiperOrigin-RevId: 554854436 Change-Id: Ifbac5ba447528ac696ac59eced95fd752aacf4f9
* Remove the no-op full_validation flag in the implementation details of cord.ccGravatar Dmitri Gribenko2023-08-07
| | | | | PiperOrigin-RevId: 554552096 Change-Id: I0aa1bf705841c8bcee42bd33bc8d14bc15f2728b
* Remove a reference to the global string type, which does not exist as a ↵Gravatar Dmitri Gribenko2023-08-07
| | | | | | | separate type anymore PiperOrigin-RevId: 554462574 Change-Id: I749ae0308d76580a2264f35ee8df487da81e0f7b
* Rollback of "Speed up StrAppend by up to 4x."Gravatar Abseil Team2023-08-02
| | | | | PiperOrigin-RevId: 553158292 Change-Id: I28350321550accd72da2f9f6f5992af311fe4b00
* Speed up StrAppend by up to 4x.Gravatar Abseil Team2023-08-01
| | | | | PiperOrigin-RevId: 552802740 Change-Id: I662da1b03bfffb7939b44ea3850566d3c209c6cc
* Undefine internal `ABSL_FORMAT_PARSER_INTERNAL_GET_CHAR` macro after usageGravatar Abseil Team2023-07-26
| | | | | PiperOrigin-RevId: 551287955 Change-Id: Ic77831cec71f6ffe0a4e091baabe932b245269ea
* Add tests for the "%#04x" patternGravatar Phoebe Liang2023-07-18
| | | | | | | Verifies that values other than 0 are prepended with "0x", while 0 is printed as "0000". PiperOrigin-RevId: 549108651 Change-Id: Ib0f87d42066c46f3a5d4b05ca5c9d7ac17be9b66
* Add a smaller library for string_view so that users canGravatar Derek Mauro2023-07-11
| | | | | | | | | | | depend on string_view without depending on all of //absl/strings:strings New code that uses string_view.h should depend on //absl/strings:string_view (Bazel) or absl::string_view (CMake) instead. PiperOrigin-RevId: 547283268 Change-Id: I6006b19605ce377d12c462129dda14251d16e1c1
* Cleanup `//absl/strings/internal/memutil.h`Gravatar Derek Mauro2023-07-11
| | | | | | | | | | | | | `memmatch()` is only used in `string_view.cc`, so move it there. The moving of `memmatch()` to `string_view.cc` decouples `string_view` from `memutil`, which will allow us to move `string_view` into its own target in a followup. The only other function that is used is `memcasecmp()`, so delete all other functions. PiperOrigin-RevId: 547238386 Change-Id: Id6fad47dd24191c8e8f26dd923fffa1007c8db4a
* Introduce a kTotalMorePrecise accounting mode for ↵Gravatar Abseil Team2023-06-29
| | | | | | | | | Cord::EstimatedMemoryUsage(). This mode avoids double-counting blocks that a Cord references more than once; otherwise it is similar to the existing kTotal mode. There's no change to the existing kTotal or kFairShare accounting modes. PiperOrigin-RevId: 544378591 Change-Id: I7b4ae55cd93d631194e59a9cd0ff07f47611219e
* Remove two_ASCII_digits and replace with a scalar algorithmGravatar Abseil Team2023-06-13
| | | | | PiperOrigin-RevId: 539900072 Change-Id: I675386e3184f6f5ab70b851add970c91d1dde9c5
* Functions added: FindLongestCommonSuffix, FindLongestCommonPrefix.Gravatar Tsige Solomon2023-06-12
| | | | | PiperOrigin-RevId: 539784770 Change-Id: Ie224afa04af023bbddc89b967e8c8440f9e8a887