CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
CaptureMoment::Core::Serializer Namespace Reference

Classes

class  AppDataXmpPathStrategy
 Implementation of IXmpPathStrategy that stores XMP files in a centralized AppData directory. More...
 
class  ConfigurableXmpPathStrategy
 Implementation of IXmpPathStrategy that stores XMP files in a user-configured directory. More...
 
class  Exiv2Initializer
 Singleton-like class to handle Exiv2 XMP parser initialization and termination. More...
 
class  Exiv2Provider
 Concrete implementation of IXmpProvider using the Exiv2 library. More...
 
class  FileSerializerManager
 High-level manager orchestrating file-based serialization and deserialization of operation data. More...
 
class  FileSerializerReader
 Concrete implementation of IFileSerializerReader using an IXmpProvider for XMP operations and an IXmpPathStrategy to determine where to read the XMP file from. More...
 
class  FileSerializerWriter
 Concrete implementation of IFileSerializerWriter using an IXmpProvider for XMP operations and an IXmpPathStrategy to determine where to store/read the XMP file. More...
 
class  IFileSerializerReader
 Interface for reading serialized operation data from a file. More...
 
class  IFileSerializerWriter
 Interface for writing serialized operation data to a file. More...
 
class  IXmpPathStrategy
 Interface defining the strategy for determining XMP file paths based on image paths. More...
 
class  IXmpProvider
 Interface abstracting the service for reading/writing raw XMP packets to/from files. More...
 
class  SidecarXmpPathStrategy
 Implementation of IXmpPathStrategy that stores XMP files alongside the image file. More...
 

Functions

std::string serializeParameter (const Operations::OperationValue &value)
 Namespace containing utilities for serializing and deserializing OperationDescriptor parameters. This isolates the logic for converting OperationValue (std::variant) parameter values to/from string representations.
 
Operations::OperationValue deserializeParameter (std::string_view value_str)
 Deserializes a string representation back into an OperationValue. This function attempts to infer the type from the string content (e.g., "true" -> Bool, "3.14" -> Float, "10" -> Int).
 
std::string serializeOperationParameters (const Operations::OperationDescriptor &descriptor)
 Serializes an entire OperationDescriptor's parameters map to a string representation. Iterates through the 'params' map and serializes each value using serializeParameter.
 
bool deserializeOperationParameters (std::string_view params_str, Operations::OperationDescriptor &descriptor)
 Deserializes a string representation back into an OperationDescriptor's parameters map. Parses the input string and reconstructs the 'params' map using deserializeParameter.
 

Function Documentation

◆ serializeParameter()

std::string CaptureMoment::Core::Serializer::serializeParameter ( const Operations::OperationValue & value)
nodiscard

Namespace containing utilities for serializing and deserializing OperationDescriptor parameters. This isolates the logic for converting OperationValue (std::variant) parameter values to/from string representations.

Serializes a single OperationValue (variant) to a string representation. This function converts the value directly to a string without type tags. For example: Float 3.14 -> "3.14", Bool true -> "true", String "hello" -> "hello".

Parameters
valueThe OperationValue (variant) to serialize.
Returns
A string representing the value. Returns an empty string if the type is unsupported.

Definition at line 18 of file operation_serialization.cpp.

Referenced by serializeOperationParameters().

◆ deserializeParameter()

Operations::OperationValue CaptureMoment::Core::Serializer::deserializeParameter ( std::string_view value_str)
nodiscard

Deserializes a string representation back into an OperationValue. This function attempts to infer the type from the string content (e.g., "true" -> Bool, "3.14" -> Float, "10" -> Int).

Parameters
value_strThe string representation of the value.
Returns
An OperationValue (variant) containing the deserialized value. Defaults to std::string if the value doesn't match specific numeric or boolean patterns.

Definition at line 42 of file operation_serialization.cpp.

Referenced by deserializeOperationParameters().

◆ serializeOperationParameters()

std::string CaptureMoment::Core::Serializer::serializeOperationParameters ( const Operations::OperationDescriptor & descriptor)
nodiscard

Serializes an entire OperationDescriptor's parameters map to a string representation. Iterates through the 'params' map and serializes each value using serializeParameter.

Parameters
descriptorThe OperationDescriptor containing the parameters to serialize.
Returns
A string representing the serialized parameters map.

Definition at line 73 of file operation_serialization.cpp.

References CaptureMoment::Core::Operations::OperationDescriptor::params, and serializeParameter().

◆ deserializeOperationParameters()

bool CaptureMoment::Core::Serializer::deserializeOperationParameters ( std::string_view params_str,
Operations::OperationDescriptor & descriptor )
nodiscard

Deserializes a string representation back into an OperationDescriptor's parameters map. Parses the input string and reconstructs the 'params' map using deserializeParameter.

Parameters
params_strThe string representation of the parameters map.
descriptorThe OperationDescriptor to populate with the deserialized parameters. Its 'params' map will be cleared and filled.
Returns
true if the deserialization was successful, false otherwise.

Definition at line 86 of file operation_serialization.cpp.

References deserializeParameter(), and CaptureMoment::Core::Operations::OperationDescriptor::params.

CaptureMoment — footer