0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-26 21:04:25 +08:00

Added bool set_value(const char_t* rhs, size_t sz).

This commit is contained in:
Viktor Govako 2022-04-13 12:25:01 +03:00
parent 363ebdde91
commit effc46f0ed
2 changed files with 8 additions and 2 deletions

View File

@ -5329,11 +5329,16 @@ namespace pugi
return impl::strcpy_insitu(_attr->name, _attr->header, impl::xml_memory_page_name_allocated_mask, rhs, impl::strlength(rhs)); return impl::strcpy_insitu(_attr->name, _attr->header, impl::xml_memory_page_name_allocated_mask, rhs, impl::strlength(rhs));
} }
PUGI__FN bool xml_attribute::set_value(const char_t* rhs) PUGI__FN bool xml_attribute::set_value(const char_t* rhs, size_t sz)
{ {
if (!_attr) return false; if (!_attr) return false;
return impl::strcpy_insitu(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs, impl::strlength(rhs)); return impl::strcpy_insitu(_attr->value, _attr->header, impl::xml_memory_page_value_allocated_mask, rhs, sz);
}
PUGI__FN bool xml_attribute::set_value(const char_t* rhs)
{
return set_value(rhs, impl::strlength(rhs));
} }
PUGI__FN bool xml_attribute::set_value(int rhs) PUGI__FN bool xml_attribute::set_value(int rhs)

View File

@ -416,6 +416,7 @@ namespace pugi
// Set attribute name/value (returns false if attribute is empty or there is not enough memory) // Set attribute name/value (returns false if attribute is empty or there is not enough memory)
bool set_name(const char_t* rhs); bool set_name(const char_t* rhs);
bool set_value(const char_t* rhs, size_t sz);
bool set_value(const char_t* rhs); bool set_value(const char_t* rhs);
// Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false") // Set attribute value with type conversion (numbers are converted to strings, boolean is converted to "true"/"false")