CommonLib
Loading...
Searching...
No Matches
hash_provider.h
Go to the documentation of this file.
1#pragma once
2
3#include <type_traits>
4
5namespace hedgedev::csl::hash
6{
7 template <typename T>
9 {
10 public:
11 using type = T;
12
13 virtual bool reset() = 0;
14 virtual bool update(const uint8_t* in_data, const size_t in_length) = 0;
15 virtual T digest() = 0;
16 };
17
18 template <typename T>
20}
Definition hash_provider.h:9
virtual bool update(const uint8_t *in_data, const size_t in_length)=0
T type
Definition hash_provider.h:11
Definition hash_provider.h:19
Definition xxhash64_provider.inl:4
bool write_all_text(const std::filesystem::path &in_path, const T &in_str, bool in_write_bom)
Definition file.inl:301
constexpr uint64_t k_optimal_buffer_size
Definition file.inl:20
bool compare(std::ifstream &in_left, std::ifstream &in_right, bool in_from_beginning, hash_progress_callback_t< typename T::type > in_left_callback, hash_progress_callback_t< typename T::type > in_right_callback)
Definition file.inl:99
ut::encoding::encoding_type get_encoding(const std::filesystem::path &in_path, ut::encoding::encoding_type *out_bom, bool in_native)
Definition file.inl:213
bool try_compute_hash(hash::hash_provider< T > &in_hash_provider, std::ifstream &in_file, T &out_hash, bool in_from_beginning, hash_progress_callback_t< T > in_callback)
Definition file.inl:23
bool try_compute_hash(hash::hash_provider< T > &in_hash_provider, const std::filesystem::path &in_path, T &out_hash, hash_progress_callback_t< T > in_callback)
Definition file.inl:78
bool try_compute_hash(const std::filesystem::path &in_path, typename T::type &out_hash, hash_progress_callback_t< typename T::type > in_callback)
Definition file.inl:91
T read_all_text(const std::filesystem::path &in_path)
Definition file.inl:249
bool try_compute_hash(std::ifstream &in_file, typename T::type &out_hash, bool in_from_beginning, hash_progress_callback_t< typename T::type > in_callback)
Definition file.inl:70
bool compare(const std::filesystem::path &in_left, const std::filesystem::path &in_right, hash_progress_callback_t< typename T::type > in_left_callback, hash_progress_callback_t< typename T::type > in_right_callback)
Definition file.inl:193
Definition file.inl:19
Definition encoding.h:10
encoding_type
Definition encoding_type.h:6
@ unknown
Definition encoding_type.h:7
constexpr encoding::encoding_type get_native_encoding_type(encoding::encoding_type in_encoding)
Definition encoding_expr.inl:43
Definition expr.h:7