#ifndef FILE_H
#define FILE_H

//#include "common.h"
#include "cJSON.h"


typedef struct{
    short val1;
    short val2;
    short val3;
    short val4;
}I16X4_t;

typedef struct{
    short val[8];
}I16X8_t;

int ReadTxtFile(const char *pFileName, char **pMessage);
int WriteTxtFile(const char *pFileName, char **pMessage);
int ReadHexFile(const char *pFileName, unsigned char **pData);
int ReadHexFileAddLen(const char *pFileName, unsigned char **pData);
int WriteHexFile(const char *pFileName, unsigned char *pData,int len);
cJSON *readJsonFromFile(char *fileName);
int saveJsonToFile(char *fileName,cJSON *pjRoot);
int createMultiLevelDir(char* sPathName);
int toComtradeFile(char* sFileName,char* destFileName,int ch,int headLen);
//int toCsvFile(char* sFileName,char* destFileName,int ch,int headLen);
long tell(const char* pFileName);
int findWaveFile(char *dir,unsigned int fileIndex,char *fileName);
#endif
