MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / StringEncodingGetSize

Function StringEncodingGetSize

Libraries/Common/StringSpan.h:43–43  ·  view source on GitHub ↗

@brief Returns the number of bytes to represent an utf unit in the given encoding @param encoding The encoding @return number of bytes of the given encoding

Source from the content-addressed store, hash-verified

41/// @param encoding The encoding
42/// @return number of bytes of the given encoding
43constexpr uint32_t StringEncodingGetSize(StringEncoding encoding) { return encoding == StringEncoding::Utf16 ? 2 : 1; }
44
45/// @brief An read-only view over a string (to avoid including @ref group_strings library when parsing is not needed).
46/// The most common use case is to pass it in and out of OS API as is for file system paths.

Callers 9

convertUtf8Utf16Method · 0.85
pathEndsWithFunction · 0.85
trimEndFunction · 0.85
findLastSeparatorFunction · 0.85
basenameFunction · 0.85
nextMethod · 0.85
parseUnsignedByteFunction · 0.85
writeToMethod · 0.85

Calls

no outgoing calls

Tested by 1

convertUtf8Utf16Method · 0.68