Public Member Functions | Public Attributes | List of all members
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.

7036 {
7037 const char_t* pos = find_char(name, ':');
7038
7039 prefix = pos ? name : 0;
7040 prefix_length = pos ? static_cast<size_t>(pos - name) : 0;
7041 }
PUGI__FN const char_t * find_char(const char_t *s, char_t c)
Definition pugixml.cpp:6545
const char_t * prefix
Definition pugixml.cpp:7032

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.

7044 {
7045 const char_t* name = a.name();
7046
7047 if (!starts_with(name, PUGIXML_TEXT("xmlns"))) return false;
7048
7049 return prefix ? name[5] == ':' && strequalrange(name + 6, prefix, prefix_length) : name[5] == 0;
7050 }
PUGI__NS_END PUGI__NS_BEGIN PUGI__FN bool starts_with(const char_t *string, const char_t *pattern)
Definition pugixml.cpp:6534
PUGI__FN bool strequalrange(const char_t *lhs, const char_t *rhs, size_t count)
Definition pugixml.cpp:200

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:

Generated on Sun Mar 31 2024 07:07:24 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001