34 lines
590 B
C++
34 lines
590 B
C++
//
|
|
// Created by versustune on 24.02.20.
|
|
//
|
|
|
|
#ifndef ELIYA_FILEVALIDATOR_H
|
|
#define ELIYA_FILEVALIDATOR_H
|
|
|
|
|
|
#include "../Models/AudioFile.h"
|
|
#include <taglib/fileref.h>
|
|
|
|
/*
|
|
* this class validate if the file is a audio file
|
|
*/
|
|
struct ValidateObject {
|
|
TagLib::FileRef ref;
|
|
bool isValid = true;
|
|
};
|
|
|
|
class FileValidator {
|
|
private:
|
|
AudioFile defaultFile;
|
|
public:
|
|
FileValidator() = default;
|
|
~FileValidator() = default;
|
|
ValidateObject * validate(const std::string& path);
|
|
AudioFile getAudioFile(ValidateObject *object);
|
|
|
|
protected:
|
|
};
|
|
|
|
|
|
#endif //ELIYA_FILEVALIDATOR_H
|