E-MailRelay

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
GVerifiers::VerifierFactory Class Reference

A VerifierFactory implementation. More...

`#include <gverifierfactory.h>`

Inheritance diagram for GVerifiers::VerifierFactory:
[legend]
Collaboration diagram for GVerifiers::VerifierFactory:
[legend]

## Public Member Functions
| VerifierFactory ()
| Constructor.
Public Member Functions inherited from GSmtp::VerifierFactoryBase
virtual std::unique_ptr< Verifier > | newVerifier (GNet::EventState, const Verifier::Config &config, const Spec &spec)=0
| Returns a Verifier on the heap. More...
virtual | ~VerifierFactoryBase ()=default
| Destructor.

## Static Public Member Functions
static Spec | parse (std::string_view spec, const G::Path &base_dir={}, const G::Path &app_dir={}, G::StringArray *warnings_p=nullptr)
| Parses a verifier specification string like "/usr/bin/foo" or "net:127.0.0.1:99" or "net:/run/spamd.s", returning the type and value in a Spec tuple, eg. More...

## Protected Member Functions
std::unique_ptr< GSmtp::Verifier > | newVerifier (GNet::EventState, const GSmtp::Verifier::Config &config, const GSmtp::VerifierFactoryBase::Spec &spec) override
| Returns a Verifier on the heap. More...

## Detailed Description

A VerifierFactory implementation.

Definition at line 42 of file gverifierfactory.h.

## Member Function Documentation

## ◆ newVerifier()

std::unique_ptr< GSmtp::Verifier > GVerifiers::VerifierFactory::newVerifier | ( | GNet::EventState | ,
|  | const GSmtp::Verifier::Config & | config,
|  | const GSmtp::VerifierFactoryBase::Spec & | spec
| ) |  |
| override protected virtual

Returns a Verifier on the heap.

Throws if an invalid or unsupported specification.

Implements GSmtp::VerifierFactoryBase.

Definition at line 76 of file gverifierfactory.cpp.

## ◆ parse()

GVerifiers::VerifierFactory::Spec GVerifiers::VerifierFactory::parse | ( | std::string_view | spec,
|  | const G::Path & | base_dir = `{}`,
|  | const G::Path & | app_dir = `{}`,
|  | G::StringArray * | warnings_p = `nullptr`
| ) |  |
| static

Parses a verifier specification string like "/usr/bin/foo" or "net:127.0.0.1:99" or "net:/run/spamd.s", returning the type and value in a Spec tuple, eg.

("file","/usr/bin/foo") or ("net","127.0.0.1:99").

Any relative file paths are made absolute using the given base directory, if given. (This is normally from G::Process::cwd() called at startup).

Any "@app" sub-strings in file paths are substituted with the given application directory, if given.

Returns 'first' empty if a fatal parsing error, with the reason in 'second'.

Returns warnings by reference for non-fatal errors, such as missing files.

Definition at line 36 of file gverifierfactory.cpp.

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

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gverifiers/gverifierfactory.h
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gverifiers/gverifierfactory.cpp