EXIDecoder.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * Copyright (C) 2007-2012 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*******************************************************************
  19. *
  20. * @author Daniel.Peintner.EXT@siemens.com
  21. * @version 0.7
  22. * @contact Joerg.Heuer@siemens.com
  23. *
  24. * <p>Code generated by EXIdizer.com</p>
  25. ********************************************************************/
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #ifndef EXI__DECODER_H
  30. #define EXI__DECODER_H
  31. /**
  32. * \file EXIDecoder.h
  33. * \brief EXI Decoder
  34. *
  35. */
  36. #include "EXITypes.h"
  37. /**
  38. * \brief Initialize EXI decoder
  39. *
  40. * Resets & initializes the EXI decoder.
  41. *
  42. * \param stream Input Stream
  43. * \param state Codec state
  44. * \param runtimeTable Runtime name-tables
  45. * \param stringTable String table
  46. * \return Error-Code <> 0
  47. *
  48. */
  49. int exiInitDecoder(bitstream_t* stream, exi_state_t* state,
  50. exi_name_table_runtime_t runtimeTable, exi_string_table_t stringTable);
  51. /**
  52. * \brief Reports last decoded qualified name
  53. *
  54. * Note: Qualified name only available for previously unknown qname. Otherwise make use of name table entries.
  55. *
  56. * \param qname Qualified name
  57. * \return Error-Code <> 0
  58. *
  59. */
  60. int exiGetLastQName(exi_qname_t** qname);
  61. /**
  62. * \brief Decodes next event
  63. *
  64. * Inspects EXI stream and decodes next EXI event.
  65. *
  66. * \param stream Input Stream
  67. * \param state Codec state
  68. * \param nextEvent Next event
  69. * \return Error-Code <> 0
  70. *
  71. */
  72. int exiDecodeNextEvent(bitstream_t* stream,
  73. exi_state_t* state, exi_event_t* nextEvent);
  74. /**
  75. * \brief Decodes StartDocument (SD) event
  76. *
  77. * \param stream Input Stream
  78. * \param state Codec state
  79. * \return Error-Code <> 0
  80. *
  81. */
  82. int exiDecodeStartDocument(bitstream_t* stream,
  83. exi_state_t* state);
  84. /**
  85. * \brief Decodes EndDocument (ED) event
  86. *
  87. * \param stream Input Stream
  88. * \param state Codec state
  89. * \return Error-Code <> 0
  90. *
  91. */
  92. int exiDecodeEndDocument(bitstream_t* stream,
  93. exi_state_t* state);
  94. /**
  95. * \brief Decodes StartElemnt (SE) event
  96. *
  97. * Note: The first time a qnameID is larger than schema-informed NUMBER_OF_QNAMES it is possible to retrieve the qname by calling GetLastQName(...).
  98. * It is up to the caller to track qnames.
  99. *
  100. * \param stream Input Stream
  101. * \param state Codec state
  102. * \param qnameID Qualified Name ID
  103. * \return Error-Code <> 0
  104. *
  105. */
  106. int
  107. exiDecodeStartElement(bitstream_t* stream,
  108. exi_state_t* state, uint16_t* qnameID);
  109. /**
  110. * \brief Decodes EndElement (EE) event
  111. *
  112. * \param stream Input Stream
  113. * \param state Codec state
  114. * \param qnameID Qualified Name ID
  115. * \return Error-Code <> 0
  116. *
  117. */
  118. int exiDecodeEndElement(bitstream_t* stream,
  119. exi_state_t* state, uint16_t* qnameID);
  120. /**
  121. * \brief Decodes Characters (CH) event.
  122. *
  123. * Reports characters value.
  124. *
  125. * \param stream Input Stream
  126. * \param state Codec state
  127. * \param val Characters value
  128. * \return Error-Code <> 0
  129. *
  130. */
  131. int exiDecodeCharacters(bitstream_t* stream,
  132. exi_state_t* state, exi_value_t* val);
  133. /**
  134. * \brief Decodes Attribute (AT) event.
  135. *
  136. * Reports attribute qname and value.
  137. *
  138. * \param stream Input Stream
  139. * \param state Codec state
  140. * \param qnameID Qualified Name ID
  141. * \param val Characters value
  142. * \return Error-Code <> 0
  143. *
  144. */
  145. int exiDecodeAttribute(bitstream_t* stream,
  146. exi_state_t* state, uint16_t* qnameID, exi_value_t* val);
  147. /**
  148. * \brief Decodes attribute xsi:nil
  149. *
  150. * Reports value.
  151. *
  152. * \param stream Input Stream
  153. * \param state Codec state
  154. * \param val Characters value
  155. * \return Error-Code <> 0
  156. *
  157. */
  158. int exiDecodeAttributeXsiNil(bitstream_t* stream,
  159. exi_state_t* state, exi_value_t* val);
  160. /**
  161. * \brief Decodes attribute xsi:type
  162. *
  163. * Reports value.
  164. *
  165. * \param stream Input Stream
  166. * \param state Codec state
  167. * \param val Characters value
  168. * \return Error-Code <> 0
  169. *
  170. */
  171. int exiDecodeAttributeXsiType(bitstream_t* stream,
  172. exi_state_t* state, exi_value_t* val);
  173. /**
  174. * \brief Decodes attribute/characters list value
  175. *
  176. * List values are special and are processed one by one.
  177. *
  178. * \param stream Input Stream
  179. * \param state Codec state
  180. * \param qnameID Qualified Name ID
  181. * \param val List value
  182. * \param lt List type
  183. * \return Error-Code <> 0
  184. *
  185. */
  186. int exiDecodeListValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
  187. exi_value_t* val, exi_list_t lt);
  188. #endif
  189. #ifdef __cplusplus
  190. }
  191. #endif