123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #include <iostream>
- #include <vector>
- #include <fstream>
- #ifdef RVC_OS_WIN
- #include <windows.h>
- #endif // RVC_OS_WIN
- #ifndef MAX_PATH
- #define MAX_PATH 260
- #endif // !MAX_PATH
- using namespace std;
- #define HEADINI_NAME "HeadquartersLocalMediaPlay.ini"
- #define BRANCHINI_NAME "BranchLocalMediaPlay.ini"
- #define NETWORKINI_NAME "NetWorkLocalMediaPlay.ini"
- #define SECTION_GENERAL _T("General")
- #define GENERAL_MEDIANUM _T("MediaNum")
- #define SECTION_MEDIA _T("Media")
- #define MEDIA_TYPE _T("Type")
- #define MEDIA_FULLSCREEN _T("FullScreen")
- #define MEDIA_PRIMMONITOR _T("PrimMonitor")
- #define MEDIA_SIMPLEMODE _T("SimpleMode")
- #define MEDIA_PLAYINTERVAL _T("PlayInterval")
- #define MEDIA_VIDIONAMES _T("VideoNames")
- #define MEDIA_VAILDTIME _T("VaildTime")
- #define MEDIA_PLAYTIME _T("PlayTime")
- #define MEDIA_PRIORITY _T("priority")
- #define STR_NULL _T("")
- typedef struct _resourceParse
- {
- char type; //Pic:P, Video:V, Mp3:M
- bool fullScreen;
- bool primMonitor;
- bool simpleMode;
- int playInterval;
- string videoNames;
- string vaildTime;
- string playTime;
- int priority;
- string resourcePath;
- }ResourceParse;
- class CResourceParse {
- public:
- CResourceParse()
- {
- pvideoNames = NULL;
- pvaildTime = NULL;
- playTime = NULL;
- presourcePath = NULL;
- };
- CResourceParse(const CResourceParse& item)
- {
- this->type = item.type;
- this->fullScreen = item.fullScreen;
- this->primMonitor = item.primMonitor;
- this->simpleMode = item.simpleMode;
- this->playInterval = item.playInterval;
- this->priority = item.priority;
- if (item.pvideoNames) {
- this->pvideoNames = new char[strlen(item.pvideoNames) + 1];
- memset(this->pvideoNames, 0, strlen(item.pvideoNames) + 1);
- memcpy(this->pvideoNames, item.pvideoNames, strlen(item.pvideoNames));
- }
- if (item.pvaildTime) {
- this->pvaildTime = new char[strlen(item.pvaildTime) + 1];
- memset(this->pvaildTime, 0, strlen(item.pvaildTime) + 1);
- memcpy(this->pvaildTime, item.pvaildTime, strlen(item.pvaildTime));
- }
- if (item.playTime) {
- this->playTime = new char[strlen(item.playTime) + 1];
- memset(this->playTime, 0, strlen(item.playTime) + 1);
- memcpy(this->playTime, item.playTime, strlen(item.playTime));
- }
- if (item.presourcePath) {
- this->presourcePath = new char[strlen(item.presourcePath) + 1];
- memset(this->presourcePath, 0, strlen(item.presourcePath) + 1);
- memcpy(this->presourcePath, item.presourcePath, strlen(item.presourcePath));
- }
- };
- ~CResourceParse()
- {
- if (pvideoNames) delete[]pvideoNames;
- if (pvaildTime) delete[]pvaildTime;
- if (playTime) delete[]playTime;
- if (presourcePath) delete[]presourcePath;
- };
- char type; //Pic:P, Video:V, Mp3:M
- bool fullScreen;
- bool primMonitor;
- bool simpleMode;
- int playInterval;
- int priority;
- char* pvideoNames;
- char* pvaildTime;
- char* playTime;
- char* presourcePath;
- };
- typedef struct rvcResourceParse_s {
- char type; //Pic:P, Video:V, Mp3:M
- bool fullScreen;
- bool primMonitor;
- bool simpleMode;
- int playInterval;
- int priority;
- char strvideoNames[MAX_PATH];
- char strvaildTime[64];
- char strplayTime[64];
- char strResourcePath[MAX_PATH];
- }rvcResourceParse_t;
- bool checkInPlayTime(string playTime, bool checkCurTime = false);
- bool parseResourceIni(const char* filePath, vector<ResourceParse> &ret);
- bool checkInVaildTime(string vaildTime, bool checkCurData = false);
|