SyndicationDomination 0.0
An RSS/Atom parser, because there's nothing else out there.
Loading...
Searching...
No Matches
Classes | Functions | Variables
SynDomUtils Namespace Reference

Classes

struct  xml_string_writer
 

Functions

bool __trim_filter (unsigned char ch)
 
void ltrim (std::string &s)
 Trims a string from the start, in place.
 
void rtrim (std::string &s)
 Trims a string from the end, in place.
 
void trim (std::string &s)
 Trims a string from both ends, in place.
 
void lower (std::string &s)
 Changes the string case to all lowercase, in place.
 
bool str_has_prefix (std::string s, std::string prefix)
 Checks if the string s has the prefix prefix.
 
std::vector< std::string > split (std::string s, char delim)
 Splits a string into an std::vector of strings, using a single character delimiter.
 
std::string current_time ()
 Returns the current date and time in ISO 8601 format, with UTC offset.
 
bool is_url (std::string s)
 Rudimentarily checks if the provided string is a URL.
 
std::string extract_from_node (pugi::xml_node node, std::vector< ExtractionParam > params)
 Searches for a certain value, starting from a provided pugi::xml_node, using a vector of ExtractionParam objects to examine different possible alternatives.
 
std::string extract_link (pugi::xml_node node, std::vector< std::string > rels, std::vector< std::string > types, bool opt_rel=false, bool opt_type=false)
 Searches for a certain value pertaining to a <link /> node.
 

Variables

const std::string ATOM_LINK_TAGS []
 

Function Documentation

◆ __trim_filter()

bool SynDomUtils::__trim_filter ( unsigned char  ch)
inline

◆ current_time()

std::string SynDomUtils::current_time ( )
inline

Returns the current date and time in ISO 8601 format, with UTC offset.

◆ extract_from_node()

std::string SynDomUtils::extract_from_node ( pugi::xml_node  node,
std::vector< ExtractionParam params 
)
inline

Searches for a certain value, starting from a provided pugi::xml_node, using a vector of ExtractionParam objects to examine different possible alternatives.

Parameters
nodethe pugi::xml_node treated as the root node for the search.
paramssee ExtractionParam

◆ extract_link()

std::string SynDomUtils::extract_link ( pugi::xml_node  node,
std::vector< std::string >  rels,
std::vector< std::string >  types,
bool  opt_rel = false,
bool  opt_type = false 
)
inline

Searches for a certain value pertaining to a <link /> node.

Parameters
nodethe pugi::xml root node containing the <link /> node(s).
relsa list of possible acceptable values for the rel attribute.
typesa list of possible acceptable values for the type attribute.
opt_relcan optionally be set to true to accept values where the rel attribute is absent or empty.
opt_typecan optionally be set to true to accept values where the type attribute is absent or empty.

◆ is_url()

bool SynDomUtils::is_url ( std::string  s)
inline

Rudimentarily checks if the provided string is a URL.

◆ lower()

void SynDomUtils::lower ( std::string &  s)
inline

Changes the string case to all lowercase, in place.

◆ ltrim()

void SynDomUtils::ltrim ( std::string &  s)
inline

Trims a string from the start, in place.

◆ rtrim()

void SynDomUtils::rtrim ( std::string &  s)
inline

Trims a string from the end, in place.

◆ split()

std::vector< std::string > SynDomUtils::split ( std::string  s,
char  delim 
)
inline

Splits a string into an std::vector of strings, using a single character delimiter.

Parameters
sthe input string.
delimthe single character delimiter to be used to split the string.

◆ str_has_prefix()

bool SynDomUtils::str_has_prefix ( std::string  s,
std::string  prefix 
)
inline

Checks if the string s has the prefix prefix.

Parameters
sthe input string.
prefixthe prefix to search for.

◆ trim()

void SynDomUtils::trim ( std::string &  s)
inline

Trims a string from both ends, in place.

Variable Documentation

◆ ATOM_LINK_TAGS

const std::string SynDomUtils::ATOM_LINK_TAGS[]
Initial value:
= {
"link", "atom:link", "atom10:link"
}