svvitch
digital signage player
|
00001 #pragma once 00002 00003 #include <windows.h> 00004 #include <map> 00005 #include <string> 00006 #include <vector> 00007 #include <Poco/Path.h> 00008 00009 using std::map; 00010 using std::string; 00011 using std::wstring; 00012 using std::vector; 00013 using Poco::Path; 00014 00019 namespace svvitch { 00020 00022 const string version(); 00023 00028 bool readFile(const string& file, LPVOID* buf); 00029 00031 void sjis_utf8(const string& in, string& out); 00032 00034 void sjis_utf16(const string& in, wstring& out); 00035 00037 void utf16_sjis(const wstring& wstr, string& out); 00038 00040 void utf8_sjis(const string& str, string& out); 00041 00043 int fileCount(const Path& path); 00044 00046 string md5(const Path& path); 00047 00049 string join(const vector<string>& v, const string& c); 00050 00052 void split(const string& s, char c, vector<string>& v, int splits = 0); 00053 00055 bool parseMultiNumbers(const string& s, int min, int max, vector<int>& result); 00056 00058 string formatJSON(const string& s); 00059 00061 string formatJSON(const map<string, string>& obj); 00062 00064 string formatJSONArray(const vector<string>& list); 00065 00066 string trimQuotationMark(const string& s); 00067 00068 void parseJSON(const string& json, map<string, string>& map); 00069 00070 void parseJSONArray(const string& json, vector<string>& v); 00071 00073 string findLastOfText(const string& src, const string& find); 00074 00075 vector<int> parseTimes(const string& timeText); 00076 00077 void rebootWindows(BOOL shutdown = FALSE, BOOL force = FALSE); 00078 }