MCPcopy Create free account
hub / github.com/comaps/comaps / SetTagValue

Method SetTagValue

libs/editor/xml_feature.cpp:617–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617void XMLFeature::SetTagValue(string_view key, string_view value)
618{
619 strings::Trim(value);
620 auto tag = FindTag(m_document, key);
621 if (!tag)
622 {
623 tag = GetRootNode().append_child("tag");
624 tag.append_attribute("k").set_value(key.data(), key.size());
625 tag.append_attribute("v").set_value(value.data(), value.size());
626 }
627 else
628 {
629 tag.attribute("v").set_value(value.data(), value.size());
630 }
631}
632
633void XMLFeature::RemoveTag(string_view key)
634{

Callers 4

ToXMLFunction · 0.80
SaveMethod · 0.80
UNIT_TESTFunction · 0.80
UNIT_TESTFunction · 0.80

Calls 4

TrimFunction · 0.85
FindTagFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by 2

UNIT_TESTFunction · 0.64
UNIT_TESTFunction · 0.64