169 files changed, 64432 insertions, 116 deletions
diff --git a/tvapi/libtv/tvutils/CFile.h b/tvapi/libtv/tvutils/CFile.h new file mode 100644 index 0000000..bbb5266 --- a/dev/null +++ b/tvapi/libtv/tvutils/CFile.h @@ -0,0 +1,47 @@ +/* + * showbo +*/ +#ifndef C_FILE_H +#define C_FILE_H + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <stdio.h> +#include <errno.h> + +#define CC_MAX_FILE_PATH_LEN (256) + +#define BUFFER_SIZE 1024 + +class CFile +{ +public: + CFile(const char *path); + CFile(); + virtual ~CFile(); + virtual int openFile(const char *path); + virtual int closeFile(); + virtual int writeFile(const unsigned char *pData, int uLen); + virtual int readFile(const unsigned char *pBuf, int uLen); + int copyTo(const char *dstPath); + static int delFile(const char *path); + static int getFileAttrValue(const char *path); + static int setFileAttrValue(const char *path, int value); + static int getFileAttrStr(const char *path, char *str); + static int setFileAttrStr(const char *path, const char *str); + int delFile(); + int flush(); + int seekTo(); + int seekToBegin(); + int seekToEnd(); + int getLength(); + int getFd() + { + return mFd; + }; +protected: + char mPath[CC_MAX_FILE_PATH_LEN]; + int mFd; +}; +#endif |