src/include/common/spds/FileData.h

00001 /*
00002  * Copyright (C) 2003-2007 Funambol
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 
00020 #ifndef INCL_FILEDATA
00021 #define INCL_FILEDATA
00022 
00024 #include "base/util/ArrayElement.h"
00025 #include "base/util/WString.h"
00026 #include "base/util/StringBuffer.h"
00027 
00028 class FileData : public ArrayElement {
00029     
00030     // ------------------------------------------------------- Private data
00031     private:
00032         WString file;
00033                 WString name;
00034                 WString created;
00035                 WString modified;
00036                 WString accessed;
00037                 WString attributes;
00038                 bool hidden;
00039                 bool system;
00040                 bool archived;
00041                 bool deleted;
00042                 bool writable;
00043                 bool readable;
00044                 bool executable;
00045                 WString cttype;
00046                 StringBuffer body;
00047                 WString enc;
00048                 int size;
00049 
00050         // represents the presence of their equivalent tag
00051         bool isHiddenPresent;
00052         bool isSystemPresent;
00053         bool isArchivedPresent;
00054         bool isDeletedPresent;
00055         bool isWritablePresent;
00056         bool isReadablePresent;
00057         bool isExecutablePresent;
00058 
00059         /*
00060         * return the length for the base64 array starting from length of the original array
00061         */
00062         int lengthForB64(int len);
00063 
00064     public:
00065     // ------------------------------------------------------- Constructors
00066         FileData();
00067         ~FileData();
00068 
00069     // ---------------------------------------------------------- Accessors  
00070                 const WCHAR* getFile() { return file; }
00071                 void setFile(const WCHAR* v) { file = v; } 
00072 
00073                 const WCHAR* getName() { return name; }
00074                 void setName(const WCHAR* v) { name = v; }
00075 
00076                 const WCHAR* getCreated() { return created; }
00077                 void setCreated(const WCHAR* v) { created = v; }
00078 
00079                 const WCHAR* getModified() { return modified; }
00080                 void setModified(const WCHAR* v) { modified = v; }
00081 
00082                 const WCHAR* getAccessed() { return accessed; }
00083                 void setAccessed(const WCHAR* v) { accessed = v; }
00084 
00085                 const WCHAR* getAttributes() { return file; }
00086                 void setAttributes(const WCHAR* v) { attributes = v; }
00087                 
00088                 bool getHiddied() { return hidden; }
00089                 void setHidden(bool v) { hidden = v; }
00090 
00091                 bool getSystem() { return system; }
00092                 void setSystem(bool v) { system = v; }
00093 
00094                 bool getArchived() { return archived; }
00095                 void setArchived(bool v) { archived = v; }
00096 
00097                 bool getDeleted() { return deleted; }
00098                 void setDeleted(bool v) { deleted = v; }
00099 
00100                 bool getWritable() { return writable; }
00101                 void setWritable(bool v) { writable = v; }
00102                 
00103                 bool getReadable() { return readable; }
00104                 void setReadable(bool v) { readable = v; }
00105 
00106                 bool getExecutable() { return executable; }
00107                 void setExecutable(bool v) { executable = v; }
00108 
00109                 const WCHAR* getCttype() { return cttype; }
00110                 void setCttype(const WCHAR* v) { cttype = v; } 
00111 
00112         const char* getBody() { return body; }
00113                 void setBody(const char* v, int len);
00114 
00115                 const WCHAR* getEnc() { return enc; }
00116                 void setEnc(const WCHAR* v) { enc = v; } 
00117                 
00118                 int getSize() { return size; }
00119                 void setSize(int v) { size = v; }
00120         
00121         int parse(StringBuffer* s) ;
00122 
00123     // ----------------------------------------------------- Public Methods
00124         int parse(const char *syncmlData, size_t len = WString::npos) ;
00125         int parse(const void *syncmlData, size_t len) ;
00126         
00127         char *format() ;
00128 
00129         ArrayElement* clone() { return new FileData(*this); }
00130    
00131 };
00132 
00134 #endif
00135 

Generated on Fri Apr 27 12:29:18 2007 for Funambol C++ Client Library by  doxygen 1.5.2