src/include/common/syncml/formatter/Formatter.h

00001 /*
00002  * Funambol is a mobile platform developed by Funambol, Inc. 
00003  * Copyright (C) 2003 - 2007 Funambol, Inc.
00004  * 
00005  * This program is free software; you can redistribute it and/or modify it under
00006  * the terms of the GNU Affero General Public License version 3 as published by
00007  * the Free Software Foundation with the addition of the following permission 
00008  * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
00009  * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE 
00010  * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
00011  * 
00012  * This program is distributed in the hope that it will be useful, but WITHOUT
00013  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00015  * details.
00016  * 
00017  * You should have received a copy of the GNU Affero General Public License 
00018  * along with this program; if not, see http://www.gnu.org/licenses or write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
00020  * MA 02110-1301 USA.
00021  * 
00022  * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite 
00023  * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
00024  * 
00025  * The interactive user interfaces in modified source and object code versions
00026  * of this program must display Appropriate Legal Notices, as required under
00027  * Section 5 of the GNU Affero General Public License version 3.
00028  * 
00029  * In accordance with Section 7(b) of the GNU Affero General Public License
00030  * version 3, these Appropriate Legal Notices must retain the display of the
00031  * "Powered by Funambol" logo. If the display of the logo is not reasonably 
00032  * feasible for technical reasons, the Appropriate Legal Notices must display
00033  * the words "Powered by Funambol".
00034  */
00035 
00036 
00037 #ifndef INCL_FORMATTER
00038 #define INCL_FORMATTER
00039 
00041 #include "base/fscapi.h"
00042 #include "base/util/utils.h"
00043 #include "base/util/StringBuffer.h"
00044 #include "base/util/XMLProcessor.h"
00045 #include "base/util/ArrayList.h"
00046 
00047 #include "syncml/core/TagNames.h"
00048 #include "syncml/core/ObjectDel.h"
00049 #include "base/globalsdef.h"
00050 
00051 BEGIN_NAMESPACE
00052 
00053 
00054 
00055 class Formatter {
00056 
00057     // ---------------------------------------------------------- Public data
00058     public:
00059 
00060         static StringBuffer*    getValue            (const char*  tagName, const char*  value, const char *params = NULL);
00061         static StringBuffer*    getValue            (const char*  tagName, StringBuffer* value, const char *params = NULL);
00062         static StringBuffer*    getValue            (const char*  tagName, long value, const char *params = NULL);
00063         static StringBuffer*    getValue            (const char*  tagName, int value, const char *params = NULL) { return getValue(tagName, (long)value, params); }
00064         static StringBuffer*    getValue            (const char*  tagName, bool value, const char *params = NULL);
00065         static StringBuffer*    getValueNotEmpty    (const char*  tagName, const char*  value, const char *params = NULL);
00066 
00067         static StringBuffer*    getSyncML           (SyncML*        syncML);
00068         static StringBuffer*    getSyncHdr          (SyncHdr*       syncHdr);
00069         static StringBuffer*    getSyncBody         (SyncBody*      syncBody);
00070         static StringBuffer*    getSessionID        (SessionID*     sessionID);
00071         static StringBuffer*    getVerDTD           (VerDTD*        verDTD);
00072         static StringBuffer*    getVerProto         (VerProto*      verProto);
00073         static StringBuffer*    getTarget           (Target*        target);
00074         static StringBuffer*    getSource           (Source*        source);
00075         static StringBuffer*    getCred             (Cred*          cred);
00076         static StringBuffer*    getMeta             (Meta*          meta);
00077         static StringBuffer*    getMsgID            (const char* value);
00078         static StringBuffer*    getRespURI          (const char* value);
00079         static StringBuffer*    getAuthentication   (Authentication* auth);
00080         static StringBuffer*    getAnchor           (Anchor*        anchor);
00081         static StringBuffer*    getMetInf           (MetInf*        metInf);
00082         static StringBuffer*    getNextNonce        (NextNonce*     nextNonce);
00083         static StringBuffer*    getMem              (Mem*           mem);
00084         static StringBuffer*    getCmdID            (CmdID*         cmdID);
00085 
00086         static StringBuffer*    getAlerts           (ArrayList*     alerts);
00087         static StringBuffer*    getAlert            (Alert*         alert);
00088         static StringBuffer*    getItems            (ArrayList*     items);
00089         static StringBuffer*    getItem             (Item*          item);
00090 
00091         static StringBuffer*    getDevInf           (DevInf* devInf);
00092         static StringBuffer*    getData             (ComplexData* data);
00093         static StringBuffer*    getData             (Data* data);
00094         static StringBuffer*    getDataStores       (ArrayList* dataStores);
00095         static StringBuffer*    getDataStore        (DataStore* dataStore);
00096         static StringBuffer*    getSourceRef        (SourceRef* sourceRef);
00097         static StringBuffer*    getTargetRef        (TargetRef* targetRef);
00098         static StringBuffer*    getSourceRefs       (ArrayList* sourceRefs);
00099         static StringBuffer*    getTargetRefs       (ArrayList* targetRefs);
00100         static StringBuffer*    getDSMem            (DSMem* dsMem);
00101         static StringBuffer*    getContentTypeInfos (ArrayList* contentTypeInfos, const char* TAG);
00102         static StringBuffer*    getContentTypeInfo  (ContentTypeInfo* contentTypeInfo, const char* TAG);
00103         static StringBuffer*    getSyncCap          (SyncCap* syncCap);
00104         static StringBuffer*    getSyncTypes        (ArrayList* syncTypes);
00105         static StringBuffer*    getSyncType         (SyncType* syncType);
00106         static StringBuffer*    getCTCaps           (ArrayList* ctCaps);
00107         static StringBuffer*    getCTCap            (CTCap* ctCap);
00108 
00109         static StringBuffer*    getExts             (ArrayList* exts);
00110         static StringBuffer*    getExt              (Ext* ext);
00111         static StringBuffer*    getXVals            (ArrayList* xvals);
00112         static StringBuffer*    getXVal             (StringElement* xval);
00113         static StringBuffer*    getStatusArray      (ArrayList* statusArray);
00114         static StringBuffer*    getStatus           (Status* status);
00115         static StringBuffer*    getChal             (Chal* chal);
00116         static StringBuffer*    getAdds             (ArrayList* adds);
00117         static StringBuffer*    getAdd              (Add* add);
00118         static StringBuffer*    getDels             (ArrayList* adds);
00119         static StringBuffer*    getDelete           (Delete* add);
00120         static StringBuffer*    getReplaces         (ArrayList* replaces);
00121         static StringBuffer*    getReplace          (Replace* replace);
00122         static StringBuffer*    getCopies           (ArrayList* copies);
00123         static StringBuffer*    getCopy             (Copy* copy);
00124         static StringBuffer*    getCommonCommandList(ArrayList* commands);
00125         static StringBuffer*    getSync             (Sync* sync);
00126         static StringBuffer*    getMapItem          (MapItem* mapItem);
00127         static StringBuffer*    getMapItems         (ArrayList* mapItems);
00128         static StringBuffer*    getMap              (Map* map);
00129         static StringBuffer*    getExec             (Exec* exec);
00130         static StringBuffer*    getGet              (Get* get);
00131         static StringBuffer*    getPut              (Put* put);
00132         static StringBuffer*    getResults          (Results* results);
00133         static StringBuffer*    getSearch           (Search* search);
00134         static StringBuffer*    getSources          (ArrayList* sources);
00135         static StringBuffer*    getSourceArray      (SourceArray* sourceArray);
00136         static StringBuffer*    getExtraCommandList (ArrayList* commands);
00137         static StringBuffer*    getSequence         (Sequence* sequence);
00138         static StringBuffer*    getSpecificCommand  (ArrayList* commands, const char* commandName);
00139         static StringBuffer*    getAtomic           (Atomic* atomic);
00140         static StringBuffer*    getFilter           (Filter* filter);
00141         static StringBuffer*    getProperty         (Property* property);
00142         static StringBuffer*    getPropParam        (PropParam* param);
00143 
00144 };
00145 
00146 
00147 END_NAMESPACE
00148 
00150 #endif
00151 
00152 
00153 
00154 
00155 

Generated on Tue Jun 10 17:20:22 2008 for Funambol C++ Client Library by  doxygen 1.5.2