gitreference.h 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef GITREFERENCE_H
  2. #define GITREFERENCE_H
  3. #include <gitbaseoid.h>
  4. class GitRepository;
  5. struct git_reference;
  6. class GitReference : public GitBaseOid<git_reference>
  7. {
  8. Q_OBJECT
  9. Q_PROPERTY(ReferenceNamespace referenceNamespace READ referenceNamespace CONSTANT)
  10. Q_ENUMS(ReferenceNamespace)
  11. public:
  12. enum ReferenceNamespace {
  13. Invalid,
  14. Branch,
  15. Note,
  16. Tag,
  17. Remote
  18. };
  19. virtual ~GitReference();
  20. ReferenceNamespace referenceNamespace() const
  21. {
  22. return m_namespace;
  23. }
  24. QString refName() const;
  25. protected:
  26. GitReference(git_reference *ref, GitRepository *parent);
  27. GitReference(GitReference &&ref);
  28. GitReference &operator=(GitReference &&ref);
  29. void free();
  30. ReferenceNamespace m_namespace;
  31. private:
  32. GitReference();
  33. Q_DISABLE_COPY(GitReference)
  34. void detectNamespace();
  35. };
  36. #endif // GITREFERENCE_H