MCPcopy Create free account
hub / github.com/MyGUI/mygui / add

Method add

Tools/EditorFramework/pugixml.cpp:10821–10843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10819 }
10820
10821 PUGI__FN xpath_variable* xpath_variable_set::add(const char_t* name, xpath_value_type type)
10822 {
10823 const size_t hash_size = sizeof(_data) / sizeof(_data[0]);
10824 size_t hash = impl::hash_string(name) % hash_size;
10825
10826 // look for existing variable
10827 for (xpath_variable* var = _data[hash]; var; var = var->_next)
10828 if (impl::strequal(var->name(), name))
10829 return var->type() == type ? var : 0;
10830
10831 // add new variable
10832 xpath_variable* result = impl::new_xpath_variable(type, name);
10833
10834 if (result)
10835 {
10836 result->_type = type;
10837 result->_next = _data[hash];
10838
10839 _data[hash] = result;
10840 }
10841
10842 return result;
10843 }
10844
10845 PUGI__FN bool xpath_variable_set::set(const char_t* name, bool value)
10846 {

Callers

nothing calls this directly

Calls 5

hash_stringFunction · 0.70
strequalFunction · 0.70
new_xpath_variableFunction · 0.70
nameMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected