1 /***************************************************************************
2                ulxr_callparse_wb.h  -  parse wbxml-rpc method call
3                              -------------------
4     begin                : Fri Jan 09 2004
5     copyright            : (C) 2002-2007 by Ewald Arnold
6     email                : ulxmlrpcpp@ewald-arnold.de
7 
8     $Id: ulxr_callparse_wb.h 940 2006-12-30 18:22:05Z ewald-arnold $
9 
10  ***************************************************************************/
11 
12 /**************************************************************************
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU Lesser General Public License as
16  * published by the Free Software Foundation; either version 2 of the License,
17  * or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  *
28  ***************************************************************************/
29 
30 #ifndef ULXR_CALLPARSE_WB_H
31 #define ULXR_CALLPARSE_WB_H
32 
33 #include <ulxmlrpcpp/ulxmlrpcpp.h>  // always first header
34 
35 #include <ulxmlrpcpp/ulxr_callparse_base.h>
36 #include <ulxmlrpcpp/ulxr_valueparse_wb.h>
37 
38 
39 namespace ulxr {
40 
41 
42 /** An wbxml parser for a MethodCall.
43   * @ingroup grp_ulxr_parser
44   */
45 class ULXR_API_DECL0 MethodCallParserWb : public ValueParserWb,
46                                        public MethodCallParserBase
47 {
48  public:
49 
50    enum CallWellKnownToken
51    {
52      wbToken_MethodCall = ValueParserWb::wbToken_ValueParserLast, // 0x52
53      wbToken_MethodName,                                          // 0x53
54      wbToken_Params,                                              // 0x54
55      wbToken_Param,                                               // 0x55
56      wbToken_CallParserLast                                       // 0x56
57    };
58 
59  protected:
60 
61  /** Tests if the current opening tag is to be parsed by this
62    * inheritance level or by the parent.
63    * @param  token  current well known token
64    * @param  attr   tag attributes
65    * @return true: element has been handled
66    */
67    bool testStartElement(unsigned token, const Attributes &attr);
68 
69  /** C++ callback for an opening XML tag.
70    * @param  token  current well known token
71    * @param  attr   tag attributes
72    */
73    virtual void startElement(unsigned token, const Attributes &attr);
74 
75  /** C++ callback for a closing XML tag.
76    * @return true: element has been handled
77    */
78    bool testEndElement();
79 
80  /** C++ callback for a closing XML tag.
81    */
82    virtual void endElement();
83 };
84 
85 
86 }  // namespace ulxr
87 
88 
89 #endif // ULXR_CALLPARSE_WB_H
90