/**
This file is a part of rexy's matrix client
Copyright (C) 2019-2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
#include "matrix/iterable.hpp"
namespace matrix::sync{
template
roomcxn_event_list_base::roomcxn_event_list_base(raii::rjp_ptr& root, RJP_value* event, const raii::string_base& roomid):
iterable_room_event_base>(event, roomid),
m_root(root.release()){}
template
raii::static_string roomcxn_event_list_base::start_token(void)const&{
RJP_value* st = rjp_search_member(m_root.get(), "start");
return raii::static_string(rjp_get_cstring(st)->value, rjp_get_cstring(st)->length);
}
template
raii::rjp_string roomcxn_event_list_base::start_token(void)&&{
return raii::rjp_string(rjp_search_member(m_root.get(), "start"));
}
template
raii::static_string roomcxn_event_list_base::end_token(void)const&{
RJP_value* st = rjp_search_member(m_root.get(), "end");
return raii::static_string(rjp_get_cstring(st)->value, rjp_get_cstring(st)->length);
}
template
raii::rjp_string roomcxn_event_list_base::end_token(void)&&{
return raii::rjp_string(rjp_search_member(m_root.get(), "end"));
}
template class roomcxn_event_list_base;
}