ImagingTools Core SDK
Static Public Member Functions | List of all members
imtsdlgenqml::CQmlGenTools

Utility class providing convenient methods for managing SDL QML code generation metadata. More...

#include <CQmlGenTools.h>

Static Public Member Functions

static bool ReadGenerationResultFile (CSdlQmlGenerationResult &result, const QString &filePath)
 Reads generation result metadata from a JSON file.
 
static bool WriteGenerationResultFile (CSdlQmlGenerationResult &result, const QString &filePath)
 Writes generation result metadata to a JSON file.
 
static bool UpdateGenerationResult (const QString &filePath, const CSdlQmlGenerationResult &updateData)
 Appends additional directories to existing generation result file with file locking protection.
 

Detailed Description

Utility class providing convenient methods for managing SDL QML code generation metadata.

Definition at line 19 of file CQmlGenTools.h.

Member Function Documentation

◆ ReadGenerationResultFile()

static bool imtsdlgenqml::CQmlGenTools::ReadGenerationResultFile ( CSdlQmlGenerationResult result,
const QString &  filePath 
)
static

Reads generation result metadata from a JSON file.

This method reads and deserializes the CSdlQmlGenerationResult object from a JSON file using iser::CJsonMemReadArchive.

Parameters
resultThe generation result object to populate with loaded data
filePathFull path to the JSON file to read from
Returns
true if the operation succeeded, false otherwise

◆ UpdateGenerationResult()

static bool imtsdlgenqml::CQmlGenTools::UpdateGenerationResult ( const QString &  filePath,
const CSdlQmlGenerationResult updateData 
)
static

Appends additional directories to existing generation result file with file locking protection.

This method reads the existing generation result file, adds new directories from the provided update data to the existing set, updates the creation timestamp, and writes the updated result back to the file. The entire operation (read, modify, write) is protected by a file lock to prevent concurrent access issues.

If the file doesn't exist, it creates a new one with the data from updateData.

Parameters
filePathFull path to the JSON file where the result should be updated
updateDataGeneration result object containing folders to append and optionally a creation timestamp
Returns
true if the operation succeeded, false otherwise
Note
If updateData contains a valid creation timestamp, it will be used; otherwise, the current UTC time is set

◆ WriteGenerationResultFile()

static bool imtsdlgenqml::CQmlGenTools::WriteGenerationResultFile ( CSdlQmlGenerationResult result,
const QString &  filePath 
)
static

Writes generation result metadata to a JSON file.

This is a helper method that writes the result to file using iser::CJsonMemWriteArchive.

Parameters
resultThe generation result object containing metadata to save
filePathFull path to the JSON file where the result should be saved
Returns
true if the operation succeeded, false otherwise
Note
Non-const reference required because Serialize() method is not const