Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <future>
- #include <thread>
- #include "convertings.hh"
- #include "module.hh"
- #include "optimizate.hh"
- #include "MParse.hh"
- #include "files.hpp"
- int main() {
- using namespace std;
- wear::uint::mdl modul;
- wear::ModuleParse::MParse parseModule;
- vector<string> config = modul.parseConfig(), processing, tmpSplit;
- vector<vector<string>> pData;
- /* Content cfg
- Debug Mode: True / False ( Get: cfg[0] )
- Processing speed: Minimum / Normal / Maxmium ( Get: cfg[1] )
- */
- // Update Configuration
- async(launch::async, [&config, &pData, &processing, &parseModule, &modul] {
- while (true) {
- config = modul.parseConfig();
- pData = parseModule.getData();
- processing = wear::files::listFile("D:/FileAllocator/Processing/");
- std::this_thread::sleep_for(
- config[1] == "Minimum" ? 900ms :
- config[1] == "Normal" ? 300ms :
- config[1] == "Maximum" ? 150ms : 800ms);
- }
- });
- while (true) {
- for (auto& v : wear::files::listFile("D:/FileAllocator/Modules/")) { parseModule.parse(v); }
- // MoveFileA
- ShowWindow(GetConsoleWindow(), config[0] == "True" ? SW_HIDE : SW_SHOW);
- for (size_t k = 0; k < pData.size(); ++k)
- {
- for (size_t i = 0; i < wear::split(pData[k][1], '$').size(); ++i)
- {
- for (size_t j = 0; j < processing.size(); ++j)
- {
- string fFrom = processing[j],
- fTo = pData[k][2] + "\\" + wear::files::dirToFile(processing[j]);
- if (wear::files::gFormat(processing[j]) == wear::split(pData[k][1], '$')[i]) {
- MoveFileA(fFrom.c_str(), fTo.c_str());
- }
- }
- }
- }
- std::this_thread::sleep_for(
- config[1] == "Minimum" ? 900ms :
- config[1] == "Normal" ? 300ms :
- config[1] == "Maximum" ? 150ms : 800ms);
- }
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement