gitreference.h 787 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef GITREFERENCE_H
  2. #define GITREFERENCE_H
  3. #include <gitbase.h>
  4. class GitRepository;
  5. struct git_reference;
  6. class GitReference : public GitBase<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. protected:
  25. GitReference(git_reference* ref, GitRepository* parent);
  26. void free();
  27. ReferenceNamespace m_namespace;
  28. private:
  29. GitReference();
  30. Q_DISABLE_COPY(GitReference)
  31. void detectNamespace();
  32. };
  33. #endif // GITREFERENCE_H