mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-29 06:15:24 +00:00
Convenience functions to_hex(memory_cptr), find_and_clone_binary<>()
This commit is contained in:
parent
77b24f3422
commit
ae4b8c7e13
@ -203,6 +203,21 @@ GetFirstOrNextChild(EbmlMaster *master,
|
||||
return nullptr == previous_child ? GetChild<A>(*master) : GetNextChild<A>(*master, *previous_child);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
memory_cptr
|
||||
find_and_clone_binary(EbmlElement &parent) {
|
||||
auto child = FindChild<T>(static_cast<EbmlMaster &>(parent));
|
||||
if (child)
|
||||
return memory_c::clone(child->GetBuffer(), child->GetSize());
|
||||
return memory_cptr{};
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
memory_cptr
|
||||
find_and_clone_binary(EbmlElement *parent) {
|
||||
return find_and_clone_binary<T>(*parent);
|
||||
}
|
||||
|
||||
EbmlElement *empty_ebml_master(EbmlElement *e);
|
||||
EbmlElement *create_ebml_element(const EbmlCallbacks &callbacks, const EbmlId &id);
|
||||
EbmlMaster *sort_ebml_master(EbmlMaster *e);
|
||||
|
@ -64,6 +64,11 @@ to_hex(const std::string &buf,
|
||||
bool compact = false) {
|
||||
return to_hex(reinterpret_cast<const unsigned char *>(buf.c_str()), buf.length(), compact);
|
||||
}
|
||||
inline std::string
|
||||
to_hex(memory_cptr const &buf,
|
||||
bool compact = false) {
|
||||
return to_hex(buf->get_buffer(), buf->get_size(), compact);
|
||||
}
|
||||
|
||||
std::string create_minutes_seconds_time_string(unsigned int seconds, bool omit_minutes_if_zero = false);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user