You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/10/24 07:25:22 UTC

svn commit: r327974 - in /webservices/axis2/trunk/c: include/axis2_om_stax_builder.h modules/xml/om/src/axis2_om_stax_builder.c

Author: samisa
Date: Sun Oct 23 22:25:11 2005
New Revision: 327974

URL: http://svn.apache.org/viewcvs?rev=327974&view=rev
Log:
Improved the doc comments. Also dropped unused methods.

Modified:
    webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c

Modified: webservices/axis2/trunk/c/include/axis2_om_stax_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_stax_builder.h?rev=327974&r1=327973&r2=327974&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_stax_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_stax_builder.h Sun Oct 23 22:25:11 2005
@@ -26,51 +26,98 @@
 #include <axis2_om_document.h>
 #include <axis2_environment.h>
 
-struct axis2_om_stax_builder;
-struct axis2_om_stax_builder_ops;
-
-typedef struct axis2_om_stax_builder_ops
+#ifdef __cplusplus
+extern "C"
 {
-
-/**
- *	move parser forward and reacts to events 
- */
-
-    axis2_om_node_t *(*axis2_om_stax_builder_ops_next) (axis2_environment_t *
-                                                        environment,
-                                                        struct axis2_om_stax_builder
-                                                        * builder);
-
-      axis2_status_t (*axis2_om_stax_builder_ops_discard_current_element)
-        (axis2_environment_t * environment,
-         struct axis2_om_stax_builder * builder);
+#endif
 
 
-} axis2_om_stax_builder_ops_t;
-
-typedef struct axis2_om_stax_builder
-{
-    axis2_om_stax_builder_ops_t *ops;
-    void *parser;
-    axis2_om_node_t *lastnode;
-    axis2_om_document_t *document;
-    axis2_bool_t done;
-    axis2_bool_t parser_accessed;
-    axis2_bool_t cache;
-} axis2_om_stax_builder_t;
+    struct axis2_om_stax_builder;
+    struct axis2_om_stax_builder_ops;
 
 /**
- *	create an stax_om_builder
- * @param parser   This is the XMLStreamReader of xmlparser
- *				   [ Guththila ]	
+ * @defgroup axis2_om_stax_builder OM Stax Builder
+ * @ingroup axis2_om 
+ * @{
  */
 
-axis2_om_stax_builder_t *axis2_om_stax_builder_create (axis2_environment_t *
-                                                       environment,
-                                                       void *parser);
+  /** 
+    * @brief OM stax builder operations struct
+    * Encapsulator struct for operations of axis2_om_stax_builder
+    */
+    typedef struct axis2_om_stax_builder_ops
+    {
+      /**
+        * Builds the next node from stream. Moves pull parser forward and reacts to events.
+        * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined.
+        * @param builder pointer to stax builder struct to be used
+        * @return a pointer to the next node, or NULL if there are no more nodes.
+        *           On erros sets the error and returns NULL.
+        */
+        AXIS2_DECLARE_DATA axis2_om_node_t * 
+            (AXIS2_CALL *axis2_om_stax_builder_ops_next) (axis2_environment_t *
+                                                environment,
+                                                struct axis2_om_stax_builder *
+                                                builder);
+
+      /**
+        * Discards the element that is being built currently.
+        * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined.
+        * @param builder pointer to stax builder struct to be used
+        * @return satus of the operation. AXIS2_SUCCESS on success else AXIS2_FAILURE.
+        */
+        AXIS2_DECLARE_DATA axis2_status_t (AXIS2_CALL *axis2_om_stax_builder_ops_discard_current_element)
+            (axis2_environment_t * environment,
+             struct axis2_om_stax_builder * builder);
+
+
+    } axis2_om_stax_builder_ops_t;
+
+  /** 
+    * \brief OM stax builder struct
+    * Bulds OM document using a pull parser interface
+    */
+    typedef struct axis2_om_stax_builder
+    {
+        /** operations struct */
+        axis2_om_stax_builder_ops_t *ops;
+        /** pull parser instance used by the builder */
+        void *parser;
+        /** last node the builder found */
+        axis2_om_node_t *lastnode;
+        /** document associated with the builder */
+        axis2_om_document_t *document;
+        /** done building the document? */
+        axis2_bool_t done;
+        /** parser was accessed? */
+        axis2_bool_t parser_accessed;
+        /** caching enabled? */
+        axis2_bool_t cache;
+    } axis2_om_stax_builder_t;
+
+  /**
+    * creates an stax builder
+    * @param environment Environment. MUST NOT be NULL, if NULL behaviour is undefined.
+    * @param parser pull parser to be used by the builder. Parser should implement the
+    *           Guththila interface. If NULL, default xml parser
+    *           (guththila pull parser) will be created with stdin as the input stream.
+    * @return a pointer to the newly created builder struct. 
+    */
+    AXIS2_DECLARE( axis2_om_stax_builder_t *) axis2_om_stax_builder_create (axis2_environment_t
+                                                           * environment,
+                                                           void *parser);
 
+/** builds next node */
 #define axis2_om_stax_builder_next(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_next(environment, builder))
+/** discards current node */
 #define axis2_om_stax_builder_discard_current_element(environment, builder) ((builder)->ops->axis2_om_stax_builder_ops_discard_current_element(environment, builder))
 
+/** @} */
+
+
+#ifdef __cplusplus
+}
+#endif
+
 
-#endif /* AXIS2_OM_STAX_BUILDER_H */
+#endif                          /* AXIS2_OM_STAX_BUILDER_H */

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c?rev=327974&r1=327973&r2=327974&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Sun Oct 23 22:25:11 2005
@@ -32,32 +32,6 @@
                                                     axis2_om_stax_builder_t *
                                                     builder);
 
-static int
-isnot_whitespace (axis2_char_t s[])
-{
-
-    int n = 0;
-
-    for (n = strlen (s) - 1; n >= 0; n--)
-        if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n')
-            break;
-    if (n == -1)
-        n = 0;
-
-    return n;
-}
-
-static int
-trim (axis2_char_t s[])
-{
-    int n;
-    for (n = strlen (s) - 1; n >= 0; n--)
-        if (s[n] != ' ' && s[n] != '\t' && s[n] != '\n')
-            break;
-    s[n + 1] = '\0';
-    return n;
-}
-
 axis2_om_stax_builder_t *
 axis2_om_stax_builder_create (axis2_environment_t * environment, void *parser)
 {
@@ -510,6 +484,8 @@
                 axis2_om_stax_builder_create_om_text (environment, builder);
             break;
         case GUTHTHILA_COMMENT:
+            break;
+        default:
             break;
         }
     }