gitbase.h 584 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef GITBASE_H
  2. #define GITBASE_H
  3. #include <gitrepository.h>
  4. #include <QObject>
  5. #include <git2/types.h>
  6. class GitRepository;
  7. template <typename T>
  8. class GitBase : public QObject
  9. {
  10. public:
  11. GitBase(T* raw, GitRepository* parent) : QObject(parent)
  12. ,m_raw(raw)
  13. ,m_repository(parent)
  14. {}
  15. T* raw() const {
  16. return m_raw;
  17. }
  18. bool isValid() const {
  19. return m_raw != nullptr;
  20. }
  21. GitRepository* repository() const {
  22. return m_repository;
  23. }
  24. protected:
  25. T* m_raw;
  26. GitRepository* m_repository;
  27. };
  28. #endif // GITBASE_H