|
SVCS - English Documentation
|
Helper class for testing the non-abstract methods of VcsObject. More...
#include <VcsObject.hxx>
Public Member Functions | |
| TestableObject (std::string type, std::string data) | |
| Primary constructor. | |
| std::string | serialize () const override |
| Implementation of the pure virtual method. Returns the stored content. | |
| std::string | getType () const override |
| Implementation of the pure virtual method. Returns the stored type name. | |
| 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. | |
Helper class for testing the non-abstract methods of VcsObject.
This class implements all pure virtual methods of VcsObject with simple stubs, allowing its instances to be created for unit testing the hashing logic in VcsObject::computeHash.
| svcs::core::TestableObject::TestableObject | ( | std::string | type, |
| std::string | data ) |
Primary constructor.
| type | The name of the object type (e.g., "test_blob"). |
| data | The content that will be serialized and hashed. |
|
nodiscardoverridevirtual |
Implementation of the pure virtual method. Returns the stored type name.
Pure virtual method to get the type of the VCS object.
This is crucial for object storage and reconstruction (e.g., "commit", "blob", "tree").
Implements svcs::core::VcsObject.
|
nodiscardoverridevirtual |
Implementation of the pure virtual method. Returns the stored content.
Pure virtual method to serialize the object's core data.
The returned string content is what will be hashed and stored in the database.
Implements svcs::core::VcsObject.