#include <KM_util.h>
#include <string>
+#include <boost/filesystem.hpp>
+#include <openssl/md5.h>
#ifdef KM_WIN32
# include <io.h>
namespace Kumu
{
- //
class DirScanner
- {
- public:
-#ifdef KM_WIN32
- __int64 m_Handle;
- struct _finddatai64_t m_FileInfo;
-#else
- DIR* m_Handle;
-#endif
-
- DirScanner(void);
- ~DirScanner() { Close(); }
-
- Result_t Open(const char*);
- Result_t Close();
- Result_t GetNext(char*);
- };
+ {
+ public:
+ DirScanner();
+ Result_t Open(const char *);
+ Result_t GetNext(char *);
+ Result_t Close();
+ private:
+ boost::filesystem::directory_iterator _iterator;
+ };
#ifdef KM_WIN32
typedef __int64 fsize_t;
SP_POS = SEEK_CUR,
SP_END = SEEK_END
};
-#endif
-
+#endif
+
//
#ifndef KM_SMALL_FILES_OK
template <bool sizecheck> void compile_time_size_checker();
{
public:
virtual ~PathMatchAny() {}
- inline bool Match(const std::string& s) const { return true; }
+ inline bool Match(const std::string&) const { return true; }
};
#ifndef KM_WIN32
class h__iovec;
mem_ptr<h__iovec> m_IOVec;
KM_NO_COPY_CONSTRUCT(FileWriter);
+ bool m_Hashing;
+ MD5_CTX m_MD5Context;
public:
FileWriter();
// the iovec list will be written to disk before the given buffer,as though
// you had called Writev() first.
Result_t Write(const byte_t*, ui32_t, ui32_t* = 0); // write buffer to disk
+
+ void StartHashing();
+ void MaybeHash(void const *, int);
+ std::string StopHashing();
};
Result_t CreateDirectoriesInPath(const std::string& Path);