48 lines
1.8 KiB
C++
48 lines
1.8 KiB
C++
/**
|
|
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 <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#include "matrix/iterable.hpp"
|
|
|
|
namespace matrix::sync{
|
|
template<class T>
|
|
roomcxn_event_list_base<T>::roomcxn_event_list_base(raii::rjp_ptr& root, RJP_value* event, const raii::string_base& roomid):
|
|
iterable_room_event_base<detail::room_event_iterator<T>>(event, roomid),
|
|
m_root(root.release()){}
|
|
template<class T>
|
|
raii::static_string roomcxn_event_list_base<T>::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<class T>
|
|
raii::rjp_string roomcxn_event_list_base<T>::start_token(void)&&{
|
|
return raii::rjp_string(rjp_search_member(m_root.get(), "start"));
|
|
}
|
|
template<class T>
|
|
raii::static_string roomcxn_event_list_base<T>::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<class T>
|
|
raii::rjp_string roomcxn_event_list_base<T>::end_token(void)&&{
|
|
return raii::rjp_string(rjp_search_member(m_root.get(), "end"));
|
|
}
|
|
|
|
template class roomcxn_event_list_base<room_state_event>;
|
|
}
|
|
|