mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-11-04 21:09:06 +01:00
26 lines
593 B
C++
26 lines
593 B
C++
#include "icsneo/device/extensions/bootloader/parser/fwloader.h"
|
|
#include "icsneo/device/extensions/bootloader/parser/fwbin.h"
|
|
#include "icsneo/device/extensions/bootloader/parser/fwbundle.h"
|
|
|
|
namespace icsneo {
|
|
|
|
namespace Bootloader {
|
|
|
|
std::unique_ptr<FWRepo> FWLoader::Load(const std::string& path) {
|
|
if(FWBundle::IsFWBundle(path)) {
|
|
auto bundle = std::make_unique<FWBundle>();
|
|
if(!bundle->load(path))
|
|
return nullptr;
|
|
return bundle;
|
|
}
|
|
|
|
auto bin = std::make_unique<FWBin>();
|
|
if(!bin->load(path))
|
|
return nullptr;
|
|
return bin;
|
|
}
|
|
|
|
} // namespace Bootloader
|
|
|
|
} // namespace icsneo
|