Additional style fixes
This commit is contained in:
parent
63baf6da7f
commit
5f55411972
@ -236,6 +236,15 @@ PUGI__NS_END
|
||||
PUGI__NS_BEGIN
|
||||
template <typename T, typename D = void(*)(T*)> struct auto_deleter
|
||||
{
|
||||
// Non-copyable semantics
|
||||
#if __cplusplus >= 201103
|
||||
auto_deleter(const auto_deleter&) = delete;
|
||||
auto_deleter& operator=(const auto_deleter) = delete;
|
||||
#else
|
||||
auto_deleter(const auto_deleter&);
|
||||
auto_deleter& operator=(const auto_deleter);
|
||||
#endif
|
||||
|
||||
T* data;
|
||||
D deleter;
|
||||
|
||||
@ -483,7 +492,7 @@ PUGI__NS_BEGIN
|
||||
|
||||
struct xml_allocator
|
||||
{
|
||||
xml_allocator(xml_memory_page* root): _root(root), _busy_size(root->busy_size)
|
||||
explicit xml_allocator(xml_memory_page* root): _root(root), _busy_size(root->busy_size)
|
||||
{
|
||||
#ifdef PUGIXML_COMPACT
|
||||
_hash = 0;
|
||||
@ -1030,7 +1039,7 @@ namespace pugi
|
||||
{
|
||||
struct xml_attribute_struct
|
||||
{
|
||||
xml_attribute_struct(impl::xml_memory_page* page): header(page, 0), namevalue_base(0)
|
||||
explicit xml_attribute_struct(impl::xml_memory_page* page): header(page, 0), namevalue_base(0)
|
||||
{
|
||||
PUGI__STATIC_ASSERT(sizeof(xml_attribute_struct) == 8);
|
||||
}
|
||||
@ -1075,7 +1084,7 @@ namespace pugi
|
||||
{
|
||||
struct xml_attribute_struct
|
||||
{
|
||||
xml_attribute_struct(impl::xml_memory_page* page): header(reinterpret_cast<uintptr_t>(page)), name(0), value(0), prev_attribute_c(0), next_attribute(0)
|
||||
explicit xml_attribute_struct(impl::xml_memory_page* page): header(reinterpret_cast<uintptr_t>(page)), name(0), value(0), prev_attribute_c(0), next_attribute(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1120,7 +1129,7 @@ PUGI__NS_BEGIN
|
||||
|
||||
struct xml_document_struct: public xml_node_struct, public xml_allocator
|
||||
{
|
||||
xml_document_struct(xml_memory_page* page): xml_node_struct(page, node_document), xml_allocator(page), buffer(0), extra_buffers(0)
|
||||
explicit xml_document_struct(xml_memory_page* page): xml_node_struct(page, node_document), xml_allocator(page), buffer(0), extra_buffers(0)
|
||||
{
|
||||
#ifdef PUGIXML_COMPACT
|
||||
_hash = &hash;
|
||||
@ -2898,12 +2907,21 @@ PUGI__NS_BEGIN
|
||||
|
||||
struct xml_parser
|
||||
{
|
||||
// Non-copyable semantics
|
||||
#if __cplusplus >= 201103
|
||||
xml_parser(const xml_parser&) = delete;
|
||||
xml_parser& operator=(const xml_parser) = delete;
|
||||
#else
|
||||
xml_parser(const xml_parser&);
|
||||
xml_parser& operator=(const xml_parser);
|
||||
#endif
|
||||
|
||||
xml_allocator alloc;
|
||||
xml_allocator* alloc_state;
|
||||
char_t* error_offset;
|
||||
xml_parse_status error_status;
|
||||
|
||||
xml_parser(xml_allocator* alloc_): alloc(*alloc_), alloc_state(alloc_), error_offset(0), error_status(status_ok)
|
||||
explicit xml_parser(xml_allocator* alloc_): alloc(*alloc_), alloc_state(alloc_), error_offset(0), error_status(status_ok)
|
||||
{
|
||||
}
|
||||
|
||||
@ -3142,7 +3160,6 @@ PUGI__NS_BEGIN
|
||||
{
|
||||
// load into registers
|
||||
xml_node_struct* cursor = ref_cursor;
|
||||
char_t ch = 0;
|
||||
|
||||
// parse node contents, starting with question mark
|
||||
++s;
|
||||
@ -3160,6 +3177,8 @@ PUGI__NS_BEGIN
|
||||
|
||||
if (declaration ? PUGI__OPTSET(parse_declaration) : PUGI__OPTSET(parse_pi))
|
||||
{
|
||||
char_t ch = 0;
|
||||
|
||||
if (declaration)
|
||||
{
|
||||
// disallow non top-level declarations
|
||||
@ -7430,7 +7449,16 @@ PUGI__NS_BEGIN
|
||||
|
||||
struct xpath_allocator_capture
|
||||
{
|
||||
xpath_allocator_capture(xpath_allocator* alloc): _target(alloc), _state(*alloc)
|
||||
// Non-copyable semantics
|
||||
#if __cplusplus >= 201103
|
||||
xpath_allocator_capture(const xpath_allocator_capture&) = delete;
|
||||
xpath_allocator_capture& operator=(const xpath_allocator_capture) = delete;
|
||||
#else
|
||||
xpath_allocator_capture(const xpath_allocator_capture&);
|
||||
xpath_allocator_capture& operator=(const xpath_allocator_capture);
|
||||
#endif
|
||||
|
||||
explicit xpath_allocator_capture(xpath_allocator* alloc): _target(alloc), _state(*alloc)
|
||||
{
|
||||
}
|
||||
|
||||
@ -8148,7 +8176,7 @@ PUGI__NS_BEGIN
|
||||
const char_t* prefix;
|
||||
size_t prefix_length;
|
||||
|
||||
namespace_uri_predicate(const char_t* name)
|
||||
explicit namespace_uri_predicate(const char_t* name)
|
||||
{
|
||||
const char_t* pos = find_char(name, ':');
|
||||
|
||||
@ -8168,7 +8196,7 @@ PUGI__NS_BEGIN
|
||||
|
||||
PUGI__FN const char_t* namespace_uri(xml_node node)
|
||||
{
|
||||
namespace_uri_predicate pred = node.name();
|
||||
namespace_uri_predicate pred(node.name());
|
||||
|
||||
xml_node p = node;
|
||||
|
||||
@ -8186,7 +8214,7 @@ PUGI__NS_BEGIN
|
||||
|
||||
PUGI__FN const char_t* namespace_uri(xml_attribute attr, xml_node parent)
|
||||
{
|
||||
namespace_uri_predicate pred = attr.name();
|
||||
namespace_uri_predicate pred(attr.name());
|
||||
|
||||
// Default namespace does not apply to attributes
|
||||
if (!pred.prefix) return PUGIXML_TEXT("");
|
||||
@ -8351,6 +8379,15 @@ PUGI__NS_BEGIN
|
||||
|
||||
struct xpath_variable_string: xpath_variable
|
||||
{
|
||||
// Non-copyable semantics
|
||||
#if __cplusplus >= 201103
|
||||
xpath_variable_string(const xpath_variable_string&) = delete;
|
||||
xpath_variable_string& operator=(const xpath_variable_string) = delete;
|
||||
#else
|
||||
xpath_variable_string(const xpath_variable_string&);
|
||||
xpath_variable_string& operator=(const xpath_variable_string);
|
||||
#endif
|
||||
|
||||
xpath_variable_string(): xpath_variable(xpath_type_string), value(0)
|
||||
{
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user