aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-10-03 12:35:44 +0200
committerGitHub Enterprise <[email protected]>2024-10-03 12:35:44 +0200
commitdb531191789f48a141c42fef229bca7a7922443d (patch)
treecc1570bf8dedccb975d594bd91284ac5d0bd0bae /src/zencore/include
parentsimplified CleanDirectory implementation (#182) (diff)
downloadzen-db531191789f48a141c42fef229bca7a7922443d.tar.xz
zen-db531191789f48a141c42fef229bca7a7922443d.zip
cache get command (#183)
* move TryParseObjectId and TryParseIoHash to Oid::TryParse and IoHash::TryParse respectively * zen cache-get command
Diffstat (limited to 'src/zencore/include')
-rw-r--r--src/zencore/include/zencore/iohash.h1
-rw-r--r--src/zencore/include/zencore/uid.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/iohash.h b/src/zencore/include/zencore/iohash.h
index a8fc9e6c1..9c9f487bb 100644
--- a/src/zencore/include/zencore/iohash.h
+++ b/src/zencore/include/zencore/iohash.h
@@ -50,6 +50,7 @@ struct IoHash
static IoHash HashBuffer(const IoBuffer& Buffer);
static IoHash FromHexString(const char* string);
static IoHash FromHexString(const std::string_view string);
+ static bool TryParse(std::string_view Str, IoHash& Hash);
const char* ToHexString(char* outString /* 40 characters + NUL terminator */) const;
StringBuilderBase& ToHexString(StringBuilderBase& outBuilder) const;
std::string ToHexString() const;
diff --git a/src/zencore/include/zencore/uid.h b/src/zencore/include/zencore/uid.h
index 08a335392..1b6fc3f6a 100644
--- a/src/zencore/include/zencore/uid.h
+++ b/src/zencore/include/zencore/uid.h
@@ -63,6 +63,7 @@ struct Oid
const Oid& Generate();
[[nodiscard]] static Oid FromHexString(const std::string_view String);
[[nodiscard]] static Oid TryFromHexString(const std::string_view String, const Oid& Default = Oid::Zero);
+ static bool TryParse(std::string_view Str, Oid& Id);
StringBuilderBase& ToString(StringBuilderBase& OutString) const;
void ToString(char OutString[StringLength]) const;
std::string ToString() const;