Redaction.h header
#include <ew/app/Redaction.h>
Namespace ew::app
RedactionResult struct
struct ew::app::RedactionResult
The result of redacting text: the redacted text (sensitive terms replaced by opaque placeholders) and the replacements needed to restore it (placeholder -> original value).
Members
QString ew::app::RedactionResult::text
The text with sensitive terms replaced by placeholders.
std::vector<std::pair<QString, QString> > ew::app::RedactionResult::replacements
Placeholder -> original, in the order assigned, for restoring a reply.
Functions
bool ew::app::isLocalAiEndpoint(const QString &endpoint)
True when endpoint targets the local machine (localhost / 127.0.0.1 / ::1 / 0.0.0.0), so a request sent to it never leaves the device. Used to decide whether cloud-privacy measures apply.
RedactionResult ew::app::redact(const QString &text, const std::vector< QString > &terms)
Replaces every occurrence of each non-empty term in terms (longest first, case-insensitive) with a stable opaque placeholder, returning the redacted text and the placeholder->original map so a reply can be un-redacted. Longer terms are handled first so a longer name is not broken up by a shorter one it contains.
QString ew::app::restore(const QString &text, const std::vector< std::pair< QString, QString > > &replacements)
Restores text by replacing each placeholder in replacements with its original value.