Advertisement
Mafro

Untitled

Jul 14th, 2021
1,155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <future>
  3. #include <thread>
  4.  
  5. #include "convertings.hh"
  6. #include "module.hh"
  7. #include "optimizate.hh"
  8. #include "MParse.hh"
  9. #include "files.hpp"
  10.  
  11. int main() {
  12.     using namespace std;
  13.     wear::uint::mdl modul;
  14.     wear::ModuleParse::MParse parseModule;
  15.  
  16.     vector<string> config = modul.parseConfig(), processing, tmpSplit;
  17.     vector<vector<string>> pData;
  18.  
  19.  
  20.     /* Content cfg
  21.         Debug Mode: True / False ( Get: cfg[0] )
  22.         Processing speed: Minimum / Normal / Maxmium ( Get: cfg[1] )
  23.     */
  24.  
  25.  
  26.  
  27.     // Update Configuration
  28.     async(launch::async, [&config, &pData, &processing, &parseModule, &modul] {
  29.         while (true) {
  30.             config = modul.parseConfig();
  31.             pData = parseModule.getData();
  32.             processing = wear::files::listFile("D:/FileAllocator/Processing/");
  33.  
  34.             std::this_thread::sleep_for(
  35.                 config[1] == "Minimum" ? 900ms :
  36.                 config[1] == "Normal" ? 300ms :
  37.                 config[1] == "Maximum" ? 150ms : 800ms);
  38.         }
  39.         });
  40.  
  41.  
  42.  
  43.     while (true) {
  44.  
  45.         for (auto& v : wear::files::listFile("D:/FileAllocator/Modules/")) { parseModule.parse(v); }
  46.         // MoveFileA
  47.  
  48.        
  49.         ShowWindow(GetConsoleWindow(), config[0] == "True" ? SW_HIDE : SW_SHOW);
  50.         for (size_t k = 0; k < pData.size(); ++k)
  51.         {
  52.             for (size_t i = 0; i < wear::split(pData[k][1], '$').size(); ++i)
  53.             {
  54.                 for (size_t j = 0; j < processing.size(); ++j)
  55.                 {
  56.                     string fFrom = processing[j],
  57.                            fTo = pData[k][2] + "\\" + wear::files::dirToFile(processing[j]);
  58.  
  59.                     if (wear::files::gFormat(processing[j]) == wear::split(pData[k][1], '$')[i]) {
  60.                         MoveFileA(fFrom.c_str(), fTo.c_str());
  61.                     }
  62.                    
  63.                 }
  64.             }
  65.         }
  66.  
  67.  
  68.  
  69.         std::this_thread::sleep_for(
  70.             config[1] == "Minimum" ? 900ms :
  71.             config[1] == "Normal"  ? 300ms :
  72.             config[1] == "Maximum" ? 150ms : 800ms);
  73.     }
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.     return EXIT_SUCCESS;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement