nsresult ISOControl::GenerateFtyp() { nsresult rv; uint32_t size; nsAutoPtr<FileTypeBox> type_box(new FileTypeBox(this)); rv = type_box->Generate(&size); NS_ENSURE_SUCCESS(rv, rv); rv = type_box->Write(); NS_ENSURE_SUCCESS(rv, rv); return NS_OK; }
template<class T> T open_box (blackbox bb) { ASSERT (type_box (bb) == type_helper<T>::id, "type mismatch"); return ((whitebox_rep<T>*) bb.rep) -> data; }