summaryrefslogtreecommitdiff
path: root/AK/StringBuilder.cpp
AgeCommit message (Collapse)Author
2020-05-17AK: Add StringBuilder::append(Utf32View)Andreas Kling
This encodes the incoming UTF-32 sequence as UTF-8.
2020-05-15AK: StringBuilder with 0 initial capacity shouldn't build null StringAndreas Kling
With 0 initial capacity, we don't allocate an underlying ByteBuffer for the StringBuilder, which would then lead to a null String() being returned from to_string(). This patch makes sure we always build a valid String.
2020-03-23AK: Reduce header dependency graph of String.hAndreas Kling
String.h no longer pulls in StringView.h. We do this by moving a bunch of String functions out-of-line.
2020-03-08AK: Reduce code duplication in StringBuilderhowar6hill
2020-03-08AK: Improve the API of StringBuilderhowar6hill
2020-03-08AK: Move memory stuff (fast memcpy, etc) to a separate headerAndreas Kling
Move the "fast memcpy" stuff out of StdLibExtras.h and into Memory.h. This will break a ton of things that were relying on StdLibExtras.h to include a bunch of other headers. Fix will follow immediately after. This makes it possible to include StdLibExtras.h from Types.h, which is the main point of this exercise.
2020-03-01AK: Remove unnecessary casts to size_t, after Vector changesAndreas Kling
Now that Vector uses size_t, we can remove a whole bunch of redundant casts to size_t.
2020-02-14AK: Add a forward declaration headerAndreas Kling
You can now #include <AK/Forward.h> to get most of the AK types as forward declarations. Header dependency explosion is one of the main contributors to compile times at the moment, so this is a step towards smaller include graphs.
2020-02-09AK: Make StringBuilder::to_string() non-destructiveAndreas Kling
This was an artifact of an earlier design of StringBuilder where I had attempted to preserve the same allocation from build to final String.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
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-09-30ByteBuffer: Remove pointer() in favor of data()Andreas Kling
We had two ways to get the data inside a ByteBuffer. That was silly.
2019-09-28AK: Add StringBuilder::string_view() and StringBuilder::clear()Sergey Bugaev
The former allows you to inspect the string while it's being built. It's an explicit method rather than `operator StringView()` because you must remember you can only look at it in between modifications; appending to the StringBuilder invalidates the StringView. The latter lets you clear the state of a StringBuilder explicitly, to start from an empty string again.
2019-07-08StringBuilder: Reset the internal builder length after building.Andreas Kling
This puts the StringBuilder back into a pristine state, allowing you to use it to build more strings after you've built one.
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-14AK: Massage it into building on my host system without breaking Serenity.Andreas Kling
2019-06-07AK: Rename printf.cpp to PrintfImplementation.h.Andreas Kling
2019-06-02Take StringView in more placesRobin Burchell
We should work towards a pattern where we take StringView as function arguments, and store String as member, to push the String construction to the last possible moment.
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-15AK: Make StringBuilder::appendf() pre-allocate the format string length.Andreas Kling
2019-02-25More moving towards using signed types.Andreas Kling
I'm still feeling this out, but I am starting to like the general idea.
2019-02-22Start fixing things up to build with a proper cross-compiler.Andreas Kling
2019-01-31Big, possibly complete sweep of naming changes.Andreas Kling
2019-01-30Add a String::format() and use that in place of ksprintf() in the Kernel.Andreas Kling
You're never gonna be right 100% of the time when guessing how much buffer space you need. This avoids having to make that type of decision in a bunch of cases. :^)
2019-01-28VFS: Resolve FIXME in Inode::read_entire() about using dynamic allocation.Andreas Kling
2019-01-18Add a simple /bin/sysctl that wraps the files in /proc/sys.Andreas Kling
2019-01-18StringBuilder: Use a ByteBuffer internally instead of a Vector<String>.Andreas Kling
2019-01-18Add a simple StringBuilder::appendf() and use it for ProcFS.Andreas Kling
Okay, now ProcFS doesn't crash due to the crappy buffer size estimates not really working out. This thing has dogshit performance and I will fix that separately.
2018-12-21Yet another pass of style fixes.Andreas Kling
2018-11-18Finally hook up the mkdir code to a syscall.Andreas Kling
Added a /bin/mkdir that makes directories. How very neat :^) There are various limitations because of missing functionality.
2018-10-29Fix broken SpinLock.Andreas Kling
The SpinLock was all backwards and didn't actually work. Fixing it exposed how wrong most of the locking here is. I need to come up with a better granularity here.
2018-10-28Add a simple FileSystemPath class that can canonicalize paths.Andreas Kling
Also a simple StringBuilder to help him out.
2018-10-10Import all this stuff into a single repo called Serenity.Andreas Kling