mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
* Fixed shadow warnings from Fprime * Fix unit tests * Fix missing shadow warnings * Fix condition in cmake * Fix cmake * Fixes from review * Fixed mistake in PathName * Fixing comment --------- Co-authored-by: M Starch <LeStarch@googlemail.com>
70 lines
1.6 KiB
C++
70 lines
1.6 KiB
C++
// ======================================================================
|
|
// \title ValidatedFile.cpp
|
|
// \author bocchino
|
|
// \brief Os::ValidatedFile implementation
|
|
//
|
|
// \copyright
|
|
// Copyright (C) 2017 California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
//
|
|
// ======================================================================
|
|
|
|
#include "Os/ValidatedFile.hpp"
|
|
#include "Utils/Hash/Hash.hpp"
|
|
|
|
namespace Os {
|
|
|
|
ValidatedFile ::
|
|
ValidatedFile(const char *const fileName) :
|
|
m_fileName(fileName),
|
|
m_hashFileName(""),
|
|
m_hashBuffer()
|
|
{
|
|
Utils::Hash::addFileExtension(this->m_fileName, this->m_hashFileName);
|
|
}
|
|
|
|
Os::ValidateFile::Status ValidatedFile ::
|
|
validate()
|
|
{
|
|
const Os::ValidateFile::Status status =
|
|
Os::ValidateFile::validate(
|
|
this->m_fileName.toChar(),
|
|
this->m_hashFileName.toChar(),
|
|
this->m_hashBuffer
|
|
);
|
|
return status;
|
|
}
|
|
|
|
Os::ValidateFile::Status ValidatedFile ::
|
|
createHashFile()
|
|
{
|
|
const Os::ValidateFile::Status status =
|
|
Os::ValidateFile::createValidation(
|
|
this->m_fileName.toChar(),
|
|
this->m_hashFileName.toChar(),
|
|
this->m_hashBuffer
|
|
);
|
|
return status;
|
|
}
|
|
|
|
const Fw::StringBase& ValidatedFile ::
|
|
getFileName() const
|
|
{
|
|
return this->m_fileName;
|
|
}
|
|
|
|
const Fw::StringBase& ValidatedFile ::
|
|
getHashFileName() const
|
|
{
|
|
return this->m_hashFileName;
|
|
}
|
|
|
|
const Utils::HashBuffer& ValidatedFile ::
|
|
getHashBuffer() const
|
|
{
|
|
return this->m_hashBuffer;
|
|
}
|
|
|
|
}
|