GnuCash  5.6-150-g038405b370+
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. More...
 
virtual bool type_check (const char *)=0
 Distinguish two providers with same access method. More...
 

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.

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 QofXmlBackendProvider, and QofDbiBackendProvider< Type >.

◆ 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 >, QofDbiBackendProvider< Type >, and QofXmlBackendProvider.


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