src/repositories.h

changeset 52
e9edc3bd0301
parent 37
d7e9a1200e21
equal deleted inserted replaced
51:49fdc2eb7cd4 52:e9edc3bd0301
23 */ 23 */
24 24
25 #ifndef REPOSITORIES_H 25 #ifndef REPOSITORIES_H
26 #define REPOSITORIES_H 26 #define REPOSITORIES_H
27 27
28 #include <filesystem>
28 #include <string> 29 #include <string>
29 #include <vector> 30 #include <vector>
30 31
31 namespace fm { 32 namespace fm {
32 33
43 }; 44 };
44 45
45 class repositories final { 46 class repositories final {
46 std::vector<repository> m_repositories; 47 std::vector<repository> m_repositories;
47 public: 48 public:
49 [[nodiscard]] static bool exists(const std::string &path);
48 void scan(std::string path, unsigned depth); 50 void scan(std::string path, unsigned depth);
49 [[nodiscard]] const std::vector<repository>& list() const { 51 [[nodiscard]] const std::vector<repository>& list() const {
50 return m_repositories; 52 return m_repositories;
53 }
54 [[nodiscard]] size_t count() const {
55 return m_repositories.size();
51 } 56 }
52 }; 57 };
53 58
54 } // fm 59 } // fm
55 60

mercurial