67 string type(
"string");
70 }
else if (asnk ==
"BOOLEAN") {
72 }
else if (asnk ==
"INTEGER" || asnk ==
"BigInt") {
74 }
else if (asnk ==
"REAL") {
79 out <<
"\"oneOf\": [{";
81 out <<
"\"type\": \"" <<
type <<
"\"";
87 switch (
f.GetType()) {
110 if (!pattern.empty()) {
113 pattern.append(
f.GetValue());
118 if (!pattern.empty()) {
123 out <<
"}, {\"type\": \"null\"}]";
131 required.push_back(
string(
"#") + mem->
GetName());
133 required.push_back(mem->
GetName());
146 string xsdk(
"element"), use, form;
148 bool optional = mem ? mem->
Optional() :
false;
153 xsdk =
"complexType";
167 form =
" form=\"qualified\"";
173 if (!isGlobalType && !
type.empty() && !hasFacets) {
174 out <<
" type=\"" <<
type <<
"\"";
177 out <<
" use=\"" << use <<
"\"";
181 out <<
" minOccurs=\"0\"";
188 if (mem && optional) {
190 out <<
" minOccurs=\"0\"";
195 out <<
" minOccurs=\"0\"";
205 out <<
" nillable=\"true\"";
207 if (isGlobalType && !
type.empty()) {
215 if (hasFacets && !
type.empty()) {
223 switch (
f.GetType()) {
234 if (!fname.empty()) {
252 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
271 out <<
" ( true | false ) ";
285 string open(
"("),
close(
")");
286 if (content ==
"EMPTY") {
290 if (!contents_only) {
291 out <<
"\n<!ELEMENT " <<
tag <<
' ' << open;
294 if (!contents_only) {
302 string storage =
GetVar(
"_storage_type");
304 bool full_ns = !
type.empty();
308 if (!storage.empty()) {
309 a->SetStorageType(storage);
336 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
344 if (IsGlobalType()) {
362 "NULL cannot have DEFAULT");
413 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
416 bool tagclosed =
false;
435 out <<
"\"optional\" default=";
436 if (
val->GetValue()) {
442 out <<
"\"required\"";
463 attr =
val->GetValue() ?
"\"true\"" :
"\"false\"";
470 "\n<!ATTLIST "<<
XmlTagName()<<
" value ( true | false ) "
536 value.Warning(
"wrong number of elements in REAL value", 16);
539 for ( CBlockDataValue::TValues::const_iterator
i = block->
GetValues().begin();
555 d = (double)(
i->GetValue());
558 return new double(d);
574 value.Warning(
"REAL value expected", 17);
607 return "VisibleString";
613 return "_UTF8String_";
615 return "_VisibleString_";
656 for ( string::const_iterator
i = v.begin();
i != v.end(); ++
i ) {
694 bool full_ns = !
type.empty();
699 a->SetSpecialRef(
"CStringUTF8, ()");
707 return "NCBI_NS_NCBI::CStringUTF8";
709 return "NCBI_NS_STD::string";
718 return "StringStore";
723 return "_StringStore_";
739 bool full_ns = !
type.empty();
752 return "_BIT_STRING_";
756 : m_BitStringEnum(bitenum)
793 return "NCBI_NS_NCBI::CBitString";
803 #if _DATATOOL_USE_SCHEMA_STYLE_COMMENTS
820 return "OCTET STRING";
825 return "_OCTET_STRING_";
833 return "NCBI_NS_STD::vector<char>";
843 return "xs:hexBinary";
873 string charType =
GetVar(
"_char");
874 if ( charType.empty() )
893 return "xs:base64Binary";
1011 a->SetSpecialRef(
"BigInt, ()");
1038 out <<
" namespace=\"" << ns <<
"\"";
1041 out <<
" minOccurs=\"0\"";
1045 if (!contents_only) {
1047 "<xs:element name=\"" <<
XmlTagName() <<
"\">";
1054 if (!contents_only) {
1062 if (!contents_only) {
1066 if (!contents_only) {
1084 bool full_ns = !
type.empty();
1092 return "NCBI_NS_NCBI::CAnyContentObject";
1099 return "VisibleString";
1104 return "_AnyContent_";
virtual void PrintDTDElement(CNcbiOstream &out, bool contents_only=false) const override
virtual void PrintASN(CNcbiOstream &out, int indent) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetDEFKeyword(void) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) 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 const char * GetXMLContents(void) const override
virtual const char * GetASNKeyword(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual const char * GetDefaultCType(void) const override
virtual string GetSchemaTypeString(void) const override
virtual bool IsCompressed(void) const override
virtual bool x_AsBitString(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual const char * GetASNKeyword(void) const override
virtual string GetDefaultString(const CDataValue &value) const override
virtual string GetSchemaTypeString(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual CTypeRef GetTypeInfo(void) override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual const char * GetDefaultCType(void) const override
virtual const char * GetXMLContents(void) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual bool NeedAutoPointer(const CTypeInfo *typeInfo) const override
CDataType * m_BitStringEnum
CBitStringDataType(CDataType *bitenum=nullptr)
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetDefaultCType(void) const override
virtual bool PrintXMLSchemaContents(CNcbiOstream &out, int indent, const CDataMember *mem) const override
virtual const CTypeInfo * GetRealTypeInfo(void) override
virtual void FixTypeTree(void) const override
virtual const char * GetASNKeyword(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
TValues & GetValues(void)
virtual CTypeRef GetTypeInfo(void) override
virtual const char * GetDEFKeyword(void) const override
virtual string GetSchemaTypeString(void) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetDefaultCType(void) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual void PrintDTDExtra(CNcbiOstream &out) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetASNKeyword(void) const override
virtual string GetDefaultString(const CDataValue &value) const override
virtual bool PrintXMLSchemaContents(CNcbiOstream &out, int indent, const CDataMember *mem) const override
bool Optional(void) const
const string & GetName(void) const
const CDataValue * GetDefault(void) const
const CComments & GetComments(void) const
bool SimpleType(void) const
const list< CMemberFacet > & GetRestrictions(void) const
const list< CMemberFacet > & GetRestrictions(void) const
EGlobalType GetGlobalType(void) const
const CDataMember * GetDataMember(void) const
CNcbiOstream & PrintASNTag(CNcbiOstream &out) const
bool HaveModuleName(void) const
CComments & Comments(void)
virtual AutoPtr< CTypeStrings > GetFullCType(void) const
void SetParent(const CDataType *parent, const string &memberName, string xmlName=kEmptyStr)
const string & GetNamespaceName(void) const
void ForbidVar(const string &var, const string &value)
static bool DTDEntitiesEnabled(void)
virtual const char * GetASNKeyword(void) const
const CDataType * GetParentType(void) const
virtual CTypeRef GetTypeInfo(void)
CTypeInfo * UpdateModuleName(CTypeInfo *typeInfo) const
virtual string GetSchemaTypeString(void) const
ENsQualifiedMode IsNsQualified(void) const
virtual CTypeInfo * CreateTypeInfo(void)
bool IsNillable(void) const
const string GetVar(const string &value, int collect=0) const
const CDataTypeModule * GetModule(void) const
static bool IsASNDataSpec(void)
string XmlTagName(void) const
const string GetAndVerifyVar(const string &value) const
const string & GetMemberName(void) const
const TValueType & GetValue(void) const
virtual string GetXmlString(void) const =0
virtual CTypeRef GetTypeInfo(void) override
virtual string GetDefaultString(const CDataValue &value) const override
virtual string GetSchemaTypeString(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetASNKeyword(void) const override
virtual const char * GetDefaultCType(void) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetDefaultCType(void) const override
virtual bool PrintXMLSchemaContents(CNcbiOstream &out, int indent, const CDataMember *mem) const override
virtual const char * GetASNKeyword(void) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual CTypeRef GetTypeInfo(void) override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetDEFKeyword(void) const override
virtual const CTypeInfo * GetRealTypeInfo(void) override
virtual bool x_AsBitString(void) const
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetDEFKeyword(void) const override
virtual bool NeedAutoPointer(const CTypeInfo *typeInfo) const override
virtual string GetSchemaTypeString(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual const char * GetASNKeyword(void) const override
virtual const char * GetDefaultCType(void) const override
virtual const char * GetXMLContents(void) const override
virtual bool IsCompressed(void) const
virtual string GetSchemaTypeString(void) const override
virtual string GetDefaultString(const CDataValue &value) const override
virtual const char * GetASNKeyword(void) const override
virtual const char * GetDefaultCType(void) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetDEFKeyword(void) const override
virtual const CTypeInfo * GetRealTypeInfo(void) override
virtual bool CheckValue(const CDataValue &value) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual void PrintASN(CNcbiOstream &out, int indent) const override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual const char * GetXMLContents(void) const =0
virtual void PrintXMLSchema(CNcbiOstream &out, int indent, bool contents_only=false) const override
virtual void PrintDTDElement(CNcbiOstream &out, bool contents_only=false) const override
virtual const char * GetDefaultCType(void) const =0
virtual void PrintJSONSchema(CNcbiOstream &out, int indent, list< string > &required, bool contents_only=false) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual bool PrintXMLSchemaContents(CNcbiOstream &out, int indent, const CDataMember *mem) const
virtual const CTypeInfo * GetRealTypeInfo(void) override
virtual TObjectPtr CreateDefault(const CDataValue &value) const override
virtual const char * GetXMLContents(void) const override
virtual const char * GetDefaultCType(void) const override
virtual string GetSchemaTypeString(void) const override
virtual const char * GetASNKeyword(void) const override
virtual bool NeedAutoPointer(const CTypeInfo *typeInfo) const override
virtual string GetDefaultString(const CDataValue &value) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual bool CheckValue(const CDataValue &value) const override
virtual const char * GetDEFKeyword(void) const override
CStringDataType(EType type=eStringTypeVisible)
virtual const char * GetASNKeyword(void) const override
virtual AutoPtr< CTypeStrings > GetFullCType(void) const override
virtual bool NeedAutoPointer(const CTypeInfo *typeInfo) const override
CStringStoreDataType(void)
virtual const CTypeInfo * GetRealTypeInfo(void) override
virtual const char * GetDEFKeyword(void) const override
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
std::ofstream out("events_result.xml")
main entry point for tests
element_type * release(void)
Release will release ownership of pointer to caller.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
int64_t Int8
8-byte (64-bit) signed integer
#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 string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
@ fDoublePosix
DoubleToString*(): Use C locale for double conversions.
const GenericPointer< typename T::ValueType > T2 value
Common macro to detect used sanitizers and suppress memory leaks if run under LeakSanitizer.
#define NCBI_LSAN_DISABLE_GUARD
CNcbiOstream & PrintASNNewLine(CNcbiOstream &out, int indent)
#define CheckValueType(value, type, name)