AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
HyperlinkDataTokenizer Class Reference

Public Member Functions

 HyperlinkDataTokenizer (std::string_view str)
 
template<typename T >
bool TryConsumeTo (T &val)
 
bool IsEmpty ()
 

Private Attributes

std::string_view _str
 

Detailed Description

Constructor & Destructor Documentation

◆ HyperlinkDataTokenizer()

HyperlinkDataTokenizer::HyperlinkDataTokenizer ( std::string_view  str)
inline
30: _str(str) {}
std::string_view _str
Definition: HyperlinkTags.cpp:57

Member Function Documentation

◆ IsEmpty()

◆ TryConsumeTo()

template<typename T >
bool HyperlinkDataTokenizer::TryConsumeTo ( T &  val)
inline
34 {
35 if (IsEmpty())
36 return false;
37
38 if (std::size_t off = _str.find(HYPERLINK_DATA_DELIMITER); off != std::string_view::npos)
39 {
41 return false;
42 _str = _str.substr(off+1);
43 }
44 else
45 {
47 return false;
48 _str = std::string_view();
49 }
50
51 return true;
52 }
static constexpr char HYPERLINK_DATA_DELIMITER
Definition: HyperlinkTags.cpp:25
static bool StoreTo(std::string_view &val, std::string_view data)
Definition: Hyperlinks.h:107
bool IsEmpty()
Definition: HyperlinkTags.cpp:54

References _str, HYPERLINK_DATA_DELIMITER, IsEmpty(), and Acore::Hyperlinks::LinkTags::base_tag::StoreTo().

Referenced by Acore::Hyperlinks::LinkTags::achievement::StoreTo(), Acore::Hyperlinks::LinkTags::glyph::StoreTo(), Acore::Hyperlinks::LinkTags::item::StoreTo(), Acore::Hyperlinks::LinkTags::quest::StoreTo(), Acore::Hyperlinks::LinkTags::enchant::StoreTo(), Acore::Hyperlinks::LinkTags::spell::StoreTo(), Acore::Hyperlinks::LinkTags::talent::StoreTo(), and Acore::Hyperlinks::LinkTags::trade::StoreTo().

Member Data Documentation

◆ _str

std::string_view HyperlinkDataTokenizer::_str
private

Referenced by IsEmpty(), and TryConsumeTo().