summaryrefslogtreecommitdiff
path: root/AK/StringView.h
AgeCommit message (Collapse)Author
2019-12-29AK: Add StringView::ends_with functionShannon Booth
2019-12-09AK: Use size_t for the length of stringsAndreas Kling
Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this.
2019-12-02LibMarkdown: Handle CRLF line endingsTommy Nguyen
Previously, MDDocument only split on Unix-style line endings. This adds a new function to StringView which handles LF, CR and CRLF.
2019-09-28AK: Add a keep_empty argument to String[View]::substring{_view}Sergey Bugaev
2019-09-13StringView: Add starts_with methodMinusGix
2019-08-25AK: Add StringView::hash()Andreas Kling
This grabs the hash from the underlying StringImpl if there is one, otherwise it's computed on the fly.
2019-08-15StringView: Add StringView::operator==(StringView)Andreas Kling
Previously we'd implicitly convert the second StringView to a String when comparing two StringViews, which is obviously not what we wanted.
2019-08-04AK: Add StringView::to_int()Andreas Kling
This is a shameless copy-paste of String::to_int(). We should find some way to share this code between String and StringView instead of having two duplicate copies like this.
2019-07-08StringView: Rename characters() to characters_without_null_termination().Andreas Kling
This should make you think twice before trying to use the const char* from a StringView as if it's a null-terminated string.
2019-06-29StringView: Make it easy to construct from a ByteBuffer.Andreas Kling
2019-06-14AK: Add more StringView utilities for making substrings.Sergey Bugaev
These two allow making a new substring view starting from, or starting after, an existing substring view. Also make use of one of them in the kernel.
2019-06-08StringView: Store a StringImpl* rather than a String*.Andreas Kling
2019-06-08AK: Add String::operator==(const char*).Andreas Kling
Without this function, comparing a String to a const char* will instantiate a temporary String which is obviously not great. Also add some missing null checks to StringView::operator==(const char*).
2019-06-07StringView: operator==(const char*) needs to stop when the view ends.Andreas Kling
We were comparing past the end of the view, which was clearly not correct.
2019-06-03StringView: Make construction of String from a StringView containing a ↵Robin Burchell
String cheaper ... at the cost of an additional pointer per view.
2019-06-02AK: Add implicit String -> StringView conversionRobin Burchell
And tidy up existing view() users.
2019-05-28Add clang-format fileRobin Burchell
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
2019-04-16AK: Try to use StringViews more for substrings and splitting.Andreas Kling
2019-04-15AK: Add a StringView class.Andreas Kling