LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ui::qt::ExportManager Namespace Reference

Namespaces

namespace  anonymous_namespace{ExportManager.cpp}
 

Functions

util::Result< void, error::Error > ToCsv (const QAbstractItemModel &model, const std::vector< int > &rows, const QString &path)
 Export the given view rows to a CSV file.
 
util::Result< void, error::Error > ToJson (const QAbstractItemModel &model, const std::vector< int > &rows, const QString &path)
 Export the given view rows to a JSON file.
 
util::Result< void, error::Error > ToXml (const QAbstractItemModel &model, const std::vector< int > &rows, const QString &path)
 Export the given view rows to an XML file.
 

Function Documentation

◆ ToCsv()

util::Result< void, error::Error > ui::qt::ExportManager::ToCsv ( const QAbstractItemModel &  model,
const std::vector< int > &  rows,
const QString &  path 
)

Export the given view rows to a CSV file.

The first row of the output is a header derived from the model's horizontal header data. Each subsequent row corresponds to one entry in rows. Fields containing commas, double-quotes, or newlines are quoted per RFC 4180.

Parameters
modelThe item model (e.g. EventsTableModel) to read data from.
rowsView row indices to export (in order).
pathDestination file path.
Returns
Ok on success, Err(IOError) if the file could not be opened for writing.
Here is the call graph for this function:

◆ ToJson()

util::Result< void, error::Error > ui::qt::ExportManager::ToJson ( const QAbstractItemModel &  model,
const std::vector< int > &  rows,
const QString &  path 
)

Export the given view rows to a JSON file.

Output is a JSON array of objects. Each object maps column header names to cell values, e.g. [{"timestamp": "...", "level": "ERROR"}, ...].

Parameters
modelThe item model to read data from.
rowsView row indices to export (in order).
pathDestination file path.
Returns
Ok on success, Err(IOError) if the file could not be opened for writing.
Here is the call graph for this function:

◆ ToXml()

util::Result< void, error::Error > ui::qt::ExportManager::ToXml ( const QAbstractItemModel &  model,
const std::vector< int > &  rows,
const QString &  path 
)

Export the given view rows to an XML file.

Output is a well-formed XML document with a root <events> element. Each row becomes an <event> child; column values are stored as attributes. Attribute names are derived from the model's horizontal header data.

Parameters
modelThe item model to read data from.
rowsView row indices to export (in order).
pathDestination file path.
Returns
Ok on success, Err(IOError) if the file could not be opened for writing.
Here is the call graph for this function: