MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
FileContainer.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "StreamContainer.hpp"
4
5namespace MayaFlux::Kakshya {
6
7/**
8 * @brief Marker interface for containers backed by file storage (in-memory only).
9 *
10 * Carries the origin path and format string populated by IO classes at load
11 * time. All disk I/O, decoding, and metadata operations remain in IO classes.
12 * Uses virtual inheritance to support the diamond inheritance pattern with
13 * SoundStreamContainer and VideoStreamContainer.
14 */
15class MAYAFLUX_API FileContainer : public virtual StreamContainer {
16public:
17 virtual ~FileContainer() = default;
18
19 /**
20 * @brief Absolute path of the file this container was loaded from.
21 * @return Empty string if the container was not loaded from a file.
22 */
23 [[nodiscard]] const std::string& get_source_path() const { return m_source_path; }
24
25 /**
26 * @brief Short format identifier as reported by the demuxer (e.g. "wav", "mp4", "flac").
27 * @return Empty string if not set.
28 */
29 [[nodiscard]] const std::string& get_source_format() const { return m_source_format; }
30
31 /**
32 * @brief Set the origin file path. Called by IO classes after a successful load.
33 * @param path Absolute or relative path used to open the file.
34 */
35 void set_source_path(std::string path) { m_source_path = std::move(path); }
36
37 /**
38 * @brief Set the format identifier. Called by IO classes after a successful load.
39 * @param fmt Short format string from the demuxer context.
40 */
41 void set_source_format(std::string fmt) { m_source_format = std::move(fmt); }
42
43protected:
44 std::string m_source_path;
45 std::string m_source_format;
46};
47
48} // namespace MayaFlux::Kakshya
const std::string & get_source_path() const
Absolute path of the file this container was loaded from.
void set_source_format(std::string fmt)
Set the format identifier.
virtual ~FileContainer()=default
void set_source_path(std::string path)
Set the origin file path.
const std::string & get_source_format() const
Short format identifier as reported by the demuxer (e.g.
Marker interface for containers backed by file storage (in-memory only).
Data-driven interface for temporal stream containers with navigable read position.