-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcmdDataParse.h
106 lines (80 loc) · 1.9 KB
/
cmdDataParse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef __CMD_DATAPARSE_H__
#define __CMD_DATAPARSE_H__
#include <stdio.h>
#include <string>
#include <list>
#include <string.h>
#include <stdlib.h>
#include "json/json.h"
//==========for BS interface=============
//#define fec_type 4
//#define fec_width 64
//#define fec_rate 50
//#define fec_num 3
//=======================
using namespace std;
typedef struct SendFileCmd_tag
{
char cmd[20];
char cmdType[20];
char mode[10];
char filePath[1024];
char fileName[256];
char realFileName[256];
int sendLevel;
int groupId;
char startTime[20];
char endTime[20];
char sendTime[20];
// int fec_type;
// int fec_width;
// int fec_rate;
// int fec_num;
}SEND_FILECMD_PARAM,*PSEND_FILECMD_PARAM;
//=========================for sarifec=====
//extern thread_params_t gkThreadParams;
typedef struct FecConfig
{
int fec_type;
int fec_width;
int fec_rate;
int fec_num;
// int fec_los;
}FECCONFIG;
typedef struct SendFileManage_tag
{
char fileName[1024];
int sendCou;
char startTime[20];
char endTime[20];
char sendMode[10];
int sendLevel;
char fileType;
int groupId;
int userId;
}SEND_FILE_MANAGE,*PSEND_FILE_MANAGE;
class CmdDataParse
{
public:
CmdDataParse();
~CmdDataParse(){};
public:
int cmdParser(string cmd);
int GetCmdCount(void);
list<PSEND_FILECMD_PARAM> GetCmdList(void);
void DispOneData(PSEND_FILECMD_PARAM pSendFileCmdParam);
PSEND_FILECMD_PARAM GetDataUnit(void);
void PopDataUnit(void);
int DataEmpty(void);
void GenerateSendFile(PSEND_FILECMD_PARAM cmdParam,FECCONFIG fecConfig);
int GetFileCount(void);
int FileEmpty(void);
void PopFileUnit(void);
PSEND_FILE_MANAGE GetFileUnit(void);
private:
Json::Value root;
Json::Reader reader;
list<PSEND_FILECMD_PARAM> m_cmdList;
list<PSEND_FILE_MANAGE> m_fileList;
};
#endif