Dennis Syrovatsky | 487a4e9 | 2005-10-18 04:44:36 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2005 TightVNC Team. All Rights Reserved. |
| 2 | * |
| 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | * |
| 18 | * TightVNC distribution homepage on the Web: http://www.tightvnc.com/ |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | // -=- FileInfo. |
| 23 | |
| 24 | #ifndef __RFB_FILEINFO_H__ |
| 25 | #define __RFB_FILEINFO_H__ |
| 26 | |
| 27 | #include <stdlib.h> |
| 28 | |
| 29 | #include <rfb/fttypes.h> |
| 30 | |
| 31 | namespace rfb { |
| 32 | class FileInfo |
| 33 | { |
| 34 | public: |
| 35 | void add(FileInfo *pFI); |
| 36 | void add(FILEINFO *pFIStruct); |
| 37 | void add(char *pName, unsigned int size, unsigned int data, unsigned int flags); |
| 38 | |
| 39 | char *getNameAt(unsigned int number); |
| 40 | |
| 41 | bool setNameAt(unsigned int number, char *pName); |
| 42 | |
| 43 | unsigned int getSizeAt(unsigned int number); |
| 44 | unsigned int getDataAt(unsigned int number); |
| 45 | unsigned int getFlagsAt(unsigned int number); |
| 46 | |
| 47 | FILEINFO *getFullDataAt(unsigned int number); |
| 48 | |
| 49 | bool setSizeAt(unsigned int number, unsigned int value); |
| 50 | bool setDataAt(unsigned int number, unsigned int value); |
| 51 | bool setFlagsAt(unsigned int number, unsigned int value); |
| 52 | |
| 53 | bool deleteAt(unsigned int number); |
| 54 | |
| 55 | unsigned int getNumEntries(); |
Dennis Syrovatsky | d5a0553 | 2005-12-18 15:08:34 +0000 | [diff] [blame^] | 56 | |
| 57 | unsigned int getFilenamesSize(); |
| 58 | char *getAllFilenames(unsigned int *pFilenameSize); |
Dennis Syrovatsky | 487a4e9 | 2005-10-18 04:44:36 +0000 | [diff] [blame] | 59 | |
| 60 | void sort(); |
| 61 | void free(); |
| 62 | |
| 63 | FileInfo(); |
| 64 | ~FileInfo(); |
| 65 | |
| 66 | private: |
| 67 | FILEINFO *m_pEntries; |
| 68 | unsigned int m_numEntries; |
Dennis Syrovatsky | d5a0553 | 2005-12-18 15:08:34 +0000 | [diff] [blame^] | 69 | |
Dennis Syrovatsky | 487a4e9 | 2005-10-18 04:44:36 +0000 | [diff] [blame] | 70 | }; |
| 71 | } |
| 72 | |
| 73 | #endif // __RFB_FILEINFO_H__ |