1 //=============================================================================
3 * @file Svcconf_Handler.h
5 * @author Nanbor Wang <nanbor@cs.wustl.edu>
7 //=============================================================================
9 #ifndef ACEXML_SVCCONF_HANDLER_H
10 #define ACEXML_SVCCONF_HANDLER_H
12 #include "ACEXML/common/DefaultHandler.h"
13 #include "ace/Service_Types.h"
15 #if (ACE_USES_CLASSIC_SVC_CONF == 0)
24 * Set/get name of a parsed entity.
26 int name (const ACEXML_Char
*n
);
27 const ACEXML_Char
*name ();
30 * Set/get type of a dynamic node.
32 int service_type (int type
);
36 * Set/Get active status.
42 * Set/get initializer path.
44 int path (const ACEXML_Char
*n
);
45 const ACEXML_Char
*path ();
48 * Set/get initializer init function.
50 int init_func (const ACEXML_Char
*n
);
51 const ACEXML_Char
*init_func ();
54 * Set/get initializer init parameter.
56 int init_params (const ACEXML_Char
*n
);
57 const ACEXML_Char
*init_params ();
69 ACEXML_Char
*init_func_
;
70 ACEXML_Char
*init_params_
;
74 * @class ACEXML_Svcconf_Handler
76 * @brief ACEXML_Svcconf_Handler is an example SAX event handler.
78 * This SAX event handler try to regenerate the XML document it
79 * reads with correct indentation.
81 class ACEXML_Svcconf_Handler
: public ACEXML_DefaultHandler
85 * Default constructor.
87 ACEXML_Svcconf_Handler ();
92 virtual ~ACEXML_Svcconf_Handler ();
94 // Methods inherit from ACEXML_ContentHandler.
97 * Receive notification of character data.
99 virtual void characters (const ACEXML_Char
*ch
,
104 * Receive notification of the end of a document.
106 virtual void endDocument ();
109 * Receive notification of the end of an element.
111 virtual void endElement (const ACEXML_Char
*namespaceURI
,
112 const ACEXML_Char
*localName
,
113 const ACEXML_Char
*qName
);
116 * End the scope of a prefix-URI mapping.
118 virtual void endPrefixMapping (const ACEXML_Char
*prefix
);
121 * Receive notification of ignorable whitespace in element content.
123 virtual void ignorableWhitespace (const ACEXML_Char
*ch
,
128 * Receive notification of a processing instruction.
130 virtual void processingInstruction (const ACEXML_Char
*target
,
131 const ACEXML_Char
*data
);
134 * Receive an object for locating the origin of SAX document events.
136 virtual void setDocumentLocator (ACEXML_Locator
*locator
) ;
139 * Receive notification of a skipped entity.
141 virtual void skippedEntity (const ACEXML_Char
*name
);
144 * Receive notification of the beginning of a document.
146 virtual void startDocument ()
150 * Receive notification of the beginning of an element.
152 virtual void startElement (const ACEXML_Char
*namespaceURI
,
153 const ACEXML_Char
*localName
,
154 const ACEXML_Char
*qName
,
155 ACEXML_Attributes
*atts
);
158 * Begin the scope of a prefix-URI Namespace mapping.
160 virtual void startPrefixMapping (const ACEXML_Char
*prefix
,
161 const ACEXML_Char
*uri
);
163 // *** Methods inherit from ACEXML_DTDHandler.
166 * Receive notification of a notation declaration event.
168 virtual void notationDecl (const ACEXML_Char
*name
,
169 const ACEXML_Char
*publicId
,
170 const ACEXML_Char
*systemId
);
173 * Receive notification of an unparsed entity declaration event.
175 virtual void unparsedEntityDecl (const ACEXML_Char
*name
,
176 const ACEXML_Char
*publicId
,
177 const ACEXML_Char
*systemId
,
178 const ACEXML_Char
*notationName
);
180 // Methods inherit from ACEXML_EnitityResolver.
183 * Allow the application to resolve external entities.
185 virtual ACEXML_InputSource
*resolveEntity (const ACEXML_Char
*publicId
,
186 const ACEXML_Char
*systemId
);
188 // Methods inherit from ACEXML_ErrorHandler.
191 * Receive notification of a recoverable error.
193 virtual void error (ACEXML_SAXParseException
&exception
);
196 * Receive notification of a non-recoverable error.
198 virtual void fatalError (ACEXML_SAXParseException
&exception
);
201 * Receive notification of a warning.
203 virtual void warning (ACEXML_SAXParseException
&exception
);
207 * Get the only attribute in <stream> or <streamdef>.
209 int get_stream_id (ACEXML_Attributes
*alist
);
212 * Get the only attribute in <resume>, <suspend>, <remove>
214 int get_id (ACEXML_Attributes
*alist
);
217 * Get the dynamic tag attributes.
219 int get_dynamic_attrs (ACEXML_Attributes
*alist
);
222 * Get the initializer tag attributes.
224 int get_initializer_attrs (ACEXML_Attributes
*alist
);
227 * Get the static tag attributes.
229 int get_static_attrs (ACEXML_Attributes
*alist
);
232 /// We are parsing a stream definition
235 /// We are defining a steam module
238 /// @a stream_ holds the actually Stream_Type object managed by @a stream_svc_type_.
239 ACE_Service_Type
*stream_svc_type_
;
240 ACE_Stream_Type
*stream_
;
242 //ACE_SHLIB_HANDLE dll_handle_;
244 ACE_Parsed_Info parsed_info_
;
246 ACE_Parsed_Info stream_info_
;
248 ACEXML_Locator
* locator_
;
251 #if defined (__ACEXML_INLINE__)
252 # include "Svcconf_Handler.inl"
253 #endif /* __ACEXML_INLINE__ */
255 #endif /* ACE_USES_CLASSIC_SVC_CONF == 0 */
257 #endif /* ACEXML_SVCCONF_HANDLER_H */