9#include "hash/hash_provider.h"
10#include "hash/xxhash64_provider.h"
11#include "ut/expr/string_expr.h"
12#include "ut/encoding.h"
14namespace hedgedev::csl::io::
file
32 inline bool try_compute_hash(
hash::
hash_provider<T>& in_hash_provider, std::ifstream& in_file, T& out_hash,
bool in_from_beginning =
true, hash_progress_callback_t<T> in_callback =
nullptr);
48 inline bool try_compute_hash(std::ifstream& in_file,
typename T::type& out_hash,
bool in_from_beginning =
true, hash_progress_callback_t<
typename T::type> in_callback =
nullptr);
60 inline 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 =
nullptr);
73 inline bool try_compute_hash(
const std::filesystem::path& in_path,
typename T::type& out_hash, hash_progress_callback_t<
typename T::type> in_callback =
nullptr);
89 inline bool compare(std::ifstream& in_left, std::ifstream& in_right,
bool in_from_beginning =
true, hash_progress_callback_t<
typename T::type> in_left_callback =
nullptr, hash_progress_callback_t<
typename T::type> in_right_callback =
nullptr);
102 inline bool compare(
const std::filesystem::path& in_left,
const std::filesystem::path& in_right, hash_progress_callback_t<
typename T::type> in_left_callback =
nullptr, hash_progress_callback_t<
typename T::type> in_right_callback =
nullptr);
126 template <ut::expr::basic_string T>
Definition hash_provider.h:9
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
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
std::function< bool(T in_hash, uint64_t in_processed_bytes, uint64_t in_total_bytes)> hash_progress_callback_t
Definition file.h:17
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
encoding_type
Definition encoding_type.h:6
@ utf8
Definition encoding_type.h:8