#include "Lexesis/backendmanager.h"
#include "Lexesis/backend.h"

namespace lxs {
    void BackendManager::registerBackend(std::unique_ptr<Backend> backend) {
        m_backends.push_back(std::move(backend));
    }
    
    Backend* BackendManager::findBackendForLang(std::string lang) {
        for(std::unique_ptr<Backend> &backend: m_backends) {
            if(backend->canProcessLang(lang)) return backend.get();
        }
        return nullptr;
    }
}
