GnuCash c935c2f+
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
QofBackendProvider Struct Referenceabstract
Inheritance diagram for QofBackendProvider:
QofDbiBackendProvider< Type > QofXmlBackendProvider

Public Member Functions

 QofBackendProvider (const char *name, const char *type)
 
 QofBackendProvider (QofBackendProvider &)=delete
 
 QofBackendProvider (QofBackendProvider &&)=delete
 
virtual QofBackendcreate_backend (void)=0
 Return a new, fully initialized backend.
 
virtual bool type_check (const char *)=0
 Distinguish two providers with same access method.
 

Data Fields

const char * provider_name
 Some arbitrary name given for this particular backend provider.
 
const char * access_method
 The access method that this provider provides, for example, file:// http:// postgres:// or sqlite://, but without the :// at the end.
 

Detailed Description

Definition at line 30 of file gnc-backend-prov.hpp.

Constructor & Destructor Documentation

◆ QofBackendProvider()

QofBackendProvider::QofBackendProvider ( const char *  name,
const char *  type 
)
inline

Definition at line 32 of file gnc-backend-prov.hpp.

32 :
33 provider_name {name}, access_method {type} {}
const char * provider_name
Some arbitrary name given for this particular backend provider.
const char * access_method
The access method that this provider provides, for example, file:// http:// postgres:// or sqlite://,...

◆ ~QofBackendProvider()

virtual QofBackendProvider::~QofBackendProvider ( )
inlinevirtual

Definition at line 36 of file gnc-backend-prov.hpp.

36{}

Member Function Documentation

◆ create_backend()

virtual QofBackend * QofBackendProvider::create_backend ( void  )
pure virtual

Return a new, fully initialized backend.

If the backend supports configuration, all configuration options should be initialised to usable values here.

Implemented in QofDbiBackendProvider< Type >, and QofXmlBackendProvider.

◆ type_check()

virtual bool QofBackendProvider::type_check ( const char *  )
pure virtual

Distinguish two providers with same access method.

More than 1 backend can be registered under the same access_method, so each one is passed the path to the data (e.g. a file) and should return TRUE only:

  1. if the backend recognises the type as one that it can load and write or
  2. if the path contains no data but can be used (e.g. a new session).

    Note
    If the backend can cope with more than one type, the backend should not try to store or cache the sub-type for this data. It is sufficient only to return TRUE if any ONE of the supported types match the incoming data. The backend should not assume that returning TRUE will mean that the data will naturally follow.

Implemented in QofDbiBackendProvider< Type >, QofXmlBackendProvider, and QofDbiBackendProvider< Type >.

Field Documentation

◆ access_method

const char* QofBackendProvider::access_method

The access method that this provider provides, for example, file:// http:// postgres:// or sqlite://, but without the :// at the end.

Definition at line 67 of file gnc-backend-prov.hpp.

◆ provider_name

const char* QofBackendProvider::provider_name

Some arbitrary name given for this particular backend provider.

Definition at line 62 of file gnc-backend-prov.hpp.


The documentation for this struct was generated from the following file: