C_runtime/blob.hpp
author Edouard Tisserant <edouard.tisserant@gmail.com>
Wed, 05 Jun 2024 15:05:54 +0200
changeset 3954 5744391252ec
parent 3940 934bd46a7500
permissions -rw-r--r--
merge
3940
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     1
#ifndef BLOB_HPP
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     2
#define BLOB_HPP
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     3
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     4
#include <string>
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     5
#include <filesystem>
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     6
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     7
#include "md5.hpp"
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     8
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
     9
class Blob
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    10
{
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    11
public:
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    12
    Blob(uint8_t *seedData, size_t seedLength);
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    13
    ~Blob();
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    14
    MD5::digest_t digest();
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    15
    uint32_t appendChunk(uint8_t *data, size_t length);
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    16
    uint32_t asFile(std::filesystem::path &filename);
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    17
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    18
private:
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    19
    MD5 md5;
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    20
    std::FILE * m_file;
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    21
    std::filesystem::path m_filename;
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    22
};
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    23
934bd46a7500 C++ runtime: WIP: untested PLCObject implementation. Still missing tracing.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents:
diff changeset
    24
#endif // BLOB_HPP