E-MailRelay
Classes | Static Public Member Functions | List of all members
GSmtp::FactoryParser Class Reference

A simple static class to parse identifiers that are either a program path or a network address. More...

#include <gfactoryparser.h>

Classes

struct  Result
 Result tuple for GSmtp::FactoryParser::parse(). More...
 

Static Public Member Functions

static Result parse (const std::string &identifier, bool allow_spam)
 Parses an identifier like "/usr/bin/foo" or "net:127.0.0.1:99" or "net:/run/spamd.s", returning the type and the specification in a result tuple, eg. More...
 
static std::string check (const std::string &identifier, bool allow_spam)
 Parses and checks an identifier. More...
 

Detailed Description

A simple static class to parse identifiers that are either a program path or a network address.

Used by the filter factory and the address-verifier factory.

Definition at line 38 of file gfactoryparser.h.

Member Function Documentation

◆ check()

std::string GSmtp::FactoryParser::check ( const std::string &  identifier,
bool  allow_spam 
)
static

Parses and checks an identifier.

Returns a diagnostic if the identifier is invalid, or the empty string if valid or empty.

Definition at line 63 of file gfactoryparser.cpp.

◆ parse()

GSmtp::FactoryParser::Result GSmtp::FactoryParser::parse ( const std::string &  identifier,
bool  allow_spam 
)
static

Parses an identifier like "/usr/bin/foo" or "net:127.0.0.1:99" or "net:/run/spamd.s", returning the type and the specification in a result tuple, eg.

("file","/usr/bin/foo") or ("net","127.0.0.1:99"). Returns a default-constructed Result if not parsable.

Definition at line 30 of file gfactoryparser.cpp.


The documentation for this class was generated from the following files: