aboutsummaryrefslogtreecommitdiff
path: root/zencore/include
diff options
context:
space:
mode:
authorMartin Ridgers <[email protected]>2021-10-25 08:55:48 +0200
committerMartin Ridgers <[email protected]>2021-10-25 08:55:48 +0200
commit11a96d0892907155aca82197bad3b8f0a8696057 (patch)
tree11311a913e06f04ac35ceb9e1d96434a5bd78080 /zencore/include
parentImplemented filecas.cpp for POSIX platforms (diff)
parentzenserver: Tweaked state initialization so we know when we're running for the... (diff)
downloadzen-11a96d0892907155aca82197bad3b8f0a8696057.tar.xz
zen-11a96d0892907155aca82197bad3b8f0a8696057.zip
Merged main
Diffstat (limited to 'zencore/include')
-rw-r--r--zencore/include/zencore/compress.h2
-rw-r--r--zencore/include/zencore/fmtutils.h1
-rw-r--r--zencore/include/zencore/iobuffer.h5
-rw-r--r--zencore/include/zencore/refcount.h5
-rw-r--r--zencore/include/zencore/string.h2
-rw-r--r--zencore/include/zencore/windows.h2
6 files changed, 11 insertions, 6 deletions
diff --git a/zencore/include/zencore/compress.h b/zencore/include/zencore/compress.h
index 426b4981a..d37ecfa79 100644
--- a/zencore/include/zencore/compress.h
+++ b/zencore/include/zencore/compress.h
@@ -105,6 +105,8 @@ public:
/** Returns the hash of the raw data. Zero on error or if this is null. */
[[nodiscard]] ZENCORE_API BLAKE3 GetRawHash() const;
+ [[nodiscard]] ZENCORE_API CompressedBuffer CopyRange(uint64_t RawOffset, uint64_t RawSize = ~uint64_t(0)) const;
+
/**
* Returns the compressor and compression level used by this buffer.
*
diff --git a/zencore/include/zencore/fmtutils.h b/zencore/include/zencore/fmtutils.h
index 7e60c2bef..70867fe72 100644
--- a/zencore/include/zencore/fmtutils.h
+++ b/zencore/include/zencore/fmtutils.h
@@ -6,7 +6,6 @@
#include <zencore/string.h>
#include <zencore/uid.h>
-
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
ZEN_THIRD_PARTY_INCLUDES_END
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h
index 847bed606..b1d13c58f 100644
--- a/zencore/include/zencore/iobuffer.h
+++ b/zencore/include/zencore/iobuffer.h
@@ -358,7 +358,10 @@ public:
[[nodiscard]] ZENCORE_API bool GetFileReference(IoBufferFileReference& OutRef) const;
template<typename T>
- [[nodiscard]] const T* Data() const { return reinterpret_cast<const T*>(m_Core->DataPointer()); }
+ [[nodiscard]] const T* Data() const
+ {
+ return reinterpret_cast<const T*>(m_Core->DataPointer());
+ }
private:
RefPtr<IoBufferCore> m_Core = new IoBufferCore;
diff --git a/zencore/include/zencore/refcount.h b/zencore/include/zencore/refcount.h
index 325863051..92ebebcfe 100644
--- a/zencore/include/zencore/refcount.h
+++ b/zencore/include/zencore/refcount.h
@@ -117,9 +117,8 @@ public:
inline ~Ref() { m_Ref && m_Ref->Release(); }
template<typename DerivedType>
- requires std::derived_from<DerivedType, T> inline Ref(const Ref<DerivedType>& Rhs) : Ref(Rhs.m_Ref)
- {
- }
+ requires std::derived_from<DerivedType, T>
+ inline Ref(const Ref<DerivedType>& Rhs) : Ref(Rhs.m_Ref) {}
[[nodiscard]] inline bool IsNull() const { return m_Ref == nullptr; }
inline explicit operator bool() const { return m_Ref != nullptr; }
diff --git a/zencore/include/zencore/string.h b/zencore/include/zencore/string.h
index 47fd5643d..23193501c 100644
--- a/zencore/include/zencore/string.h
+++ b/zencore/include/zencore/string.h
@@ -649,7 +649,7 @@ ToLower(const std::string_view& InString)
for (char& CurChar : Out)
{
- CurChar -= (uint8_t(CurChar - 'A') <= ('Z' - 'A')) * ('A' - 'a'); // this should be compiled into branchless logic
+ CurChar -= (uint8_t(CurChar - 'A') <= ('Z' - 'A')) * ('A' - 'a'); // this should be compiled into branchless logic
}
return Out;
diff --git a/zencore/include/zencore/windows.h b/zencore/include/zencore/windows.h
index 621621ae8..68138566b 100644
--- a/zencore/include/zencore/windows.h
+++ b/zencore/include/zencore/windows.h
@@ -2,6 +2,8 @@
#pragma once
+#include <zencore/zencore.h>
+
ZEN_THIRD_PARTY_INCLUDES_START
struct IUnknown; // Workaround for "combaseapi.h(229): error C2187: syntax error: 'identifier' was unexpected here" when using /permissive-