mirror of
https://github.com/nasa/fprime.git
synced 2025-12-11 04:35:25 -06:00
* Add new Fw::StringBase type StaticString for strings backed my immutable literals * Spellcheck fix * Add disclaimer comment about use of StaticString * Refactor the StringBase interface into an immutable ConstStringBase abstract base class and the now mutable StringBase class * Rename StaticString to ConstExternalString and inherit from ConstStringBase * Fix typo * Change references from StringBase to ConstStringBase where applicable * Updates following review meeting: add missing deserialize function and add new error status, move length function implementation into ConstStringBase so it is not pure virtual * Clang format fix * Additional clang-format fixes * Fix the copy-assignment operator for StringBase not being correctly evaluated * Clang format fix * Explicitly delete the Serializable assignment operator and provide a skeleton implementation for RawTimeInterface to appease the compiler * Revert "Explicitly delete the Serializable assignment operator and provide a skeleton implementation for RawTimeInterface to appease the compiler" This reverts commit 086d7bcd3ca9c4f6e553d7fc34d0d126a69a165b. * Move ConstStringBase to separate hpp/cpp files, plus other pull request feedback * Clang format fix * Update length implementation for ConstStringBase and ConstExternalString * Improved asserts in ConstExternalString constructor Co-authored-by: Rob Bocchino <bocchino@icloud.com> * Fixed ConstStringBase length implementation Co-authored-by: Rob Bocchino <bocchino@icloud.com> * Clang format fix * Add some UTs for ConstExternalString, fix non-overridden interfaces, and fix ConstStringBase::maxLength asserting for zero capacity strings * Spell-check fix for ConstExternalString UTs * Revise length implementation in ConstStringBase If the capacity is zero, return zero * Format --------- Co-authored-by: Ian Brault <ian.r.brault@jpl.nasa.gov> Co-authored-by: Rob Bocchino <bocchino@icloud.com> Co-authored-by: Rob Bocchino <bocchino@jpl.nasa.gov> Co-authored-by: M Starch <LeStarch@googlemail.com>
65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
// ======================================================================
|
|
// \title ValidatedFile.hpp
|
|
// \author bocchino
|
|
// \brief An fprime validated file
|
|
//
|
|
// \copyright
|
|
// Copyright (C) 2017 California Institute of Technology.
|
|
// ALL RIGHTS RESERVED. United States Government Sponsorship
|
|
// acknowledged.
|
|
//
|
|
// ======================================================================
|
|
|
|
#ifndef OS_ValidatedFile_HPP
|
|
#define OS_ValidatedFile_HPP
|
|
|
|
#include <Fw/FPrimeBasicTypes.hpp>
|
|
#include "Fw/Types/String.hpp"
|
|
#include "Os/ValidateFile.hpp"
|
|
|
|
namespace Os {
|
|
|
|
//! A validated file
|
|
class ValidatedFile {
|
|
public:
|
|
//! Construct a validated file
|
|
ValidatedFile(const char* const fileName //!< The file name
|
|
);
|
|
|
|
public:
|
|
//! Validate the file
|
|
//! \return Status
|
|
Os::ValidateFile::Status validate();
|
|
|
|
//! Create the hash file
|
|
//! \return Status
|
|
Os::ValidateFile::Status createHashFile();
|
|
|
|
public:
|
|
//! Get the file name
|
|
//! \return The file name
|
|
const Fw::ConstStringBase& getFileName() const;
|
|
|
|
//! Get the hash file name
|
|
//! \return The hash file name
|
|
const Fw::ConstStringBase& getHashFileName() const;
|
|
|
|
//! Get the hash file buffer
|
|
//! \return The hash file buffer
|
|
const Utils::HashBuffer& getHashBuffer() const;
|
|
|
|
private:
|
|
//! The file name
|
|
Fw::String m_fileName;
|
|
|
|
//! The hash file name
|
|
Fw::String m_hashFileName;
|
|
|
|
//! The hash value after creating or loading a validation file
|
|
Utils::HashBuffer m_hashBuffer;
|
|
};
|
|
|
|
} // namespace Os
|
|
|
|
#endif
|