From 012df4bc38777c9053353ec2c4213bba67d63ab4 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sun, 10 Nov 2024 15:14:54 -0600 Subject: Buffered file IO. --- include/fud_string.hpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/fud_string.hpp') diff --git a/include/fud_string.hpp b/include/fud_string.hpp index 935e1c1..a20b067 100644 --- a/include/fud_string.hpp +++ b/include/fud_string.hpp @@ -307,22 +307,31 @@ class String { * length is greater than zero. */ Option pop(); + /** \brief Append a C string to the back of the string, growing it as necessary. */ FudStatus append(const char* source); + /** \brief Append a String to the back of the string, growing it as necessary. */ FudStatus append(const String& source); + /** \brief Append a StringView to the back of the string, growing it as necessary. */ FudStatus append(StringView source); + /** \brief Create a new string with the contents of this string and rhs. */ + [[nodiscard]] StringResult catenate(const String& rhs) const; + + /** \@copydoc String::catenate(const String& rhs) const */ + [[nodiscard]] StringResult catenate(const char* rhs) const; + + /** \brief Insert as much of source into the string as possible, returning + * how many bytes and the status of the insertion. */ DrainResult drain(const char* source); + /** @copydoc String::drain(const char* source) */ DrainResult drain(const String& source); + /** @copydoc String::drain(const char* source) */ DrainResult drain(StringView source); - [[nodiscard]] StringResult catenate(const String& rhs) const; - - [[nodiscard]] StringResult catenate(const char* rhs) const; - [[nodiscard]] bool compare(const String& rhs) const; FudStatus clear(); -- cgit v1.2.3