|
SVCS - English Documentation
|
Represents the content of a file (Binary Large Object). More...
#include <Blob.hxx>
Public Member Functions | |
| Blob (std::string raw_data) | |
| Constructor for the Blob object. | |
| std::string | getType () const override |
| Returns the type of the VCS object. | |
| std::string | serialize () const override |
| Serializes the object's core data for hashing and storage. | |
| const std::string & | getData () const |
| Returns the raw data content stored in the Blob. | |
| Public Member Functions inherited from svcs::core::VcsObject | |
| VcsObject ()=default | |
| Default constructor. Required for derived classes. | |
| VcsObject (const VcsObject &other)=default | |
| Copy constructor. Required for derived classes to correctly copy the hash_id. | |
| virtual | ~VcsObject ()=default |
| Virtual destructor. | |
| std::string | getHashId () const |
| Returns the unique hash identifier of the object. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from svcs::core::VcsObject | |
| static std::string | calculateHash (const std::string &content) |
| Calculates SHA-256 hash for given canonical content. | |
| Protected Member Functions inherited from svcs::core::VcsObject | |
| void | computeHash (const std::string &content) |
| Computes the cryptographic hash ID for the object's content. | |
| Protected Attributes inherited from svcs::core::VcsObject | |
| std::string | hash_id |
| The unique cryptographic hash identifier (e.g., SHA-256) for this object. | |
Represents the content of a file (Binary Large Object).
This is the lowest-level object in the VCS, storing only raw file bytes. The Blob object is immutable; its hash is solely dependent on its content.
| svcs::core::Blob::Blob | ( | std::string | raw_data | ) |
Constructor for the Blob object.
Initializes the object and immediately computes its hash ID based on the raw_data.
| raw_data | The raw file content to be stored and hashed. |
|
nodiscard |
Returns the raw data content stored in the Blob.
|
nodiscardoverridevirtual |
Returns the type of the VCS object.
This is crucial for object storage and reconstruction (e.g., "commit", "blob", "tree").
Implements svcs::core::VcsObject.
|
nodiscardoverridevirtual |
Serializes the object's core data for hashing and storage.
The returned string content is what will be hashed and stored in the database.
Implements svcs::core::VcsObject.