Advertisement
Wolfrost

GDAuto.h

Jan 7th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. // GDAuto.h : Defines class GDAuto.
  2. //
  3.  
  4. #pragma once
  5. #include <iostream>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <Windows.h>
  9. #include <ShObjIdl.h>
  10. #include <vector>
  11. #include <sstream>
  12. using namespace std;
  13.  
  14. #pragma region GEOMETRY DASH AUTO
  15.  
  16. class GDAuto
  17. {
  18. public:
  19.  
  20.     ofstream GDFile;
  21.     bool started;
  22.  
  23.     GDAuto(const int key_toggle, string _filename);
  24.     ~GDAuto();
  25.  
  26. protected:
  27.  
  28.     void WriteFromInput();
  29.     void ReadFromFile();
  30.     void GetCommand();
  31.     wchar_t* GetFileName(const string &prompt);
  32.  
  33.     vector<string> &split(const string &s, char delim, vector<string> &elems)
  34.     {
  35.         stringstream ss(s);
  36.         string item;
  37.         while (getline(ss, item, delim)) {
  38.             elems.push_back(item);
  39.         }
  40.         return elems;
  41.     }
  42.  
  43.     vector<string> split(const string &s, char delim)
  44.     {
  45.         vector<string> elems;
  46.         split(s, delim, elems);
  47.         return elems;
  48.     }
  49.  
  50.     template <typename T>
  51.     string NumberToString(T Number)
  52.     {
  53.         ostringstream ss;
  54.         ss << Number;
  55.         return ss.str();
  56.     }
  57.     template <typename T>
  58.     T StringToNumber (const string &Text)
  59.     {
  60.         istringstream ss(Text);
  61.         T result;
  62.         return ss >> result ? result : 0;
  63.     }
  64.  
  65.     const int KEY_TOGGLE;
  66.     string filename;
  67.     const char jump;
  68.     const char wait;
  69.     const char sep;
  70. };
  71.  
  72. #pragma endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement