diff options
| author | Per Larsson <[email protected]> | 2021-09-28 15:08:37 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-09-28 15:08:37 +0200 |
| commit | 8727cffdf192b176a43e52141a86ab0a9b8d3983 (patch) | |
| tree | 99153a29b11525df32875d9d8dc29bf3ff53040c /zencore/include | |
| parent | Compact binary to JSON (#12) (diff) | |
| download | zen-8727cffdf192b176a43e52141a86ab0a9b8d3983.tar.xz zen-8727cffdf192b176a43e52141a86ab0a9b8d3983.zip | |
Removed using the bucket name to detect binary cache records and store content type in cache.
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index 6ee40e468..21751cd40 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -26,6 +26,35 @@ enum class ZenContentType : uint8_t kCOUNT }; +inline std::string_view +ToString(ZenContentType ContentType) +{ + using namespace std::literals; + + switch (ContentType) + { + default: + case ZenContentType::kUnknownContentType: + return "unknown"sv; + case ZenContentType::kBinary: + return "binary"sv; + case ZenContentType::kText: + return "text"sv; + case ZenContentType::kJSON: + return "json"sv; + case ZenContentType::kCbObject: + return "cb-object"sv; + case ZenContentType::kCbPackage: + return "cb-package"sv; + case ZenContentType::kCbPackageOffer: + return "cb-package-offer"sv; + case ZenContentType::kCompressedBinary: + return "compressed-binary"sv; + case ZenContentType::kYAML: + return "yaml"sv; + } +} + struct IoBufferFileReference { void* FileHandle; |