MCPcopy Create free account
hub / github.com/OpenAssetIO/OpenAssetIO / assignStringView

Function assignStringView

src/openassetio-core-c/src/StringView.hpp:22–25  ·  view source on GitHub ↗

* Copy a source string to a destination C StringView. * * If the `dest` has insufficient `capacity` to hold the `src` string, * then the string is truncated at `capacity` characters. * * @param dest Target string. * @param src Source string. */

Source from the content-addressed store, hash-verified

20 * @param src Source string.
21 */
22inline void assignStringView(oa_StringView* dest, const std::string_view src) {
23 dest->size = std::min(src.size(), dest->capacity);
24 std::memcpy(dest->data, src.data(), dest->size);
25}
26} // namespace OPENASSETIO_CORE_ABI_VERSION
27} // namespace openassetio

Callers 8

extractExceptionMessageFunction · 0.85
getFunction · 0.85
oa_InfoDictionary_getStrFunction · 0.85
StringViewTest.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected