Added namespace to file

main
anulax1225 ago%!(EXTRA string=1 year)
parent 46284efe28
commit 2f2a11dda1
  1. 2
      src/bakatools/file_system/file_watcher.cpp
  2. 3
      src/bakatools/file_system/file_watcher.h
  3. 3
      src/bakatools/thread/task_timer.h
  4. 2
      src/bakatools/time/time.h

@ -1,5 +1,6 @@
#include "file_watcher.h" #include "file_watcher.h"
namespace Bk::Tools {
FileWatcher::FileWatcher(std::string path, TimeSpan<Millisecond> ts) FileWatcher::FileWatcher(std::string path, TimeSpan<Millisecond> ts)
: target(path), ttm(ts) : target(path), ttm(ts)
{ {
@ -45,3 +46,4 @@ void FileWatcher::start(const std::function<void (std::string, FileStatus)>& act
void FileWatcher::stop() { ttm.stop(); } void FileWatcher::stop() { ttm.stop(); }
bool FileWatcher::contains(std::string path) { return paths.find(path) != paths.end(); } bool FileWatcher::contains(std::string path) { return paths.find(path) != paths.end(); }
}

@ -2,7 +2,7 @@
#include <bakatools.h> #include <bakatools.h>
#include <bakatools/thread/task_timer.h> #include <bakatools/thread/task_timer.h>
namespace Bk::Tools {
enum class FileStatus enum class FileStatus
{ {
Created = 0, Created = 0,
@ -25,3 +25,4 @@ class FileWatcher
std::unordered_map<std::string, std::filesystem::file_time_type> paths; std::unordered_map<std::string, std::filesystem::file_time_type> paths;
TaskTimer<Millisecond> ttm; TaskTimer<Millisecond> ttm;
}; };
}

@ -2,7 +2,7 @@
#include <bakatools.h> #include <bakatools.h>
#include <bakatools/time/time.h> #include <bakatools/time/time.h>
namespace Bk::Tools {
template<typename P> template<typename P>
class TaskTimer class TaskTimer
{ {
@ -37,3 +37,4 @@ class TaskTimer
std::thread worker; std::thread worker;
TimeSpan<P> ts; TimeSpan<P> ts;
}; };
}

@ -2,6 +2,7 @@
#include <bakatoolspch.h> #include <bakatoolspch.h>
namespace Bk::Tools {
using Nanosecond = std::ratio<1,1000000000>; using Nanosecond = std::ratio<1,1000000000>;
using Microsecond = std::ratio<1,1000000>; using Microsecond = std::ratio<1,1000000>;
using Millisecond = std::ratio<1,1000>; using Millisecond = std::ratio<1,1000>;
@ -74,3 +75,4 @@ struct TimePoint
std::chrono::time_point<C, std::chrono::duration<long int, P>> point; std::chrono::time_point<C, std::chrono::duration<long int, P>> point;
}; };
}
Loading…
Cancel
Save