MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_metadata()

std::optional< FileMetadata > MayaFlux::IO::XmlReader::get_metadata ( ) const
nodiscardoverridevirtual

XML format, MIME type, and source file size.

Implements MayaFlux::IO::FileReader.

Definition at line 235 of file XmlReader.cpp.

236{
237 if (!m_rows)
238 return std::nullopt;
239
240 FileMetadata metadata;
241 metadata.format = "xml";
242 metadata.mime_type = "application/xml";
243
244 std::error_code error;
245 metadata.file_size = std::filesystem::file_size(m_filepath, error);
246 if (error)
247 metadata.file_size = 0;
248
249 return metadata;
250}
std::optional< Kakshya::CompositeArray > m_rows
void error(Component component, Context context, std::source_location location, std::string_view message)
Log an error message and optionally throw an exception.

References MayaFlux::IO::FileMetadata::file_size, MayaFlux::IO::FileMetadata::format, m_filepath, m_rows, and MayaFlux::IO::FileMetadata::mime_type.