Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:51:43

0001 /*
0002  * FileObject.h
0003  *
0004  *  Created on: May 17, 2016
0005  *      Author: debian
0006  */
0007 
0008 #ifndef FILEOBJECT_H_
0009 #define FILEOBJECT_H_
0010 
0011 #include <string>
0012 
0013 #include "../../BaseObject.h"
0014 
0015 namespace PARTONS {
0016 
0017 class CryptographicHashService;
0018 
0019 /**
0020  * @class FileObject
0021  *
0022  * @brief Class representing single text file.
0023  *
0024  * This class represents a single text file. It contains path to the file, its content and a hash sum of this content.
0025  */
0026 class FileObject: public BaseObject {
0027 
0028 public:
0029 
0030     /**
0031      * Default constructor.
0032      */
0033     FileObject();
0034 
0035     /**
0036      * Copy constructor.
0037      * @param other Object to be copied.
0038      */
0039     FileObject(const FileObject &other);
0040 
0041     /**
0042     * Constructor.
0043     * @param className Name of class.
0044     * @param filePath Path to file.
0045     * @param hashSum Hash sum of file content.
0046     * @param file String containing file content.
0047     */
0048    FileObject(const std::string &className,
0049            const std::string& filePath,
0050            const std::string& hashSum, const std::string& file);
0051 
0052     /**
0053      * Destructor.
0054      */
0055     virtual ~FileObject();
0056 
0057     //********************************************************
0058     //*** SETTERS AND GETTERS ********************************
0059     //********************************************************
0060 
0061     /**
0062      * Get path to the file.
0063      */
0064     const std::string& getFilePath() const;
0065 
0066     /**
0067      * Set path to the file.
0068      */
0069     void setFilePath(const std::string& filePath);
0070 
0071     /**
0072      * Get content of the file.
0073      */
0074     const std::string& getFile() const;
0075 
0076     /**
0077      * Set content of the file.
0078      */
0079     void setFile(const std::string& file);
0080 
0081     /**
0082      * Get hash sum of file's content.
0083      */
0084     const std::string& getHashSum() const;
0085 
0086     /**
0087      * Set hash sum of file's content.
0088      */
0089     void setHashSum(const std::string& hashSum);
0090 
0091 private:
0092 
0093     /**
0094      * Pointer to CryptographicHashService.
0095      */
0096     CryptographicHashService* m_pCryptographicHashService;
0097 
0098     /**
0099      * Path to the file.
0100      */
0101     std::string m_filePath;
0102 
0103     /**
0104      * Content of the file.
0105      */
0106     std::string m_file;
0107 
0108     /**
0109      * Hash sum of file's content.
0110      */
0111     std::string m_hashSum;
0112 };
0113 
0114 } /* namespace PARTONS */
0115 
0116 #endif /* FILEOBJECT_H_ */