just some refactoring thoughts

This commit is contained in:
Blue 2023-09-17 16:34:00 -03:00
parent 198677fc18
commit b92b66c101
Signed by: blue
GPG key ID: 9B203B252A63EE38
10 changed files with 159 additions and 5 deletions

40
src2/component.h Normal file
View file

@ -0,0 +1,40 @@
#pragma once
#include <string>
#include <filesystem>
#include "loggger.h"
#include "collection.h"
class Component {
public:
enum State {
initial,
reading,
building,
ready
};
enum Type {
unknown,
file,
directory,
mason
};
Component(Logger* logger, Collection* collection);
virtual ~Component();
Type getType() const;
Type getState() const;
virtual void read(const std::filesystem::path& path) = 0;
virtual void build(const std::filesystem::path& destination, const std::string& target) = 0;
protected:
State state;
Type type;
Logger* logger;
Collection* collection;
std::filesystem::path location;
};