MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / SetString

Method SetString

src/plugin/kernel/include/AFCDataList.hpp:732–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

730 }
731
732 virtual bool SetString(size_t index, const char* value)
733 {
734 assert(value != nullptr);
735
736 if (index >= mnDataUsed)
737 {
738 return false;
739 }
740
741 if (mpData[index].nType != ArkDataType::DT_STRING)
742 {
743 return false;
744 }
745
746 char* p = mpBuffer + mpData[index].mnstrValue;
747 const size_t size1 = strlen(value) + 1;
748
749 if (size1 <= (strlen(p) + 1))
750 {
751 ARK_STRNCPY(p, value, size1);
752 return true;
753 }
754
755 mpData[index].mnstrValue = mnDataUsed;
756 const size_t value_size = strlen(value) + 1;
757 char* v = AddBuffer(value_size);
758 memcpy(v, value, value_size);
759
760 return true;
761 }
762
763 virtual bool SetPointer(size_t index, void* value)
764 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected