wsdlpull
1.23
Loading...
Searching...
No Matches
src
schemaparser
SchemaValidator.h
Go to the documentation of this file.
1
/*
2
* wsdlpull - A C++ parser for WSDL (Web services description language)
3
* Copyright (C) 2005-2007 Vivek Krishna
4
*
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
9
*
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
14
*
15
* You should have received a copy of the GNU Library General Public
16
* License along with this library; if not, write to the Free
17
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
*
19
*
20
*/
21
#ifndef _SCHEMAVALIDATORH
22
#define _SCHEMAVALIDATORH
23
24
#include "
xmlpull/wsdlpull_export.h
"
25
#include "
xmlpull/XmlSerializer.h
"
26
#include "
schemaparser/SchemaParser.h
"
27
#include "
schemaparser/SchemaParserException.h
"
28
#include "
schemaparser/TypeContainer.h
"
29
30
31
namespace
Schema
{
32
33
//class for validating a schema instance
34
class
WSDLPULL_EXPORT
SchemaValidator
35
{
36
public
:
44
SchemaValidator
(
const
SchemaParser
* sp,
45
std::ostream & os = std::cout);
46
~SchemaValidator
();
47
49
62
TypeContainer
*validate(
XmlPullParser
* xpp,
int
typeId,
63
TypeContainer
* ipTc = 0);
64
65
TypeContainer
*validate(
const
std::string & val ,
int
typeId,
66
TypeContainer
* ipTc = 0,
XmlPullParser
* xpp = 0);
//for simple types
67
TypeContainer
* validate(
void
* value ,
int
typeId,
68
TypeContainer
* ipTc = 0,
XmlPullParser
* xpp = 0);
70
80
bool
instance(
const
std::string& tag,
81
Schema::Type
type_id);
82
84
85
private
:
86
87
TypeContainer
* validateContentModel(
XmlPullParser
* xpp,
88
ContentModel
* cm,
89
TypeContainer
* ipTc,
90
const
std::string & elemName,
91
bool
nested=
false
,
92
TypeContainer
* btCnt=0);
//base contentModel
93
94
void
extractSimpleType(
const
std::string & val,
int
basetype,
95
TypeContainer
* ipTc,
const
SimpleType
* st,
96
XmlPullParser
* xpp);
97
bool
validateListOrUnion(
const
SimpleType
* st,
98
const
std::string &val,
XmlPullParser
* xpp);
99
100
bool
findElement(
ContentModel::ContentsIterator
start,
101
ContentModel::ContentsIterator
end,
102
std::string name,
103
ContentModel::ContentsIterator
& found);
104
bool
checkAttributeOccurence(
const
ComplexType
* ct ,
XmlPullParser
* xpp);
105
void
instanceCM(
ContentModel
*cm);
106
void
error(
const
std::string & ,
XmlPullParser
* xpp=0);
107
bool
instance1(
const
std::string& tag,
Schema::Type
type_id);
108
109
XmlSerializer
* xmlStream_ ;
110
std::ostream &ostr_;
111
const
SchemaParser
*sParser_;
112
113
};
114
}
115
#endif
SchemaParserException.h
SchemaParser.h
TypeContainer.h
XmlSerializer.h
Schema::ComplexType
Definition
ComplexType.h:35
Schema::ContentModel
Definition
ContentModel.h:37
Schema::ContentModel::ContentsIterator
std::list< ContentHolder >::iterator ContentsIterator
Definition
ContentModel.h:55
Schema::SchemaParser
Definition
SchemaParser.h:43
Schema::SchemaValidator
Definition
SchemaValidator.h:35
Schema::SimpleType
Definition
SimpleType.h:54
Schema::TypeContainer
Definition
TypeContainer.h:44
XmlPullParser
Definition
XmlPullParser.h:47
XmlSerializer
Definition
XmlSerializer.h:33
Schema
Definition
Annotation.h:27
Schema::Type
Type
Definition
Schema.h:60
wsdlpull_export.h
WSDLPULL_EXPORT
#define WSDLPULL_EXPORT
Definition
wsdlpull_export.h:30
Generated by
1.11.0