F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
ValidateFile.hpp
Go to the documentation of this file.
1 
13 #ifndef _ValidateFile_hpp_
14 #define _ValidateFile_hpp_
15 
16 #define VFILE_HASH_CHUNK_SIZE (256)
17 
19 
20 namespace Os {
21 
22 namespace ValidateFile {
23 
24 // This class encapsulates a very simple file interface for validating files against their hash files
25 // and creating validation files
26 
27 typedef enum {
28  // Did the validation hash match the file hash or not?
31  // Did we have issues reading in the file?
35  // Did we have issues reading in the hash file?
39  // Did something else go wrong?
42 } Status;
43 
44 // also return hash
45 Status validate(const char* fileName, const char* hashFileName, Utils::HashBuffer& hashBuffer);
47 
48 // for backwards compatibility
49 Status validate(const char* fileName, const char* hashFileName);
50 
52 // also return hash
53 Status createValidation(const char* fileName, const char* hash, Utils::HashBuffer& hashBuffer);
54 
55 // for backwards compatibility
56 Status createValidation(const char* fileName,
57  const char* hashFileName);
58 
60 } // namespace ValidateFile
61 } // namespace Os
62 
63 #endif
File doesn't exist (for read)
No permission to read/write file.
A catch-all for other errors. Have to look in implementation-specific code.
Invalid size parameter.
Validation file doesn't exist (for read)
The validation of the file passed.
Status validate(const char *fileName, const char *hashFileName, Utils::HashBuffer &hashBuffer)
Validate the contents of a file 'fileName' against its hash.
Status createValidation(const char *fileName, const char *hash, Utils::HashBuffer &hashBuffer)
No space left on the device for writing.
No permission to read/write file.
A container class for holding a hash buffer.
Definition: HashBuffer.hpp:26
The validation of the file did not pass.