LCOV - code coverage report
Current view: top level - core/project - qgsprojectstorageregistry.h (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 1 1 100.0 %
Date: 2021-04-10 08:29:14 Functions: 0 0 -
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /***************************************************************************
       2                 :            :   qgsprojectstorageregistry.h
       3                 :            :   --------------------------------------
       4                 :            :   Date                 : March 2018
       5                 :            :   Copyright            : (C) 2018 by Martin Dobias
       6                 :            :   Email                : wonder dot sk at gmail dot com
       7                 :            :  ***************************************************************************
       8                 :            :  *                                                                         *
       9                 :            :  *   This program is free software; you can redistribute it and/or modify  *
      10                 :            :  *   it under the terms of the GNU General Public License as published by  *
      11                 :            :  *   the Free Software Foundation; either version 2 of the License, or     *
      12                 :            :  *   (at your option) any later version.                                   *
      13                 :            :  *                                                                         *
      14                 :            :  ***************************************************************************/
      15                 :            : 
      16                 :            : #ifndef QGSPROJECTSTORAGEREGISTRY_H
      17                 :            : #define QGSPROJECTSTORAGEREGISTRY_H
      18                 :            : 
      19                 :            : #include "qgis_core.h"
      20                 :            : #include "qgis_sip.h"
      21                 :            : 
      22                 :            : #include <QHash>
      23                 :            : 
      24                 :            : class QgsProjectStorage;
      25                 :            : 
      26                 :            : /**
      27                 :            :  * \ingroup core
      28                 :            :  * \brief Registry of storage backends that QgsProject may use.
      29                 :            :  *
      30                 :            :  * This is a singleton that should be accessed through QgsApplication::projectStorageRegistry().
      31                 :            :  *
      32                 :            :  * \since QGIS 3.2
      33                 :            :  */
      34                 :          5 : class CORE_EXPORT QgsProjectStorageRegistry
      35                 :            : {
      36                 :            :   public:
      37                 :            :     ~QgsProjectStorageRegistry();
      38                 :            : 
      39                 :            :     //! Returns storage implementation if the storage type matches one. Returns NULLPTR otherwise (it is a normal file)
      40                 :            :     QgsProjectStorage *projectStorageFromType( const QString &type );
      41                 :            : 
      42                 :            :     //! Returns storage implementation if the URI matches one. Returns NULLPTR otherwise (it is a normal file)
      43                 :            :     QgsProjectStorage *projectStorageFromUri( const QString &uri );
      44                 :            : 
      45                 :            :     //! Returns a list of registered project storage implementations
      46                 :            :     QList<QgsProjectStorage *> projectStorages() const;
      47                 :            : 
      48                 :            :     //! Registers a storage backend and takes ownership of it
      49                 :            :     void registerProjectStorage( QgsProjectStorage *storage SIP_TRANSFER );
      50                 :            : 
      51                 :            :     //! Unregisters a storage backend and destroys its instance
      52                 :            :     void unregisterProjectStorage( QgsProjectStorage *storage );
      53                 :            : 
      54                 :            :   private:
      55                 :            :     QHash<QString, QgsProjectStorage *> mBackends;
      56                 :            : };
      57                 :            : 
      58                 :            : #endif // QGSPROJECTSTORAGEREGISTRY_H

Generated by: LCOV version 1.14