| 3 | #include "CompoundFile.h" |
| 4 | |
| 5 | class BinaryEventDataSerializer : public IEventDataSerializer { |
| 6 | public: |
| 7 | // Inherited via IEventDataSerializer |
| 8 | virtual bool Save(const std::vector<std::shared_ptr<EventData>>& events, const EventDataSerializerOptions& options, PCWSTR path) override; |
| 9 | virtual std::vector<std::shared_ptr<EventData>> Load(PCWSTR path) override; |
| 10 | |
| 11 | private: |
| 12 | void WriteMetadata(StructuredStorage::CompoundFile* file, const std::vector<std::shared_ptr<EventData>>& events); |
| 13 | void WriteEventData(StructuredStorage::StructuredDirectory* dir, const EventData* data); |
| 14 | void WriteSimpleData(StructuredStorage::StructuredDirectory* dir, PCWSTR streamName, const void* data, int size); |
| 15 | void WriteSimpleData(StructuredStorage::StructuredDirectory* dir, PCWSTR streamName, const std::wstring& value); |
| 16 | template<typename T> |
| 17 | void WriteSimpleData(StructuredStorage::StructuredDirectory* dir, PCWSTR streamName, const T& data) { |
| 18 | static_assert(std::is_trivially_constructible<T>::value); |
| 19 | WriteSimpleData(dir, streamName, &data, sizeof(data)); |
| 20 | } |
| 21 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected