[#absl-Cord]
= xref:absl.adoc[absl]::Cord
:relfileprefix: ../
:mrdocs:

A sequence of characters stored as a tree of buffers&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;cord&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class Cord;
----

== Types

[cols="1,4"]
|===
| Name| Description
| xref:absl/Cord/CharIterator.adoc[`CharIterator`] 
| Iterates over the constituent characters of a `Cord`&period;
| xref:absl/Cord/CharRange.adoc[`CharRange`] 
| A range over the characters of a `Cord`, usable in a range&hyphen;based for loop&period;
| xref:absl/Cord/ChunkIterator.adoc[`ChunkIterator`] 
| Iterates over the constituent chunks of a `Cord`&period;
| xref:absl/Cord/ChunkRange.adoc[`ChunkRange`] 
| A range over the chunks of a `Cord`, usable in a range&hyphen;based for loop&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/Cord/2constructor-06.adoc[`Cord`]         [.small]#[constructor]#
| Constructors
| xref:absl/Cord/2destructor.adoc[`&#126;Cord`] [.small]#[destructor]#
| Destructs the Cord&period;
| xref:absl/Cord/operator_assign-0f9.adoc[`operator&equals;`] 
| Assignment operators
| xref:absl/Cord/Append-078.adoc[`Append`] 
| `Append` overloads
| xref:absl/Cord/Chars.adoc[`Chars`] 
| Returns a `Cord&colon;&colon;CharRange` for iterating over the characters of a `Cord` with a range&hyphen;based for&hyphen;loop&period;
| xref:absl/Cord/Chunks.adoc[`Chunks`] 
| Returns a `Cord&colon;&colon;ChunkRange` for iterating over the chunks of a `Cord` with a range&hyphen;based for&hyphen;loop&period;
| xref:absl/Cord/Clear.adoc[`Clear`] 
| Releases the Cord data&period;
| xref:absl/Cord/Compare-023.adoc[`Compare`] 
| `Compare` overloads
| xref:absl/Cord/Contains-0e.adoc[`Contains`] 
| `Contains` overloads
| xref:absl/Cord/EndsWith-08.adoc[`EndsWith`] 
| `EndsWith` overloads
| xref:absl/Cord/EstimatedMemoryUsage.adoc[`EstimatedMemoryUsage`] 
| Returns the _approximate_ number of bytes held by this cord&period;
| xref:absl/Cord/ExpectedChecksum.adoc[`ExpectedChecksum`] 
| Returns this cord&apos;s expected checksum, if it has one&period; Otherwise, returns nullopt&period;
| xref:absl/Cord/Find-00.adoc[`Find`] 
| `Find` overloads
| xref:absl/Cord/Flatten.adoc[`Flatten`] 
| Flattens the cord into a single array and returns a view of the data&period;
| xref:absl/Cord/GetAppendBuffer.adoc[`GetAppendBuffer`] 
| Returns a CordBuffer, re&hyphen;using potential existing capacity in this cord&period;
| xref:absl/Cord/GetCustomAppendBuffer.adoc[`GetCustomAppendBuffer`] 
| Returns a CordBuffer, re&hyphen;using potential existing capacity in this cord&period;
| xref:absl/Cord/Prepend-0fa.adoc[`Prepend`] 
| `Prepend` overloads
| xref:absl/Cord/RemovePrefix.adoc[`RemovePrefix`] 
| Removes the first `n` bytes of a Cord&period;
| xref:absl/Cord/RemoveSuffix.adoc[`RemoveSuffix`] 
| Removes the last `n` bytes of a Cord&period;
| xref:absl/Cord/SetExpectedChecksum.adoc[`SetExpectedChecksum`] 
| Stores a checksum value with this non&hyphen;empty cord instance, for later retrieval&period;
| xref:absl/Cord/StartsWith-07.adoc[`StartsWith`] 
| `StartsWith` overloads
| xref:absl/Cord/Subcord.adoc[`Subcord`] 
| Returns a new Cord representing the subrange &lsqb;pos, pos &plus; new&lowbar;size) of&rsqb; &ast;this&period;
| xref:absl/Cord/TryFlat.adoc[`TryFlat`] 
| If this cord&apos;s representation is a single flat array, returns a string&lowbar;view referencing that array&period; Otherwise returns nullopt&period;
| xref:absl/Cord/char_begin.adoc[`char&lowbar;begin`] 
| Returns an iterator to the first character of the `Cord`&period;
| xref:absl/Cord/char_end.adoc[`char&lowbar;end`] 
| Returns an iterator to one past the last character of the `Cord`&period;
| xref:absl/Cord/chunk_begin.adoc[`chunk&lowbar;begin`] 
| Returns an iterator to the first chunk of the `Cord`&period;
| xref:absl/Cord/chunk_end.adoc[`chunk&lowbar;end`] 
| Returns an iterator one increment past the last chunk of the `Cord`&period;
| xref:absl/Cord/empty.adoc[`empty`] 
| Determines whether the given Cord is empty, returning `true` if so&period;
| xref:absl/Cord/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Gets the &quot;i&quot;th character of the Cord and returns it, provided that 0 &lt;&equals; i &lt; Cord&period;size()&period;
| xref:absl/Cord/size.adoc[`size`] 
| Returns the size of the Cord&period;
| xref:absl/Cord/swap.adoc[`swap`] 
| Swaps the contents of the Cord with `other`&period;
| xref:absl/Cord/2conversion.adoc[`operator std::string`] 
| Converts a Cord into a `std&colon;&colon;string()`&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/Cord/Advance.adoc[`Advance`] 
| Advances the `Cord&colon;&colon;CharIterator` by `n&lowbar;bytes`&period;
| xref:absl/Cord/AdvanceAndRead.adoc[`AdvanceAndRead`] 
| Advances the `Cord&colon;&colon;CharIterator` by `n&lowbar;bytes` and returns the bytes advanced as a separate `Cord`&period;
| xref:absl/Cord/ChunkRemaining.adoc[`ChunkRemaining`] 
| Returns the longest contiguous view starting at the iterator&apos;s position&period;
| xref:absl/Cord/Distance.adoc[`Distance`] 
| Returns the distance between `first` and `last`, as if `std&colon;&colon;distance(first, last)` was called&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `absl::CrcCord`
| 
| `xref:absl/GenericCompare.adoc[absl::GenericCompare]`
| Compares `lhs` and `rhs` over the first `size&lowbar;to&lowbar;compare` bytes&period;
| `xref:absl/GetCordzInfoForTesting.adoc[absl::GetCordzInfoForTesting]`
| Returns the internal Cordz sampling info for `cord`, for testing&period;
| `xref:absl/operator_3way-09.adoc[absl::operator&lt;&equals;&gt;]`
| Three&hyphen;way compares string data with a Cord&period;
| `xref:absl/operator_3way-0c.adoc[absl::operator&lt;&equals;&gt;]`
| Three&hyphen;way compares a Cord with string data&period;
| `xref:absl/operator_3way-030.adoc[absl::operator&lt;&equals;&gt;]`
| Three&hyphen;way compares two Cords&period;
| `xref:absl/operator_eq-073.adoc[absl::operator&equals;&equals;]`
| Compares a Cord with string data for equality&period;
| `xref:absl/operator_eq-0f7.adoc[absl::operator&equals;&equals;]`
| Compares two Cords for equality&period;
| `xref:absl/CordTestPeer.adoc[absl::CordTestPeer]`
| Test&hyphen;only accessor granting access to `Cord` internals&period;
| `strings::CordReader`
| 
| `xref:absl/AbslHashValue-02.adoc[absl::AbslHashValue]`
| Combines the Cord&apos;s contents into a hash state&period;
| `xref:absl/AbslStringify-0d.adoc[absl::AbslStringify]`
| Supports automatic stringification with absl&colon;&colon;StrCat and absl&colon;&colon;StrFormat&period;
| `xref:absl/AbslFormatFlush-08.adoc[absl::AbslFormatFlush]`
| Supports absl&colon;&colon;Cord as a sink object for absl&colon;&colon;Format()&period;
| `xref:absl/CopyCordToSpan.adoc[absl::CopyCordToSpan]`
| Copies up to `dst&period;size()` bytes starting from the beginning of `src` to `dst`&period;
| `xref:absl/AppendCordToString.adoc[absl::AppendCordToString]`
| Appends the contents of a `src` Cord to a `&ast;dst` string&period;
| `xref:absl/CopyCordToString.adoc[absl::CopyCordToString]`
| Copies the contents of a `src` Cord into a `&ast;dst` string&period;
| `xref:absl/swap-0d.adoc[absl::swap]`
| Swaps the contents of two Cords&period;
| `xref:absl/MakeCordFromExternal.adoc[absl::MakeCordFromExternal]`
| Creates a Cord that takes ownership of external string memory&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/operator_not_eq-04b.adoc[`operator!&equals;`]
| Compares two Cords for inequality&period;
| xref:absl/operator_not_eq-0bf.adoc[`operator!&equals;`]
| Compares a Cord with string data for inequality&period;
| xref:absl/operator_lt-0ce.adoc[`operator&lt;`]
| Orders one Cord before another&period;
| xref:absl/operator_lt-0f.adoc[`operator&lt;`]
| Orders a Cord before string data&period;
| xref:absl/operator_le-07a.adoc[`operator&lt;&equals;`]
| Tests whether a Cord is ordered at or before string data&period;
| xref:absl/operator_le-0b5.adoc[`operator&lt;&equals;`]
| Tests whether one Cord is ordered at or before another&period;
| xref:absl/operator_gt-02e.adoc[`operator&gt;`]
| Orders one Cord after another&period;
| xref:absl/operator_gt-061.adoc[`operator&gt;`]
| Orders a Cord after string data&period;
| xref:absl/operator_ge-04f.adoc[`operator&gt;&equals;`]
| Tests whether one Cord is ordered at or after another&period;
| xref:absl/operator_ge-05.adoc[`operator&gt;&equals;`]
| Tests whether a Cord is ordered at or after string data&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
