00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef INCL_FILEDATA
00038 #define INCL_FILEDATA
00039
00041 #include "base/util/ArrayElement.h"
00042 #include "base/util/WString.h"
00043 #include "base/util/StringBuffer.h"
00044 #include "base/globalsdef.h"
00045
00046 #define FILE_ITEM TEXT("File")
00047 #define FILE_HIDDEN "h"
00048 #define FILE_SYSTEM "s"
00049 #define FILE_ARCHIVED "a"
00050 #define FILE_DELETE "d"
00051 #define FILE_WRITABLE "w"
00052 #define FILE_READABLE "r"
00053 #define FILE_EXECUTABLE "e"
00054 #define FILE_ACCESSED "accessed"
00055 #define FILE_ATTRIBUTES "attributes"
00056 #define FILE_BODY "body"
00057 #define FILE_CTTYTPE "cttype"
00058 #define FILE_ENC "enc"
00059 #define FILE_MODIFIED "modified"
00060 #define FILE_NAME "name"
00061 #define FILE_SIZE "size"
00062 #define FILE_CREATED "created"
00063
00064 BEGIN_NAMESPACE
00065
00066 class FileData : public ArrayElement {
00067
00068
00069 private:
00070 WString file;
00071 WString name;
00072 WString created;
00073 WString modified;
00074 WString accessed;
00075 WString attributes;
00076 bool hidden;
00077 bool system;
00078 bool archived;
00079 bool deleted;
00080 bool writable;
00081 bool readable;
00082 bool executable;
00083 WString cttype;
00084 StringBuffer body;
00085 WString enc;
00086 int size;
00087
00088
00089 bool isHiddenPresent;
00090 bool isSystemPresent;
00091 bool isArchivedPresent;
00092 bool isDeletedPresent;
00093 bool isWritablePresent;
00094 bool isReadablePresent;
00095 bool isExecutablePresent;
00096
00097
00098 public:
00099
00100 FileData();
00101 ~FileData();
00102
00103
00104 const WCHAR* getFile() { return file; }
00105 void setFile(const WCHAR* v) { file = v; }
00106
00107 const WCHAR* getName() { return name; }
00108 void setName(const WCHAR* v) { name = v; }
00109
00110 const WCHAR* getCreated() { return created; }
00111 void setCreated(const WCHAR* v) { created = v; }
00112
00113 const WCHAR* getModified() { return modified; }
00114 void setModified(const WCHAR* v) { modified = v; }
00115
00116 const WCHAR* getAccessed() { return accessed; }
00117 void setAccessed(const WCHAR* v) { accessed = v; }
00118
00119 const WCHAR* getAttributes() { return file; }
00120 void setAttributes(const WCHAR* v) { attributes = v; }
00121
00122 bool getHiddied() { return hidden; }
00123 void setHidden(bool v) { hidden = v; }
00124
00125 bool getSystem() { return system; }
00126 void setSystem(bool v) { system = v; }
00127
00128 bool getArchived() { return archived; }
00129 void setArchived(bool v) { archived = v; }
00130
00131 bool getDeleted() { return deleted; }
00132 void setDeleted(bool v) { deleted = v; }
00133
00134 bool getWritable() { return writable; }
00135 void setWritable(bool v) { writable = v; }
00136
00137 bool getReadable() { return readable; }
00138 void setReadable(bool v) { readable = v; }
00139
00140 bool getExecutable() { return executable; }
00141 void setExecutable(bool v) { executable = v; }
00142
00143 const WCHAR* getCttype() { return cttype; }
00144 void setCttype(const WCHAR* v) { cttype = v; }
00145
00146 const char* getBody() { return body; }
00147 void setBody(const char* v, int len);
00148
00149 const WCHAR* getEnc() { return enc; }
00150 void setEnc(const WCHAR* v) { enc = v; }
00151
00152 int getSize() { return size; }
00153 void setSize(int v) { size = v; }
00154
00155 int parse(StringBuffer* s) ;
00156
00157
00158 int parse(const char *syncmlData, size_t len = WString::npos) ;
00159 int parse(const void *syncmlData, size_t len) ;
00160
00161 char *format() ;
00162
00163 ArrayElement* clone() { return new FileData(*this); }
00164
00165 };
00166
00167
00168 END_NAMESPACE
00169
00171 #endif
00172