4#include "../Strings/StringView.h"
110 void internalClear();
119 [[nodiscard]]
bool setTextLengthInBytesIncludingTerminator(
size_t newDataSize);
131 [[nodiscard]]
static bool convertUTF16LE_to_UTF8(
const StringView sourceUtf16,
Buffer& destination,
132 int& writtenCodeUnits);
133 [[nodiscard]]
static bool convertUTF8_to_UTF16LE(
const StringView sourceUtf8,
Buffer& destination,
134 int& writtenCodeUnits);
#define SC_COMPILER_EXPORT
Macro for symbol visibility in non-MSVC compilers.
Definition: Compiler.h:78
StringEncoding
String Encoding (Ascii, Utf8, Utf16)
Definition: StringIterator.h:17
An heap allocated byte buffer that can optionally use an inline buffer.
Definition: Buffer.h:25
Wraps a SC::FileDescriptor to open it and use strings / buffers.
Definition: File.h:19
Iterates files and directories inside a given path.
Definition: FileSystemIterator.h:34
String with compile time configurable inline storage (small string optimization)
Definition: String.h:168
Builds String out of a sequence of StringView or formatting through StringFormat.
Definition: StringBuilder.h:16
Converts String to a different encoding (UTF8, UTF16).
Definition: StringConverter.h:24
bool convertNullTerminateFastPath(StringView input, StringView &encodedText)
Converts a given input StringView to null-terminated version.
static bool convertEncodingToUTF16(StringView text, Buffer &buffer, StringView *encodedText=nullptr, NullTermination nullTerminate=AddZeroTerminator)
Converts text to (eventually null terminated) UTF16 encoding.
static bool convertEncodingTo(StringEncoding encoding, StringView text, Buffer &buffer, StringView *encodedText=nullptr, NullTermination nullTerminate=AddZeroTerminator)
Converts text to (eventually null terminated) requested encoding.
StringConverter(Buffer &text, StringEncoding encoding)
Create a StringBuilder that will push to given Vector, with specific encoding.
static bool convertEncodingToUTF8(StringView text, Buffer &buffer, StringView *encodedText=nullptr, NullTermination nullTerminate=AddZeroTerminator)
Converts text to (eventually null terminated) UTF8 encoding.
NullTermination
Specifies if to add a null terminator.
Definition: StringConverter.h:27
@ DoNotAddZeroTerminator
A null terminator will NOT be added at the end of the String.
Definition: StringConverter.h:29
@ AddZeroTerminator
A null terminator will be added at the end of the String.
Definition: StringConverter.h:28
Flags
Clearing flags used when initializing destination buffer.
Definition: StringConverter.h:63
@ Clear
Destination buffer will be cleared before pushing to it.
Definition: StringConverter.h:64
@ DoNotClear
Destination buffer will not be cleared before pushing to it.
Definition: StringConverter.h:65
bool appendNullTerminated(StringView input, bool popExistingNullTerminator=true)
Appends the given StringView and adds null-terminator.
StringConverter(String &text, Flags flags=DoNotClear)
Create a StringBuilder that will push to given String.
A non-modifiable owning string with associated encoding.
Definition: String.h:29
Non-owning view over a range of characters with UTF Encoding.
Definition: StringView.h:47