xml/cxmllibrary/src/encoder/include/nw_encoder_tinydom2wbxml.h
changeset 24 74f0b3eb154c
equal deleted inserted replaced
17:ed3155dbd163 24:74f0b3eb154c
       
     1 /*
       
     2 * Copyright (c) 2000 - 2001 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /** ----------------------------------------------------------------------- **
       
    20     @package:     NW_Encoder
       
    21 
       
    22     @synopsis:    default
       
    23 
       
    24     @description: Maps TinyDom types onto WBXMLWriter functions.
       
    25 
       
    26  ** ----------------------------------------------------------------------- **/
       
    27 
       
    28 #ifndef NW_TINYDOM2WBXML_H
       
    29 #define NW_TINYDOM2WBXML_H
       
    30 
       
    31 #include <xml/cxml/nw_encoder_wbxmlwriter.h>
       
    32 #include <xml/cxml/nw_dom_attribute.h>
       
    33 
       
    34 #ifdef __cplusplus
       
    35 extern "C" {
       
    36 #endif /* __cplusplus */
       
    37 
       
    38 /** ----------------------------------------------------------------------- **
       
    39     @function:    NW_Encoder_writeAttrVal
       
    40 
       
    41     @synopsis:    Write attribute.
       
    42 
       
    43     @scope:       public
       
    44 
       
    45     @parameters:
       
    46        [in] NW_WBXML_Writer_t* pW
       
    47                   The writer.
       
    48 
       
    49        [in] NW_DOM_AttrVal_t* val
       
    50                   The attirbute value.
       
    51 
       
    52        [in] NW_Uint32 encoding
       
    53                   Charset as IANA MIBenum.
       
    54 
       
    55     @description: Write attribute.
       
    56 
       
    57     @returns:     NW_Status_t
       
    58                   Status of operation.
       
    59 
       
    60        [NW_STAT_SUCCESS]
       
    61                   Attribute written.
       
    62 
       
    63        [NW_STAT_BAD_INPUT_PARAM]
       
    64                   Required value is null or invalid token.
       
    65 
       
    66        [NW_STAT_OUT_OF_MEMORY]
       
    67                   Couldn't allocate memory.
       
    68 
       
    69        [NW_STAT_FAILURE]
       
    70                   General error.
       
    71 
       
    72  ** ----------------------------------------------------------------------- **/
       
    73 NW_Status_t
       
    74 NW_Encoder_writeAttrVal(NW_WBXML_Writer_t* pW,
       
    75                         NW_DOM_AttrVal_t *val,
       
    76                         NW_Uint32 encoding);
       
    77 
       
    78 /** ----------------------------------------------------------------------- **
       
    79     @function:    NW_Encoder_writeAttributeByToken
       
    80 
       
    81     @synopsis:    Write attribute specified token.
       
    82 
       
    83     @scope:       public
       
    84 
       
    85     @parameters:
       
    86        [in] NW_WBXML_Writer_t* pW
       
    87                   The writer.
       
    88 
       
    89        [in] NW_Uint16 attrFqToken
       
    90                   The fully qualified token.
       
    91 
       
    92        [in] NW_TinyDom_AttrVal_t* val
       
    93                   Value to write.
       
    94 
       
    95        [in] NW_Uint32 encoding
       
    96                   Encoding to use.
       
    97 
       
    98     @description: Write attribute specified token.
       
    99 
       
   100     @returns:     NW_Status_t
       
   101                   Status of operation.
       
   102 
       
   103        [NW_STAT_SUCCESS]
       
   104                   Attribute written.
       
   105 
       
   106        [NW_STAT_BAD_INPUT_PARAM]
       
   107                   Required value is null or invalid token.
       
   108 
       
   109        [NW_STAT_OUT_OF_MEMORY]
       
   110                   Couldn't allocate memory.
       
   111 
       
   112        [NW_STAT_FAILURE]
       
   113                   General error.
       
   114 
       
   115  ** ----------------------------------------------------------------------- **/
       
   116 NW_Status_t
       
   117 NW_Encoder_writeAttributeByToken(NW_WBXML_Writer_t* pW,
       
   118                                  NW_Uint16 attrFqToken,
       
   119                                  NW_TinyDom_AttrVal_t* val,
       
   120                                  NW_Uint32 encoding);
       
   121 
       
   122 
       
   123 /** ----------------------------------------------------------------------- **
       
   124     @function:    NW_Encoder_writeAttributeByName
       
   125 
       
   126     @synopsis:    Writes an Attribute by name plus AttrVal.
       
   127 
       
   128     @scope:       public
       
   129 
       
   130     @parameters:
       
   131        [in] NW_WBXML_Writer_t* pW
       
   132                   The writer.
       
   133 
       
   134        [in] NW_String_t* attrName
       
   135                   The attribute name to use.
       
   136 
       
   137        [in] NW_TinyDom_AttrVal_t* val
       
   138                   The value to write.
       
   139 
       
   140        [in] NW_Uint32 encoding
       
   141                   The encoding to use.
       
   142 
       
   143     @description: Writes an Attribute by name plus AttrVal.
       
   144 
       
   145     @returns:     NW_Status_t
       
   146                   Status of operation.
       
   147 
       
   148        [NW_STAT_SUCCESS]
       
   149                   Attribute written.
       
   150 
       
   151        [NW_STAT_BAD_INPUT_PARAM]
       
   152                   Required value is NULL or invalid.
       
   153 
       
   154        [NW_STAT_FAILURE]
       
   155                   Not found.
       
   156 
       
   157        [NW_STAT_OUT_OF_MEMORY]
       
   158                   Memory couldn't be allocated.
       
   159 
       
   160  ** ----------------------------------------------------------------------- **/
       
   161 NW_Status_t
       
   162 NW_Encoder_writeAttributeByName(NW_WBXML_Writer_t* pW,
       
   163                                 NW_String_t* attrName,
       
   164                                 NW_TinyDom_AttrVal_t* val,
       
   165                                 NW_Uint32 encoding);
       
   166 
       
   167 
       
   168 /** ----------------------------------------------------------------------- **
       
   169     @function:    NW_Encoder_writeElementByToken
       
   170 
       
   171     @synopsis:    Write element by token.
       
   172 
       
   173     @scope:       public
       
   174 
       
   175     @parameters:
       
   176        [in] NW_WBXML_Writer_t* pW
       
   177                   The writer.
       
   178 
       
   179        [in] NW_Uint16 elementToken
       
   180                   The token to write.
       
   181 
       
   182     @description: Write element by token.
       
   183 
       
   184     @returns:     NW_Status_t
       
   185                   Status of operation.
       
   186 
       
   187        [NW_STAT_SUCCESS]
       
   188                   Attribute written.
       
   189 
       
   190        [NW_STAT_BAD_INPUT_PARAM]
       
   191                   Required value is NULL or invalid.
       
   192 
       
   193        [NW_STAT_FAILURE]
       
   194                   Not found.
       
   195 
       
   196        [NW_STAT_OUT_OF_MEMORY]
       
   197                   Memory couldn't be allocated.
       
   198 
       
   199  ** ----------------------------------------------------------------------- **/
       
   200 NW_Status_t
       
   201 NW_Encoder_writeElementByToken(NW_WBXML_Writer_t* pW,
       
   202                                NW_Uint16 elementToken);
       
   203 
       
   204 
       
   205 /** ----------------------------------------------------------------------- **
       
   206     @function:    NW_Encoder_writeElementByName
       
   207 
       
   208     @synopsis:    Write element by name.
       
   209 
       
   210     @scope:       public
       
   211 
       
   212     @parameters:
       
   213        [in] NW_WBXML_Writer_t* pW
       
   214                   The writer.
       
   215 
       
   216        [in] NW_String_t* elementName
       
   217                   Name of element to write.
       
   218 
       
   219        [in] NW_Uint32 encoding
       
   220                   Encoding to use.
       
   221 
       
   222     @description: Write element by name.
       
   223 
       
   224     @returns:     NW_Status_t
       
   225                   Status of operation.
       
   226 
       
   227        [NW_STAT_SUCCESS]
       
   228                   Attribute written.
       
   229 
       
   230        [NW_STAT_BAD_INPUT_PARAM]
       
   231                   Required value is NULL or invalid.
       
   232 
       
   233        [NW_STAT_FAILURE]
       
   234                   Not found.
       
   235 
       
   236        [NW_STAT_OUT_OF_MEMORY]
       
   237                   Memory couldn't be allocated.
       
   238 
       
   239  ** ----------------------------------------------------------------------- **/
       
   240 NW_Status_t
       
   241 NW_Encoder_writeElementByName(NW_WBXML_Writer_t* pW,
       
   242                               NW_String_t* elementName,
       
   243                               NW_Uint32 encoding);
       
   244 
       
   245 
       
   246 /** ----------------------------------------------------------------------- **
       
   247     @function:    NW_Encoder_writeText
       
   248 
       
   249     @synopsis:    Write text.
       
   250 
       
   251     @scope:       public
       
   252 
       
   253     @parameters:
       
   254        [in] NW_WBXML_Writer_t* pW
       
   255                   The writer.
       
   256 
       
   257        [in] NW_TinyDom_Text_t* text
       
   258                   default
       
   259 
       
   260        [in] NW_Uint32 encoding
       
   261                   default
       
   262 
       
   263     @description: Write text.
       
   264 
       
   265     @returns:     NW_Status_t
       
   266                   Status of operation.
       
   267 
       
   268        [NW_STAT_SUCCESS]
       
   269                   Attribute written.
       
   270 
       
   271        [NW_STAT_BAD_INPUT_PARAM]
       
   272                   Required value is NULL or invalid.
       
   273 
       
   274        [NW_STAT_FAILURE]
       
   275                   Not found.
       
   276 
       
   277        [NW_STAT_OUT_OF_MEMORY]
       
   278                   Memory couldn't be allocated.
       
   279 
       
   280  ** ----------------------------------------------------------------------- **/
       
   281 NW_Status_t
       
   282 NW_Encoder_writeText(NW_WBXML_Writer_t* pW,
       
   283                      NW_TinyDom_Text_t* text,
       
   284                      NW_Uint32 encoding);
       
   285 
       
   286 #ifdef __cplusplus
       
   287 } // extern "C" {
       
   288 #endif /* __cplusplus */
       
   289 
       
   290 /* NW_TINYDOM2WBXML_H */
       
   291 #endif