namespace_uri_predicate Struct Reference

## Public Member Functions

| namespace_uri_predicate (const char_t *name)
bool | operator() (const xml_attribute &a) const

## Public Attributes

const char_t * | prefix
size_t | prefix_length

## Detailed Description

Definition at line 7030 of file pugixml.cpp.

## Constructor & Destructor Documentation

## namespace_uri_predicate()

namespace_uri_predicate::namespace_uri_predicate | ( | const char_t * | name | ) |

inline

Definition at line 7035 of file pugixml.cpp.

{
const char_t* pos = find_char(name, ':');
prefix = pos ? name : 0;
prefix_length = pos ? static_cast<size_t>(pos - name) : 0;
}

References find_char(), prefix, and prefix_length.

## Member Function Documentation

## operator()()

bool namespace_uri_predicate::operator() | ( | const xml_attribute & | a | ) | const

inline

Definition at line 7043 of file pugixml.cpp.

{
const char_t* name = a.name();
if (!starts_with(name, PUGIXML_TEXT("xmlns"))) return false;
return prefix ? name[5] == ':' && strequalrange(name + 6, prefix, prefix_length) : name[5] == 0;
}

References prefix, prefix_length, starts_with(), and strequalrange().

## Member Data Documentation

## prefix

const char_t* namespace_uri_predicate::prefix

Definition at line 7032 of file pugixml.cpp.

Referenced by namespace_uri(), namespace_uri_predicate(), and operator()().

## prefix_length

size_t namespace_uri_predicate::prefix_length

Definition at line 7033 of file pugixml.cpp.

Referenced by namespace_uri_predicate(), and operator()().

The documentation for this struct was generated from the following file:

- pugixml.cpp

find_char
const PUGI__FN char_t * find_char(const char_t *s, char_t c)
Definition: pugixml.cpp:6545
namespace_uri_predicate::prefix
const char_t * prefix
Definition: pugixml.cpp:7032
starts_with
PUGI__NS_END PUGI__NS_BEGIN PUGI__FN bool starts_with(const char_t *string, const char_t *pattern)
Definition: pugixml.cpp:6534
namespace_uri_predicate::prefix_length
size_t prefix_length
Definition: pugixml.cpp:7033
strequalrange
PUGI__FN bool strequalrange(const char_t *lhs, const char_t *rhs, size_t count)
Definition: pugixml.cpp:200