;
114 switch(
f.GetType()) {
137 if(!pattern.empty()) {
138pattern.append(
"|");
140pattern.append(
f.GetValue());
145 if(!pattern.empty()) {
154 switch(
f.GetType()) {
174 int indent,
boolcontents_only)
const 184 boolhasAttlist =
false;
185 if(!typeStatic && typeContainer) {
186 if(typeContainer->
GetMembers().size() == 1 &&
187typeContainer->
GetMembers().front()->GetName().empty()) {
190 else if(typeContainer->
GetMembers().size() == 2) {
191hasAttlist = typeContainer->
GetMembers().front().get()->Attlist();
208 stringxsdk(isGlobalGroup ?
"group":
"element");
211 out<<
"<xs:any processContents=\"lax\"";
214 out<<
" namespace=\""<< ns <<
"\"";
217 out<<
"<xs:"<< xsdk;
223 out<<
"=\""<<
tag<<
"\"";
224 if(typeStatic && !
type.empty() && !hasAttlist && !hasFacets) {
225 out<<
" type=\""<<
type<<
"\"";
231 boolfound_min =
false, found_max =
false;
234list<CMemberFacet>::const_iterator
f= find_if(con.begin(), con.end(), [](
const CMemberFacet&
i) { return i.GetType() == ESerialFacet::eMinItems;});
235 if(
f!= con.end()) {
236 out<<
" minOccurs=\""<<
f->GetValue() <<
"\"";
239 f= find_if(con.begin(), con.end(), [](
const CMemberFacet&
i) { return i.GetType() == ESerialFacet::eMaxItems;});
240 if(
f!= con.end()) {
241 out<<
" maxOccurs=\""<<
f->GetValue() <<
"\"";
245 if(isOptional && !found_min) {
246 out<<
" minOccurs=\"0\"";
249 out<<
" maxOccurs=\"unbounded\"";
252 out<<
" nillable=\"true\"";
256 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS 271}
else if(hasFacets) {
278 switch(
f.GetType()) {
289 if(!fname.empty()) {
298 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS 309 boolasn_container =
false;
310list<string> opentag, closetag;
311 stringxsdk(
"sequence");
312 if(!contents_only) {
313 stringasnk(
"SEQUENCE");
314 boolisMixed =
false;
315 boolisSimpleSeq =
false;
316 boolisOptional =
false;
317 boolisNillable =
false;
321 if(
i->get()->Notag()) {
330 if(hasAttlist || typeContainer->
GetMembers().size() == 1) {
331isNillable = typeContainer->
GetMembers().back()->GetType()->IsNillable();
333 if(typeContainer->
GetMembers().size() == 1) {
334CDataMemberContainerType::TMembers::const_iterator
i=
338isSimpleSeq = (typeSeq != 0);
345asnk =
data->GetASNKeyword();
347 if(m->get()->Notag()) {
357 if(mem->
Notag()) {
360isSimpleSeq =
false;
372 string tmp=
"<xs:element name=\""+
tag+
"\"";
374 tmp+=
" type=\""+ userType +
"\"";
378 tmp+=
" minOccurs=\"0\"";
381 tmp+=
" maxOccurs=\"unbounded\"";
384 tmp+=
" nillable=\"true\"";
391opentag.push_back(
tmp+
">");
392closetag.push_front(
"</xs:element>");
395asn_container =
true;
396opentag.push_back(
"<xs:complexType>");
397closetag.push_front(
"</xs:complexType>");
398opentag.push_back(
"<xs:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">");
399closetag.push_front(
"</xs:sequence>");
400opentag.push_back(
"<xs:element name=\""+ userType +
"\">");
401closetag.push_front(
"</xs:element>");
403 tmp=
"<xs:complexType";
405 tmp+=
" mixed=\"true\"";
407opentag.push_back(
tmp+
">");
408closetag.push_front(
"</xs:complexType>");
413 if(!asn_container) {
414 tmp+=
" minOccurs=\"0\" maxOccurs=\"unbounded\"";
418 tmp+=
" minOccurs=\"0\"";
420 tmp+=
" maxOccurs=\"unbounded\"";
421}
else if(isSimpleSeq) {
423 tmp+=
" minOccurs=\"0\"";
425 tmp+=
" maxOccurs=\"unbounded\"";
427opentag.push_back(
tmp+
">");
428closetag.push_front(
"</xs:"+ xsdk +
">");
431 ITERATE( list<string>, s, opentag ) {
436 if(!contents_only) {
437 ITERATE( list<string>, s, closetag ) {
447 if(!contents_only) {
461 if(typeRef && !contents_only) {
466 out<<
"\n<!ELEMENT "<<
tag<<
' ';
468 if(typeStatic || !contents_only) {
493 if(!contents_only) {
499 "\n<!ELEMENT "<<
tag<<
' ';
557 value.Warning(
"block of values expected", 18);
574 "SET/SEQUENCE OF default not implemented");
633 if( templ.empty() ) {
TValues & GetValues(void)
list< AutoPtr< CDataValue > > TValues
const TMembers & GetMembers(void) const
list< AutoPtr< CDataMember > > TMembers
bool Optional(void) const
bool Nillable(void) const
const list< CMemberFacet > & GetRestrictions(void) const
void SetInSet(const CUniSequenceDataType *sequence)
EGlobalType GetGlobalType(void) const
const CDataMember * GetDataMember(void) const
CNcbiOstream & PrintASNTag(CNcbiOstream &out) const
virtual string GetDefaultString(const CDataValue &value) const
CComments & Comments(void)
void PrintASNTypeComments(CNcbiOstream &out, int indent, int flags=0) const
virtual AutoPtr< CTypeStrings > GetFullCType(void) const
void PrintDTD(CNcbiOstream &out) const
void SetParent(const CDataType *parent, const string &memberName, string xmlName=kEmptyStr)
string LocationString(void) const
const string & GlobalName(void) const
const string & GetNamespaceName(void) const
void ForbidVar(const string &var, const string &value)
void SetNsQualified(bool qualified)
virtual const char * GetASNKeyword(void) const
const CDataType * GetParentType(void) const
virtual void PrintDTDExtra(CNcbiOstream &out) const
virtual bool CheckValue(const CDataValue &value) const =0
virtual void PrintSpecDump(CNcbiOstream &out, int indent) const
virtual CTypeRef GetTypeInfo(void)
virtual void PrintASN(CNcbiOstream &out, int indent) const =0
virtual TObjectPtr CreateDefault(const CDataValue &value) const =0
static bool GetEnforcedStdXml(void)
virtual void PrintDTDElement(CNcbiOstream &out, bool contents_only=false) const =0
CTypeInfo * UpdateModuleName(CTypeInfo *typeInfo) const
virtual void FixTypeTree(void) const
void PrintDTDTypeComments(CNcbiOstream &out, int indent) const
virtual void PrintXMLSchema(CNcbiOstream &out, int indent, bool contents_only=false) const =0
virtual void PrintJSONSchema(CNcbiOstream &out, int indent, list< string > &required, bool contents_only=false) const =0
virtual string GetSchemaTypeString(void) const
ENsQualifiedMode IsNsQualified(void) const
static bool IsASNDataSpec(void)
string XmlTagName(void) const
const string GetAndVerifyVar(const string &value) const
bool IsTypeAlias(void) const
void SetNamespaceName(const string &name)
virtual string GetSpecKeyword(void) const
const string & UserTypeXmlTagName(void) const
virtual void PrintDTDElement(CNcbiOstream &out, bool contents_only=false) const override
virtual const char * GetXMLContents(void) const =0
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
virtual bool CanBeKey(void) const
static void AdaptForSTL(AutoPtr< CTypeStrings > &type)
virtual string GetSpecKeyword(void) const override
virtual const char * GetASNKeyword(void) const override
virtual bool NeedAutoPointer(const CTypeInfo *typeInfo) const override
virtual void PrintXMLSchema(CNcbiOstream &out, int indent, bool contents_only=false) const override
virtual void PrintJSONSchema(CNcbiOstream &out, int indent, list< string > &required, bool contents_only=false) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetDEFKeyword(void) const override
virtual bool CheckType(void) const override
CUniSequenceDataType(const AutoPtr< CDataType > &elementType)
AutoPtr< CDataType > m_ElementType
virtual void PrintDTDElement(CNcbiOstream &out, bool contents_only=false) const override
virtual string GetDefaultString(const CDataValue &value) const override
virtual void FixTypeTree(void) const override
void SetElementType(const AutoPtr< CDataType > &type)
virtual void PrintSpecDumpExtra(CNcbiOstream &out, int indent) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual void PrintDTDExtra(CNcbiOstream &out) const override
virtual void PrintASN(CNcbiOstream &out, int indent) const override
bool IsNonEmpty(void) const
CDataType * GetElementType(void)
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual CTypeInfo * CreateTypeInfo(void) override
virtual CTypeInfo * CreateTypeInfo(void) override
CUniSetDataType(const AutoPtr< CDataType > &elementType)
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual const char * GetASNKeyword(void) const override
std::ofstream out("events_result.xml")
main entry point for tests
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
TTypeInfo Get(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static int CompareCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive compare of a substring with another string.
const TYPE & Get(const CNamedParameterList *param)
const GenericPointer< typename T::ValueType > T2 value
CNcbiOstream & PrintASNNewLine(CNcbiOstream &out, int indent)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4