Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
namespace_uri_predicate Struct Reference

Public Member Functions

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

Public Attributes

const char_t * prefix
size_t prefix_length

Detailed Description

Definition at line 8607 of file pugixml.cc.

Constructor & Destructor Documentation

◆ namespace_uri_predicate()

namespace_uri_predicate::namespace_uri_predicate ( const char_t * name)
inline

Definition at line 8612 of file pugixml.cc.

8613 {
8614 const char_t* pos = find_char(name, ':');
8615
8616 prefix = pos ? name : 0;
8617 prefix_length = pos ? static_cast<size_t>(pos - name) : 0;
8618 }
const char * name(G4int ptype)
PUGIXML_CHAR char_t
Definition pugixml.hpp:137
PUGI__FN const char_t * find_char(const char_t *s, char_t c)
Definition pugixml.cc:8093
const char_t * prefix
Definition pugixml.cc:8609

Member Function Documentation

◆ operator()()

bool namespace_uri_predicate::operator() ( xml_attribute a) const
inline

Definition at line 8620 of file pugixml.cc.

8621 {
8622 const char_t* name = a.name();
8623
8624 if (!starts_with(name, PUGIXML_TEXT("xmlns"))) return false;
8625
8626 return prefix ? name[5] == ':' && strequalrange(name + 6, prefix, prefix_length) : name[5] == 0;
8627 }
PUGI__NS_END PUGI__NS_BEGIN PUGI__FN bool starts_with(const char_t *string, const char_t *pattern)
Definition pugixml.cc:8082
PUGI__FN bool strequalrange(const char_t *lhs, const char_t *rhs, size_t count)
Definition pugixml.cc:238
#define PUGIXML_TEXT(t)
Definition pugixml.hpp:130

Member Data Documentation

◆ prefix

const char_t* namespace_uri_predicate::prefix

Definition at line 8609 of file pugixml.cc.

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

◆ prefix_length

size_t namespace_uri_predicate::prefix_length

Definition at line 8610 of file pugixml.cc.

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


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