Add Link::min_id() and allow for alphanumeric IDs.
This commit is contained in:
parent
8b197134ab
commit
c3a5df62e5
|
@ -101,8 +101,8 @@ Easy::Link::Link(const string &link_header)
|
||||||
: _next()
|
: _next()
|
||||||
, _prev()
|
, _prev()
|
||||||
{
|
{
|
||||||
std::regex renext("max_id=([[:digit:]]*)");
|
std::regex renext("max_id=([[:alnum:]]*)");
|
||||||
std::regex reprev("since_id=([[:digit:]]*)");
|
std::regex reprev("(?:since|min)_id=([[:alnum:]]*)");
|
||||||
std::smatch match;
|
std::smatch match;
|
||||||
|
|
||||||
if (std::regex_search(link_header, match, renext))
|
if (std::regex_search(link_header, match, renext))
|
||||||
|
@ -134,3 +134,8 @@ const string Easy::Link::since_id() const
|
||||||
{
|
{
|
||||||
return _prev;
|
return _prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const string Easy::Link::min_id() const
|
||||||
|
{
|
||||||
|
return _prev;
|
||||||
|
}
|
||||||
|
|
|
@ -89,6 +89,13 @@ namespace Easy
|
||||||
*/
|
*/
|
||||||
const string since_id() const;
|
const string since_id() const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief Returns min_id.
|
||||||
|
*
|
||||||
|
* @since 0.111.0
|
||||||
|
*/
|
||||||
|
const string min_id() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
string _next;
|
string _next;
|
||||||
string _prev;
|
string _prev;
|
||||||
|
|
Reference in New Issue