NCBI C++ ToolKit
objostrxml.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: objostrxml.cpp 103043 2024-08-27 14:36:26Z gouriano $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Author: Eugene Vasilchenko
27 *
28 * File Description:
29 * XML object output stream
30 *
31 */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbistd.hpp>
35 #include <corelib/ncbi_limits.h>
36 
37 #include <serial/objostrxml.hpp>
38 #include <serial/objistr.hpp>
39 #include <serial/objcopy.hpp>
40 #include <serial/impl/memberid.hpp>
42 #include <serial/enumvalues.hpp>
43 #include <serial/objhook.hpp>
45 #include <serial/impl/choice.hpp>
46 #include <serial/impl/continfo.hpp>
48 #include <serial/delaybuf.hpp>
49 #include <serial/impl/ptrinfo.hpp>
50 #include <serial/error_codes.hpp>
51 
52 #include <stdio.h>
53 #include <math.h>
54 
55 
56 #define NCBI_USE_ERRCODE_X Serial_OStream
57 
59 
61  EOwnership deleteOut)
62 {
63  return new CObjectOStreamXml(out, deleteOut);
64 }
65 
66 
68 const char* sm_DefaultNamespacePrefix = "ns";
69 const char* sm_DefaultSchemaNamespace = "http://www.ncbi.nlm.nih.gov";
70 static
71 const char* s_SchemaInstanceNamespace = "http://www.w3.org/2001/XMLSchema-instance";
72 
73 
76  m_LastTagAction(eTagClose), m_SpecRef(eSpecRefNotSet), m_EndTag(true),
77  m_UseDefaultDTDFilePrefix( true),
78  m_UsePublicId( true),
79  m_Attlist( false), m_StdXml( false), m_EnforcedStdXml( false),
80  m_RealFmt( eRealScientificFormat ),
81  m_Encoding( eEncoding_Unknown ), m_StringEncoding( eEncoding_UTF8 ),
82  m_UseXmlDecl( true ), m_UseSchemaLoc( true ),
83  m_DefaultSchemaNamespace( sm_DefaultSchemaNamespace ),
84  m_SkipIndent( false ), m_SkipNextTag( false )
85 {
87 }
88 
90  : CObjectOStream(eSerial_Xml, out, deleteOut),
91  m_LastTagAction(eTagClose), m_SpecRef(eSpecRefNotSet), m_EndTag(true),
92  m_UseDefaultDTDFilePrefix( true),
93  m_UsePublicId( true),
94  m_Attlist( false), m_StdXml( false), m_EnforcedStdXml( false),
95  m_RealFmt( eRealScientificFormat ),
96  m_Encoding( eEncoding_Unknown ), m_StringEncoding( eEncoding_UTF8 ),
97  m_UseXmlDecl( true ), m_UseSchemaLoc( true ),
98  m_DefaultSchemaNamespace( sm_DefaultSchemaNamespace ),
99  m_SkipIndent( false ), m_SkipNextTag( false )
100 {
102 }
103 
105 {
106 }
107 
109 {
110  m_Encoding = enc;
111 }
112 
114 {
115  return m_Encoding;
116 }
117 
119 {
120  m_StringEncoding = enc;
121 }
122 
124 {
125  return m_StringEncoding;
126 }
127 
129 {
130  m_SpecRef = use_schema ? eSpecRefSchema : eSpecRefNone;
131 }
133 {
134  return m_SpecRef == eSpecRefSchema;
135 }
137 {
138  m_SpecRef = use_dtd ? eSpecRefDTD : eSpecRefNone;
139 }
141 {
142  return m_SpecRef == eSpecRefDTD;
143 }
144 
146 {
147  m_UseSchemaLoc = use_loc;
148 }
150 {
151  return m_UseSchemaLoc;
152 }
153 
154 
157 {
158  return m_RealFmt;
159 }
162 {
163  m_RealFmt = fmt;
164 }
165 
167 {
169  if (m_EnforcedStdXml) {
170  m_StdXml = false;
171  }
172 }
173 
175 {
176  TSerial_Format_Flags accepted =
180  if (flags & ~accepted) {
181  ERR_POST_X_ONCE(12, Warning <<
182  "CObjectOStreamXml::SetFormattingFlags: ignoring unknown formatting flags");
183  }
188 
191 }
192 
193 
195 {
196  return "line "+NStr::SizetToString(m_Output.GetLine());
197 }
198 
200 {
201  const string& s = type->GetModuleName();
202  string name;
203  for ( string::const_iterator i = s.begin(); i != s.end(); ++i ) {
204  char c = *i;
205  if ( !isalnum((unsigned char) c) )
206  name += ' ';
207  else
208  name += c;
209  }
210  return name;
211 }
212 
214 {
215  string name;
216  if( !m_DTDFileName.empty() ) {
217  name = m_DTDFileName;
218  }
219  else {
220  const string& s = type->GetModuleName();
221  for ( string::const_iterator i = s.begin(); i != s.end(); ++i ) {
222  char c = *i;
223  if ( c == '-' )
224  name += '_';
225  else
226  name += c;
227  }
228  }
229  return name;
230 }
231 
233 {
234  if (m_UseXmlDecl) {
235  m_Output.PutString("<?xml version=\"1.0");
236  if (m_Encoding != eEncoding_Unknown) {
237  m_Output.PutString("\" encoding=\"");
239  }
240  m_Output.PutString("\"?>");
241  }
242 
243  if (m_SpecRef == eSpecRefNotSet) {
244  CheckStdXml(type);
245  m_SpecRef = (type->GetDataSpec() == EDataSpec::eDTD || !x_IsStdXml()) ? eSpecRefDTD : eSpecRefSchema;
246  }
247  if (GetReferenceDTD()) {
248  if (m_UseXmlDecl) {
249  m_Output.PutEol();
250  }
251  m_Output.PutString("<!DOCTYPE ");
252  m_Output.PutString(type->GetName());
253 
254  if (m_UsePublicId) {
255  m_Output.PutString(" PUBLIC \"");
256  if (m_PublicId.empty()) {
257  m_Output.PutString("-//NCBI//");
259  m_Output.PutString("/EN");
260  } else {
262  }
263  m_Output.PutString("\"");
264  } else {
265  m_Output.PutString(" SYSTEM");
266  }
267  m_Output.PutString(" \"");
269  m_Output.PutString(".dtd\">");
270  } else if (!m_UseXmlDecl) {
271  m_SkipIndent = true;
272  }
276 }
277 
279 {
280  m_Output.PutEol(false);
282 }
283 
285 {
286  if (type->GetName().find(':') != string::npos) {
287  return;
288  }
289  if (!m_Attlist) {
290  OpenTagEndBack();
291  }
292 
293  string ns_name( m_NsPrefixToName[m_CurrNsPrefix]);
294  if (ns_name.empty()) {
295  ns_name = GetDefaultSchemaNamespace();
296  }
297  if (type->HasNamespaceName() || ((type->GetDataSpec() != EDataSpec::eXSD) &&
298  m_NsNameToPrefix.find(ns_name) == m_NsNameToPrefix.end())) {
299  if (m_Attlist) {
300  m_Output.PutString(" xmlns");
301  } else {
302  m_Output.PutEol();
303  m_Output.PutString(" xmlns");
304  }
305  if (!m_CurrNsPrefix.empty()) {
306  m_Output.PutChar(':');
308  }
309  m_Output.PutString("=\"");
310  m_Output.PutString(ns_name + "\"");
311  m_NsPrefixToName[m_CurrNsPrefix] = ns_name;
312  m_NsNameToPrefix[ns_name] = m_CurrNsPrefix;
313  }
314 
315  if (m_UseSchemaLoc) {
316  string xs_name(s_SchemaInstanceNamespace);
317  string xs_prefix("xs");
318  if (m_NsNameToPrefix.find(xs_name) == m_NsNameToPrefix.end()) {
319  for (char a='a';
320  m_NsPrefixToName.find(xs_prefix) != m_NsPrefixToName.end(); ++a) {
321  xs_prefix += a;
322  }
323  m_NsPrefixToName[xs_prefix] = xs_name;
324  m_NsNameToPrefix[xs_name] = xs_prefix;
325  m_Output.PutEol();
326  m_Output.PutString(" xmlns:");
327  m_Output.PutString(xs_prefix + "=\"");
328  m_Output.PutString(xs_name + "\"");
329  m_Output.PutEol();
330  m_Output.PutString(" ");
331  m_Output.PutString(xs_prefix);
332  m_Output.PutString(":schemaLocation=\"");
333  m_Output.PutString(ns_name + " ");
335  m_Output.PutString(".xsd\"");
336  m_Output.PutEol();
337  }
338  }
339  if (!m_Attlist) {
340  OpenTagEnd();
341  }
342 }
343 
345 {
346  if (GetReferenceSchema()) {
347  if (type->HasNamespaceName()) {
348  string prefix(type->GetNamespacePrefix());
349  if (prefix.empty() && (type->IsNsQualified() == eNSUnqualified || (m_Attlist && type->IsNsQualified() == eNSQualified))) {
350  prefix = sm_DefaultNamespacePrefix;
351  }
352  return x_BeginNamespace(type->GetNamespaceName(),prefix);
353  }
354  return true;
355  }
356  return false;
357 }
358 
360 {
361  if (GetReferenceSchema()) {
362  if (TopFrame().HasTypeInfo()) {
364  if (type->HasNamespaceName()) {
365  x_EndNamespace(type->GetNamespaceName());
366  }
367  }
368  }
369 }
370 
371 bool CObjectOStreamXml::x_BeginNamespace(const string& ns_name,
372  const string& ns_prefix)
373 {
374  if (!GetReferenceSchema() || ns_name.empty()) {
375  return false;
376  }
377  string nsPrefix(ns_prefix);
378  if (m_Attlist || m_NsNameToPrefix.find(ns_name) == m_NsNameToPrefix.end()) {
379  for (char a='a';
380  m_NsPrefixToName.find(nsPrefix) != m_NsPrefixToName.end(); ++a) {
381  nsPrefix += a;
382  }
383  if (m_Attlist && m_NsNameToPrefix.find(ns_name) != m_NsNameToPrefix.end()) {
384  if (!m_NsNameToPrefix.at(ns_name).empty()) {
385  m_CurrNsPrefix = m_NsNameToPrefix.at(ns_name);
386  m_NsPrefixes.push_back(m_CurrNsPrefix);
387  return false;
388  }
389  }
390  m_CurrNsPrefix = nsPrefix;
391  if (!m_Attlist) {
392  m_NsNameToPrefix[ns_name] = nsPrefix;
393  }
394  m_NsPrefixToName[nsPrefix] = ns_name;
395  m_NsPrefixes.push_back(nsPrefix);
396  return true;
397  } else {
398  m_CurrNsPrefix = m_NsNameToPrefix[ns_name];
399  m_NsPrefixes.push_back(m_CurrNsPrefix);
400  }
401  return false;
402 }
403 
404 void CObjectOStreamXml::x_EndNamespace(const string& ns_name)
405 {
406  if (!GetReferenceSchema() || ns_name.empty()) {
407  return;
408  }
409  string nsPrefix = m_CurrNsPrefix;
410 // we should erase them according to Namespace Scoping rules
411 // http://www.w3.org/TR/REC-xml-names/#scoping
412  m_NsPrefixes.pop_back();
413  if (find(m_NsPrefixes.begin(), m_NsPrefixes.end(), nsPrefix)
414  == m_NsPrefixes.end()) {
415  if (!m_Attlist) {
416  m_NsNameToPrefix.erase(ns_name);
417  }
418  m_NsPrefixToName.erase(nsPrefix);
419  }
420  m_CurrNsPrefix = m_NsPrefixes.empty() ? kEmptyStr : m_NsPrefixes.back();
421  if (!m_Attlist && GetStackDepth() <= 2) {
424  }
425 }
426 
429  const string& valueName)
430 {
431  bool skipname = valueName.empty() ||
433  bool valueonly = m_StdXml;
434  if (valueonly) {
435  if ( values.IsInteger() ) {
437  } else {
438  m_Output.PutString(valueName);
439  }
440  return;
441  }
442  if ( !m_SkipNextTag && !values.GetName().empty() ) {
443  OpenTagStart();
444  m_Output.PutString(values.GetName());
445  if ( !skipname ) {
446  m_Output.PutString(" value=\"");
447  m_Output.PutString(valueName);
448  m_Output.PutChar('\"');
449  }
450  if ( values.IsInteger() ) {
451  OpenTagEnd();
453  CloseTagStart();
454  m_Output.PutString(values.GetName());
455  CloseTagEnd();
456  }
457  else {
458  _ASSERT(!valueName.empty());
459  SelfCloseTagEnd();
461  }
462  }
463  else {
464  // local enum (member, variant or element)
465  if ( skipname ) {
466  _ASSERT(values.IsInteger());
468  }
469  else {
470  if (m_LastTagAction == eAttlistTag) {
471  m_Output.PutString(valueName);
472  } else {
473  OpenTagEndBack();
474  m_Output.PutString(" value=\"");
475  m_Output.PutString(valueName);
476  m_Output.PutChar('"');
477  if ( values.IsInteger() ) {
478  OpenTagEnd();
480  }
481  else {
482  SelfCloseTagEnd();
483  }
484  }
485  }
486  }
487 }
488 
491 {
492  WriteEnum(values, value, values.FindNameEx(value, values.IsInteger()));
493 }
494 
497 {
498  TEnumValueType value = in.ReadEnum(values);
499  WriteEnum(values, value, values.FindNameEx(value, values.IsInteger()));
500 }
501 
503 {
504 // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
505  switch ( c ) {
506  case '&':
507  m_Output.PutString("&amp;");
508  break;
509  case '<':
510  m_Output.PutString("&lt;");
511  break;
512  case '>':
513  m_Output.PutString("&gt;");
514  break;
515  case '\'':
516  m_Output.PutString("&apos;");
517  break;
518  case '"':
519  m_Output.PutString("&quot;");
520  break;
521  default:
522  if ((unsigned int)c < 0x20) {
523  m_Output.PutString("&#x");
524  Uint1 ch = c;
525  unsigned hi = ch >> 4;
526  unsigned lo = ch & 0xF;
527  if ( hi ) {
528  m_Output.PutChar("0123456789abcdef"[hi]);
529  }
530  m_Output.PutChar("0123456789abcdef"[lo]);
531  m_Output.PutChar(';');
532  } else {
533  m_Output.PutChar(c);
534  }
535  break;
536  }
537 }
538 
539 /*
540 In XML 1.1, almost all chars are allowed:
541 http://www.w3.org/TR/xml11/#NT-Char
542 BUT, we declare this as xml 1.0:
543  CObjectOStreamXml::WriteFileHeader
544 Once so, some chars are not allowed
545 http://www.w3.org/TR/xml/#charsets
546 
547 */
548 inline bool BAD_CHAR(char x) {
549  return (x < 0x20 && x > 0x0 && x != 0x9 && x != 0xA && x != 0xD);
550 }
551 inline char CObjectOStreamXml::x_VerifyChar(char x) {
552  return BAD_CHAR(x) ?
554 }
555 
557 {
560 
561  if (enc_in == enc_out || enc_in == eEncoding_Unknown || (*src & 0x80) == 0) {
562  char s = x_VerifyChar(*src);
563  if (s != '\0') {
564  WriteEscapedChar(s);
565  }
566  } else if (enc_out != eEncoding_UTF8) {
567  TUnicodeSymbol chU = (enc_in == eEncoding_UTF8) ?
568  CUtf8::Decode(src) : CUtf8::CharToSymbol( *src, enc_in);
569  char s = x_VerifyChar( CUtf8::SymbolToChar( chU, enc_out));
570  if (s != '\0') {
571  WriteEscapedChar(s);
572  }
573  } else {
574  CStringUTF8 tmp( CUtf8::AsUTF8( CTempString(src,1),enc_in));
575  for ( string::const_iterator t = tmp.begin(); t != tmp.end(); ++t ) {
576  char s = x_VerifyChar(*t);
577  if (s != '\0') {
578  WriteEscapedChar(s);
579  }
580  }
581  }
582 }
583 
585 {
587  OpenTagEndBack();
588  SelfCloseTagEnd();
589  return true;
590  }
591  else if (m_SpecialCaseWrite == eWriteAsNil) {
592  OpenTagEndBack();
593  m_Output.PutChar(' ');
594  if (GetReferenceSchema()) {
595  m_Output.PutString("xs:");
596  }
597  m_Output.PutString("nil=\"true\"");
598  SelfCloseTagEnd();
599  return true;
600  }
601  return false;
602 }
603 
605 {
607  return;
608  }
609  if ( !x_IsStdXml() ) {
610  OpenTagEndBack();
611  if ( data )
612  m_Output.PutString(" value=\"true\"");
613  else
614  m_Output.PutString(" value=\"false\"");
615  SelfCloseTagEnd();
616  } else {
617  if ( data )
618  m_Output.PutString("true");
619  else
620  m_Output.PutString("false");
621  }
622 }
623 
625 {
627 }
628 
630 {
632  return;
633  }
635 }
636 
638 {
640  return;
641  }
643 }
644 
646 {
648  return;
649  }
651 }
652 
654 {
656  return;
657  }
659 }
660 
661 void CObjectOStreamXml::WriteDouble2(double data, unsigned digits)
662 {
664  return;
665  }
666  if (isnan(data)) {
667  m_Output.PutString("NaN", 3);
668  return;
669  }
670  if (!finite(data)) {
671  if (data < 0) {
672  m_Output.PutChar('-');
673  }
674  m_Output.PutString("INF", 3);
675  return;
676  }
677  char buffer[512];
678  SIZE_TYPE width;
679  if (m_RealFmt == eRealFixedFormat) {
680  int shift = int(ceil(log10(fabs(data))));
681  int precision = int(digits - shift);
682  if ( precision < 0 )
683  precision = 0;
684  if ( precision > 64 ) // limit precision of data
685  precision = 64;
686  width = NStr::DoubleToString(data, (unsigned int)precision,
687  buffer, sizeof(buffer), NStr::fDoublePosix);
688  if (precision != 0) {
689  while (buffer[width-1] == '0') {
690  --width;
691  }
692  if (buffer[width-1] == '.') {
693  --width;
694  }
695  }
696  } else {
697  if (m_FastWriteDouble) {
698  width = NStr::DoubleToStringPosix(data, digits, buffer, sizeof(buffer));
699  } else {
700  width = sprintf(buffer, "%.*g", (int)digits, data);
701  char* dot = strchr(buffer,',');
702  if (dot) {
703  *dot = '.'; // enforce C locale
704  }
705  }
706  }
707  m_Output.PutString(buffer, width);
708 }
709 
711 {
712  WriteDouble2(data, DBL_DIG);
713 }
714 
716 {
717  WriteDouble2(data, FLT_DIG);
718 }
719 
721 {
722  OpenTagEndBack();
723  SelfCloseTagEnd();
724 }
725 
727 {
728  string ns_name(obj.GetNamespaceName());
729  bool needNs = x_BeginNamespace(ns_name,obj.GetNamespacePrefix());
730  string obj_name = obj.GetName();
731  if (obj_name.empty()) {
732  if (!StackIsEmpty() && TopFrame().HasMemberId()) {
733  obj_name = TopFrame().GetMemberId().GetName();
734  }
735  }
736  if (obj_name.empty()) {
737  ThrowError(fInvalidData, "AnyContent object must have name");
738  }
739  OpenTag(obj_name);
740 
741  if (GetReferenceSchema()) {
742  OpenTagEndBack();
743  if (needNs) {
744  m_Output.PutEol();
745  m_Output.PutString(" xmlns");
746  if (!m_CurrNsPrefix.empty()) {
747  m_Output.PutChar(':');
749  }
750  m_Output.PutString("=\"");
751  m_Output.PutString(ns_name);
752  m_Output.PutChar('\"');
753  }
754 
755  const vector<CSerialAttribInfoItem>& attlist = obj.GetAttributes();
756  if (!attlist.empty()) {
757  m_Attlist = true;
758  vector<CSerialAttribInfoItem>::const_iterator it;
759  for ( it = attlist.begin(); it != attlist.end(); ++it) {
760  string ns(it->GetNamespaceName());
761  string ns_prefix;
762  if (x_BeginNamespace(ns,kEmptyStr)) {
763  m_Output.PutEol();
764  m_Output.PutString(" xmlns");
765  ns_prefix = m_NsNameToPrefix[ns];
766  if (!ns_prefix.empty()) {
767  m_Output.PutChar(':');
768  m_Output.PutString(ns_prefix);
769  }
770  m_Output.PutString("=\"");
771  m_Output.PutString(ns);
772  m_Output.PutChar('\"');
773  }
774  ns_prefix = m_NsNameToPrefix[ns];
775 
776  m_Output.PutEol();
777  m_Output.PutString(" ");
778  if (!ns_prefix.empty()) {
779  m_Output.PutString(ns_prefix);
780  m_Output.PutChar(':');
781  }
782  m_Output.PutString(it->GetName());
783  m_Output.PutString("=\"");
784  WriteString(it->GetValue(),eStringTypeUTF8);
785  m_Output.PutChar('\"');
786  x_EndNamespace(ns);
787  }
788  m_Attlist = false;
789  }
790  OpenTagEnd();
791  }
792 
793 // value
794 // no verification on write!
795  const string& value = obj.GetValue();
796  if (value.empty()) {
797  OpenTagEndBack();
798  SelfCloseTagEnd();
800  x_EndNamespace(ns_name);
801  return;
802  }
803  bool was_open = true, was_close=true;
804  bool is_tag = false;
805  char attr_close ='\0';
806  for (const char* is = value.c_str(); *is; ++is) {
807  if (*is == '/' && *(is+1) == '>') {
809  was_open = false;
810  }
811  if (*is == '<') {
812  if (*(is+1) == '/') {
814  if (!was_open && was_close) {
815  m_Output.PutEol();
816  }
817  is_tag = was_open = false;
818  } else {
819  if (was_close) {
820  m_Output.PutEol();
821  }
823  is_tag = was_open = true;
824  }
825  }
826  if (*is != '>' && *is != '<' && *is != attr_close) {
828  } else {
829  m_Output.PutChar(*is);
830  }
831  if (*is == '<') {
832  if (*(is+1) == '/') {
833  m_Output.PutChar(*(++is));
834  }
835  if (GetReferenceSchema() && !m_CurrNsPrefix.empty()) {
837  m_Output.PutChar(':');
838  }
839  }
840  if (*is == '>') {
841  was_close = true;
842  is_tag = false;
843  attr_close = '\0';
844  } else {
845  was_close = false;
846  }
847  if (is_tag && *is == '=' && (*(is+1) == '\"' || *(is+1) == '\'')) {
848  attr_close = *(is+1);
849  }
850  }
851 
852 // close tag
853  if (!was_open) {
854  m_EndTag = true;
855  }
856  m_SkipIndent = !was_close;
857  CloseTag(obj_name);
858  x_EndNamespace(ns_name);
859 }
860 
862 {
863  CAnyContentObject obj;
864  in.ReadAnyContentObject(obj);
866 }
867 
869 {
870 #if BITSTRING_AS_VECTOR
871  static const char ToHex[] = "0123456789ABCDEF";
872  Uint1 data, mask;
873  bool done = false;
874  for ( CBitString::const_iterator i = obj.begin(); !done; ) {
875  for (data=0, mask=0x8; !done && mask!=0; mask >>= 1) {
876  if (*i) {
877  data |= mask;
878  }
879  done = (++i == obj.end());
880  }
881  m_Output.PutChar(ToHex[data]);
882  }
883 #else
884  if (IsCompressed()) {
886  CBitString::statistics st;
887  obj.calc_stat(&st);
888  char* buf = (char*)malloc(st.max_serialize_mem);
889  size_t len = bm::serialize(obj, (unsigned char*)buf, tmp_block);
890  WriteBytes(buf,len);
891  free(buf);
892  bm::aligned_free(tmp_block);
893  return;
894  }
896  CBitString::size_type ilast = obj.size();
897  CBitString::enumerator e = obj.first();
898  for (; i < ilast; ++i) {
899  m_Output.PutChar( (i == *e) ? '1' : '0');
900  if (i == *e) {
901  ++e;
902  }
903  }
904 #endif
905 }
906 
908 {
909  CBitString obj;
910  in.ReadBitString(obj);
911  WriteBitString(obj);
912 }
913 
915 {
916  if ( str == 0 ) {
917  OpenTagEndBack();
918  SelfCloseTagEnd();
919  }
920  else {
921  for ( ; *str; ++str) {
923  }
924  }
925 }
926 
928 {
930  return;
931  }
932  for ( const char* src = str.c_str(); *src; ++src ) {
933  WriteEncodedChar(src,type);
934  }
935 }
936 
938 {
939  for ( string::const_iterator i = str.begin(); i != str.end(); ++i ) {
941  }
942 }
943 
946 {
947  string str;
948  in.ReadString(str, type);
950  in.SetSpecialCaseUsed(CObjectIStream::eReadAsNormal);
951  WriteString(str, type);
953 }
954 
956 {
957  string str;
958  in.ReadStringStore(str);
959  for ( string::const_iterator i = str.begin(); i != str.end(); ++i ) {
961  }
962 }
963 
965 {
966  bool notag = TopFrame().HasMemberId() && TopFrame().GetMemberId().HasNotag();
967  bool nillable = TopFrame().HasMemberId() && TopFrame().GetMemberId().IsNillable();
968  if (TopFrame().GetNotag() && !notag) {
969  if (m_LastTagAction == eTagClose) {
970  OpenStackTag(0);
974  CloseStackTag(0);
975  }
976  return;
977  }
981 }
982 
984 {
985  m_Output.PutString("<object index=");
986  if ( sizeof(TObjectIndex) == sizeof(Int4) )
987  m_Output.PutInt4(Int4(index));
988  else if ( sizeof(TObjectIndex) == sizeof(Int8) )
989  m_Output.PutInt8(index);
990  else
991  ThrowError(fIllegalCall, "invalid size of TObjectIndex"
992  "must be either sizeof(Int4) or sizeof(Int8)");
993  m_Output.PutString("/>");
994  m_EndTag = true;
995 }
996 
997 void CObjectOStreamXml::WriteTag(const string& name)
998 {
999  if (!m_CurrNsPrefix.empty() && IsNsQualified()) {
1001  m_Output.PutChar(':');
1002  }
1003  m_Output.PutString(name);
1004 }
1005 
1007 {
1008  if (m_Attlist) {
1009  if ( m_LastTagAction == eTagOpen ) {
1010  m_Output.PutChar(' ');
1012  }
1013  } else {
1014  if (m_SkipIndent) {
1015  m_SkipIndent = false;
1016  } else {
1017  m_Output.PutEol(false);
1018  m_Output.PutIndent();
1019  }
1020  m_Output.PutChar('<');
1022  }
1023  m_EndTag = false;
1024 }
1025 
1027 {
1028  if (m_Attlist) {
1029  if ( m_LastTagAction == eAttlistTag ) {
1030  m_Output.PutString("=\"");
1031  }
1032  } else {
1033  if ( m_LastTagAction == eTagOpen ) {
1034  m_Output.PutChar('>');
1037  }
1038  }
1039 }
1040 
1042 {
1045  m_Output.BackChar('>');
1047 }
1048 
1050 {
1052  m_Output.PutString("/>");
1054  m_EndTag = true;
1055  m_SkipIndent = false;
1056 }
1057 
1059 {
1061  if ( m_LastTagAction == eTagOpen ) {
1063  }
1064 }
1065 
1067 {
1070  if (m_EndTag && !m_SkipIndent) {
1071  m_Output.PutEol(false);
1072  m_Output.PutIndent();
1073  }
1074  m_Output.PutString("</");
1076 }
1077 
1079 {
1080  m_Output.PutChar('>');
1082  m_EndTag = true;
1083  m_SkipIndent = false;
1084 }
1085 
1087 {
1088  const TFrame& frame = FetchFrameFromTop(level);
1089  switch ( frame.GetFrameType() ) {
1090  case TFrame::eFrameNamed:
1091  case TFrame::eFrameArray:
1092  case TFrame::eFrameClass:
1093  case TFrame::eFrameChoice:
1094  {
1095  _ASSERT(frame.GetTypeInfo());
1096  const string& name = frame.GetTypeInfo()->GetName();
1097  if ( !name.empty() ) {
1098  WriteTag(name);
1099 #if defined(NCBI_SERIAL_IO_TRACE)
1100  TraceTag(name);
1101 #endif
1102  } else {
1103  PrintTagName(level + 1);
1104  }
1105  return;
1106  }
1109  {
1110  bool attlist = m_Attlist;
1111  if (!x_IsStdXml()) {
1112  PrintTagName(level + 1);
1113  m_Output.PutChar('_');
1114  m_Attlist = true;
1115  }
1116  WriteTag(frame.GetMemberId().GetName());
1117  m_Attlist = attlist;
1118 #if defined(NCBI_SERIAL_IO_TRACE)
1119  TraceTag(frame.GetMemberId().GetName());
1120 #endif
1121  return;
1122  }
1124  {
1125  PrintTagName(level + 1);
1126  if (!x_IsStdXml()) {
1127  m_Output.PutString("_E");
1128  }
1129  return;
1130  }
1131  default:
1132  break;
1133  }
1134  ThrowError(fIllegalCall, "illegal frame type");
1135 }
1136 
1138 {
1139  OpenTag(typeInfo);
1140 }
1141 
1143 {
1144  CloseTag(typeInfo);
1145 }
1146 
1148  TTypeInfo typeInfo)
1149 {
1150  OpenTag(typeInfo);
1151  WriteObject(object, typeInfo);
1152  CloseTag(typeInfo);
1153 }
1154 
1156 {
1157  bool needNs = x_ProcessTypeNamespace(containerType);
1158  if (!m_StdXml) {
1159  if (TopFrame().GetFrameType() == CObjectStackFrame::eFrameArray &&
1160  FetchFrameFromTop(1).GetFrameType() == CObjectStackFrame::eFrameNamed) {
1161  const CClassTypeInfo* clType =
1162  dynamic_cast<const CClassTypeInfo*>(FetchFrameFromTop(1).GetTypeInfo());
1163  if (clType && clType->Implicit()) {
1164  TopFrame().SetNotag();
1165  return;
1166  }
1167  }
1168  OpenTagIfNamed(containerType);
1169  }
1170  if (needNs) {
1171  x_WriteClassNamespace(containerType);
1172  }
1173 }
1174 
1176 {
1177  if (!m_StdXml && !TopFrame().GetNotag()) {
1178  CloseTagIfNamed(TopFrame().GetTypeInfo());
1179  }
1181 }
1182 
1184 {
1185  while ( elementType->GetName().empty() ) {
1186  if ( elementType->GetTypeFamily() != eTypeFamilyPointer )
1187  return false;
1188  elementType = CTypeConverter<CPointerTypeInfo>::SafeCast(elementType)->GetPointedType();
1189  }
1190  // found named type
1191  return true;
1192 }
1193 
1195 {
1196  if ( !WillHaveName(elementType) ) {
1197  BeginArrayElement(elementType);
1198  }
1199 }
1200 
1202 {
1203  if ( !WillHaveName(TopFrame().GetTypeInfo()) ) {
1204  EndArrayElement();
1205  }
1206 }
1207 
1208 #ifdef VIRTUAL_MID_LEVEL_IO
1210  TConstObjectPtr containerPtr)
1211 {
1212  if ( !cType->GetName().empty() ) {
1213  BEGIN_OBJECT_FRAME2(eFrameArray, cType);
1214  OpenTag(cType);
1215 
1216  WriteContainerContents(cType, containerPtr);
1217 
1218  EolIfEmptyTag();
1219  CloseTag(cType);
1220  END_OBJECT_FRAME();
1221  }
1222  else {
1223  WriteContainerContents(cType, containerPtr);
1224  }
1225 }
1226 #endif
1228 {
1229  if (x_IsStdXml()) {
1230  CObjectTypeInfo type(GetRealTypeInfo(elementType));
1231  if (type.GetTypeFamily() != eTypeFamilyPrimitive ||
1232  type.GetPrimitiveValueType() == ePrimitiveValueAny) {
1233  TopFrame().SetNotag();
1234  return;
1235  }
1236  if (m_SkipNextTag && type.GetTypeFamily() == eTypeFamilyPrimitive) {
1237  m_Output.PutChar(' ');
1238  TopFrame().SetNotag();
1239  return;
1240  }
1241  }
1242  OpenStackTag(0);
1243 }
1244 
1246 {
1247  if (TopFrame().GetNotag()) {
1248  TopFrame().SetNotag(false);
1249  } else {
1250  CloseStackTag(0);
1251  }
1252 }
1253 
1255  TConstObjectPtr containerPtr)
1256 {
1257  TTypeInfo elementType = cType->GetElementType();
1259  if ( WillHaveName(elementType) ) {
1260  if ( cType->InitIterator(i, containerPtr) ) {
1261 
1262  const CPointerTypeInfo* pointerType =
1263  dynamic_cast<const CPointerTypeInfo*>(elementType);
1264  do {
1265  TConstObjectPtr elementPtr = cType->GetElementPtr(i);
1266  if ( pointerType &&
1267  !pointerType->GetObjectPointer(elementPtr) ) {
1268  if ( GetVerifyData() == eSerialVerifyData_Yes ) {
1270  "NULL element while writing container "+
1271  cType->GetName());
1272  }
1273  continue;
1274  }
1275 
1276  WriteObject(elementPtr, elementType);
1277 
1278  } while ( cType->NextElement(i) );
1279  }
1280  }
1281  else {
1282  BEGIN_OBJECT_FRAME2(eFrameArrayElement, elementType);
1283 
1284  if ( cType->InitIterator(i, containerPtr) ) {
1285 
1286  const CPointerTypeInfo* pointerType =
1287  dynamic_cast<const CPointerTypeInfo*>(elementType);
1288  do {
1289  TConstObjectPtr elementPtr = cType->GetElementPtr(i);
1290  if ( pointerType &&
1291  !pointerType->GetObjectPointer(elementPtr) ) {
1292  if ( GetVerifyData() == eSerialVerifyData_Yes ) {
1294  "NULL element while writing container "+
1295  cType->GetName());
1296  }
1297  continue;
1298  }
1299 
1300  BeginArrayElement(elementType);
1301  WriteObject(elementPtr, elementType);
1302  EndArrayElement();
1303  } while ( cType->NextElement(i) );
1304  } else {
1305  const TFrame& frame = FetchFrameFromTop(1);
1307  const CClassTypeInfo* clType =
1308  dynamic_cast<const CClassTypeInfo*>(frame.GetTypeInfo());
1309  if (clType && clType->Implicit() && clType->IsImplicitNonEmpty()) {
1310  ThrowError(fInvalidData, "container is empty");
1311  }
1312  }
1313  }
1314 
1315  END_OBJECT_FRAME();
1316  }
1317 }
1318 
1320 {
1321  CheckStdXml(namedTypeInfo);
1322  if (m_SkipNextTag || namedTypeInfo->GetName().empty()) {
1323  TopFrame().SetNotag();
1324  m_SkipNextTag = false;
1325  } else {
1326  TTypeInfo realtype = GetRealTypeInfo(namedTypeInfo);
1327  if (realtype->GetTypeFamily() == eTypeFamilyPrimitive &&
1328  GetStackDepth() > 2 && m_StdXml) {
1329  TopFrame().SetNotag();
1330  m_SkipNextTag = false;
1331  return;
1332  }
1333  bool needNs = x_ProcessTypeNamespace(namedTypeInfo);
1334  OpenTag(namedTypeInfo);
1335  if (needNs) {
1336  x_WriteClassNamespace(namedTypeInfo);
1337  }
1338  }
1339  const CAliasTypeInfo* aliasType =
1340  dynamic_cast<const CAliasTypeInfo*>(namedTypeInfo);
1341  if (aliasType) {
1342  m_SkipNextTag = aliasType->IsFullAlias();
1343  }
1344  else if (m_StdXml) {
1345  const CClassTypeInfo* classType = dynamic_cast<const CClassTypeInfo*>(namedTypeInfo);
1346  m_SkipNextTag = (classType && classType->Implicit());
1347  }
1348 }
1349 
1351 {
1352  m_SkipNextTag = false;
1353  if (TopFrame().GetNotag()) {
1354  TopFrame().SetNotag(false);
1355  return;
1356  }
1357  CloseTag(TopFrame().GetTypeInfo());
1359 }
1360 
1361 #ifdef VIRTUAL_MID_LEVEL_IO
1362 
1363 void CObjectOStreamXml::WriteNamedType(TTypeInfo namedTypeInfo,
1364  TTypeInfo typeInfo,
1365  TConstObjectPtr object)
1366 {
1367  BEGIN_OBJECT_FRAME2(eFrameNamed, namedTypeInfo);
1368 
1369  BeginNamedType(namedTypeInfo);
1370  WriteObject(object, typeInfo);
1371  EndNamedType();
1372 
1373  END_OBJECT_FRAME();
1374 }
1375 
1376 void CObjectOStreamXml::CopyNamedType(TTypeInfo namedTypeInfo,
1377  TTypeInfo objectType,
1378  CObjectStreamCopier& copier)
1379 {
1380  BEGIN_OBJECT_2FRAMES_OF2(copier, eFrameNamed, namedTypeInfo);
1381  copier.In().BeginNamedType(namedTypeInfo);
1382  BeginNamedType(namedTypeInfo);
1383  CopyObject(objectType, copier);
1384  EndNamedType();
1385  copier.In().EndNamedType();
1386  END_OBJECT_2FRAMES_OF(copier);
1387 }
1388 #endif
1389 
1391 {
1392  if (typeinfo->GetCodeVersion() > 21600) {
1393  m_StdXml = typeinfo->GetDataSpec() != EDataSpec::eASN;
1394  } else {
1395  const CClassTypeInfo* classType =
1396  dynamic_cast<const CClassTypeInfo*>(typeinfo);
1397  if (classType) {
1398  TMemberIndex first = classType->GetItems().FirstIndex();
1399  m_StdXml = classType->GetItems().GetItemInfo(first)->GetId().HaveNoPrefix();
1400  }
1401  }
1402 }
1403 
1405 {
1406  CheckStdXml(classInfo);
1407  if (m_SkipNextTag) {
1408  TopFrame().SetNotag();
1409  m_SkipNextTag = false;
1410  return;
1411  }
1412  bool needNs = x_ProcessTypeNamespace(classInfo);
1413  OpenTagIfNamed(classInfo);
1414  if (needNs) {
1415  x_WriteClassNamespace(classInfo);
1416  }
1417 }
1418 
1420 {
1421  if (TopFrame().GetNotag()) {
1422  TopFrame().SetNotag(false);
1423  return;
1424  }
1426  EolIfEmptyTag();
1427  }
1430  } else {
1431  CloseTagIfNamed(TopFrame().GetTypeInfo());
1432  }
1434 }
1435 
1437 {
1438  const CClassTypeInfoBase* classType = dynamic_cast<const CClassTypeInfoBase*>
1440  _ASSERT(classType);
1441  BeginClassMember(classType->GetItemInfo(id.GetName())->GetTypeInfo(),id);
1442 }
1443 
1445  const CMemberId& id)
1446 {
1447  if (x_IsStdXml()) {
1448  if(id.IsAttlist()) {
1449  if(m_LastTagAction == eTagClose) {
1450  OpenTagEndBack();
1451  }
1452  m_Attlist = true;
1453  TopFrame().SetNotag();
1454  } else {
1455  ETypeFamily type = GetRealTypeFamily(memberType);
1456  bool needTag = true;
1457  if (GetEnforcedStdXml()) {
1458  if (type == eTypeFamilyContainer) {
1459  TTypeInfo mem_type = GetRealTypeInfo(memberType);
1460  TTypeInfo elem_type = GetContainerElementTypeInfo(mem_type);
1461  needTag = (elem_type->GetTypeFamily() != eTypeFamilyPrimitive ||
1462  elem_type->GetName() != mem_type->GetName());
1463  }
1464  } else {
1465  needTag = !id.HasNotag() && !id.HasAnyContent() && type != eTypeFamilyContainer;
1467  if (needTag && m_SkipNextTag) {
1468  if (memberType->HasNamespaceName() && m_NsNameToPrefix.find(memberType->GetNamespaceName()) == m_NsNameToPrefix.end()) {
1469  needTag = m_SkipNextTag = false;
1470  }
1471  }
1472  }
1473  if (needTag) {
1474  OpenStackTag(0);
1475  } else {
1476  TopFrame().SetNotag();
1477  }
1478  if (type == eTypeFamilyPrimitive) {
1479  m_SkipIndent = id.HasNotag();
1480  }
1481  }
1482  } else {
1483  OpenStackTag(0);
1484  }
1485 }
1486 
1488 {
1489  m_SkipNextTag = false;
1490  if (TopFrame().GetNotag()) {
1491  TopFrame().SetNotag(false);
1492  m_Attlist = false;
1493  if(m_LastTagAction == eTagOpen) {
1494  OpenTagEnd();
1495  }
1496  } else {
1497  CloseStackTag(0);
1498  }
1499 }
1500 
1501 
1502 #ifdef VIRTUAL_MID_LEVEL_IO
1503 
1504 void CObjectOStreamXml::WriteClass(const CClassTypeInfo* classType,
1505  TConstObjectPtr classPtr)
1506 {
1507  if ( (m_Attlist && classType->IsNsQualified() == eNSQualified) || !classType->GetName().empty() ) {
1508  BEGIN_OBJECT_FRAME2(eFrameClass, classType);
1509 
1510  BeginClass(classType);
1511  for ( CClassTypeInfo::CIterator i(classType); i.Valid(); ++i ) {
1512  classType->GetMemberInfo(i)->WriteMember(*this, classPtr);
1513  }
1514  EndClass();
1515 
1516  END_OBJECT_FRAME();
1517  }
1518  else {
1519  for ( CClassTypeInfo::CIterator i(classType); i.Valid(); ++i ) {
1520  classType->GetMemberInfo(i)->WriteMember(*this, classPtr);
1521  }
1522  }
1523 }
1524 
1525 void CObjectOStreamXml::WriteClassMember(const CMemberId& memberId,
1526  TTypeInfo memberType,
1527  TConstObjectPtr memberPtr)
1528 {
1529  BEGIN_OBJECT_FRAME2(eFrameClassMember,memberId);
1530 
1531  BeginClassMember(memberType,memberId);
1532  WriteObject(memberPtr, memberType);
1533  EndClassMember();
1534 
1535  END_OBJECT_FRAME();
1536 }
1537 
1538 bool CObjectOStreamXml::WriteClassMember(const CMemberId& memberId,
1539  const CDelayBuffer& buffer)
1540 {
1541  if ( !buffer.HaveFormat(eSerial_Xml) )
1542  return false;
1543 
1544  BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId);
1545  OpenStackTag(0);
1546 
1547  Write(buffer.GetSource());
1548 
1549  CloseStackTag(0);
1550  END_OBJECT_FRAME();
1551 
1552  return true;
1553 }
1554 
1556  TTypeInfo /*memberType*/, TConstObjectPtr /*memberPtr*/, ESpecialCaseWrite how)
1557 {
1558  if (m_Attlist) {
1559  return;
1560  }
1561  m_SpecialCaseWrite = how;
1562  if (memberId.HasNotag() || m_SkipNextTag) {
1564  } else {
1565  BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId);
1566  OpenStackTag(0);
1569  CloseStackTag(0);
1570  END_OBJECT_FRAME();
1571  }
1573 }
1574 #endif
1575 
1577 {
1578  CheckStdXml(choiceType);
1579  if (m_SkipNextTag) {
1580  TopFrame().SetNotag();
1581  m_SkipNextTag = false;
1582  return;
1583  }
1584  bool needNs = x_ProcessTypeNamespace(choiceType);
1585  OpenTagIfNamed(choiceType);
1586  if (needNs) {
1587  x_WriteClassNamespace(choiceType);
1588  }
1589 }
1590 
1592 {
1593  if (TopFrame().GetNotag()) {
1594  TopFrame().SetNotag(false);
1595  return;
1596  }
1597  CloseTagIfNamed(TopFrame().GetTypeInfo());
1599 }
1600 
1602  const CMemberId& id)
1603 {
1604  if (x_IsStdXml()) {
1605  const CVariantInfo* var_info = choiceType->GetVariantInfo(id.GetName());
1607  bool needTag = true;
1608  if (GetEnforcedStdXml()) {
1609  if (type == eTypeFamilyContainer) {
1610  TTypeInfo var_type = GetRealTypeInfo(var_info->GetTypeInfo());
1611  TTypeInfo elem_type = GetContainerElementTypeInfo(var_type);
1612  needTag = (elem_type->GetTypeFamily() != eTypeFamilyPrimitive ||
1613  elem_type->GetName() != var_type->GetName());
1614  }
1615  } else {
1616  needTag = !id.HasNotag() && !id.HasAnyContent() && type != eTypeFamilyContainer;
1618  if (needTag && m_SkipNextTag) {
1619  TTypeInfo var_type = choiceType->GetItemInfo(id.GetName())->GetTypeInfo();
1620  if (var_type->HasNamespaceName() && m_NsNameToPrefix.find(var_type->GetNamespaceName()) == m_NsNameToPrefix.end()) {
1621  needTag = m_SkipNextTag = false;
1622  }
1623  }
1624  }
1625  if (needTag) {
1626  OpenStackTag(0);
1627  } else {
1628  TopFrame().SetNotag();
1629  }
1630  if (type == eTypeFamilyPrimitive) {
1631  m_SkipIndent = id.HasNotag();
1632  }
1633  } else {
1634  OpenStackTag(0);
1635  }
1636 }
1637 
1639 {
1640  m_SkipNextTag = false;
1641  if (TopFrame().GetNotag()) {
1642  TopFrame().SetNotag(false);
1643  } else {
1644  CloseStackTag(0);
1645  }
1646 }
1647 
1649  TConstObjectPtr choicePtr)
1650 {
1651  TMemberIndex index = choiceType->GetIndex(choicePtr);
1652  const CVariantInfo* variantInfo = choiceType->GetVariantInfo(index);
1653  BEGIN_OBJECT_FRAME2(eFrameChoiceVariant, variantInfo->GetId());
1654  OpenStackTag(0);
1655 
1656  variantInfo->WriteVariant(*this, choicePtr);
1657 
1658  CloseStackTag(0);
1659  END_OBJECT_FRAME();
1660 }
1661 
1662 static const char* const HEX = "0123456789ABCDEF";
1663 
1665  const char* bytes, size_t length)
1666 {
1667  if (IsCompressed()) {
1668  WriteBase64Bytes(bytes,length);
1669  return;
1670  }
1671  WriteBytes(bytes,length);
1672 }
1673 
1674 void CObjectOStreamXml::WriteBase64Bytes(const char* bytes, size_t length)
1675 {
1676  const size_t chunk_in = 57;
1677  const size_t chunk_out = 80;
1678  if (length > chunk_in) {
1679  m_Output.PutEol(false);
1680  }
1681  char dst_buf[chunk_out];
1682  size_t bytes_left = length;
1683  size_t src_read=0, dst_written=0, line_len=0;
1684  while (bytes_left > 0 && bytes_left <= length) {
1685  BASE64_Encode(bytes, min(bytes_left,chunk_in), &src_read,
1686  dst_buf, chunk_out, &dst_written, &line_len);
1687  m_Output.PutString(dst_buf,dst_written);
1688  bytes_left -= src_read;
1689  bytes += src_read;
1690  if (bytes_left > 0) {
1691  m_Output.PutEol(false);
1692  }
1693  }
1694  if (length > chunk_in) {
1695  m_Output.PutEol(false);
1696  }
1697 }
1698 
1699 void CObjectOStreamXml::WriteBytes(const char* bytes, size_t length)
1700 {
1701  while ( length-- > 0 ) {
1702  char c = *bytes++;
1703  m_Output.PutChar(HEX[(c >> 4) & 0xf]);
1704  m_Output.PutChar(HEX[c & 0xf]);
1705  }
1706 }
1707 
1709  const char* chars, size_t length)
1710 {
1711  while ( length-- > 0 ) {
1712  char c = *chars++;
1713  WriteEscapedChar(c);
1714  }
1715 }
1716 
1717 
1719 {
1721  FlushBuffer();
1722 }
1723 
1724 #if defined(NCBI_SERIAL_IO_TRACE)
1725 
1726 void CObjectOStreamXml::TraceTag(const string& name)
1727 {
1728  cout << ", Tag=" << name;
1729 }
1730 
1731 #endif
1732 
ncbi::TMaskedQueryRegions mask
Serializable object that stores any combination of parsable data.
Definition: serialbase.hpp:264
CDelayBuffer.
Definition: delaybuf.hpp:58
CObjectIStream –.
Definition: objistr.hpp:93
CObjectOStreamXml –.
Definition: objostrxml.hpp:54
CObjectOStream –.
Definition: objostr.hpp:83
CObjectStreamCopier –.
Definition: objcopy.hpp:71
CObjectTypeInfo –.
Definition: objectinfo.hpp:94
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
CTypeInfo class contains all information about C++ types (both basic and classes): members and layout...
Definition: typeinfo.hpp:76
size_type size() const noexcept
Returns bvector's capacity (number of bits it can store)
Definition: bm.h:1300
friend class enumerator
Definition: bm.h:793
bvector_size_type size_type
Definition: bm.h:121
enumerator first() const
Returns enumerator pointing on the first non-zero bit.
Definition: bm.h:1871
enumerator end() const
Returns enumerator pointing on the next bit after the last.
Definition: bm.h:1877
void calc_stat(struct bm::bvector< Alloc >::statistics *st) const noexcept
Calculates bitvector statistics.
Definition: bm.h:3978
void erase(iterator pos)
Definition: map.hpp:167
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
void clear()
Definition: map.hpp:169
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: set.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
std::ofstream out("events_result.xml")
main entry point for tests
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
static char precision
Definition: genparams.c:28
static int type
Definition: getdata.c:31
static const char * str(char *buf, int n)
Definition: stats.c:84
static char tmp[3200]
Definition: utf8.c:42
char data[12]
Definition: iconv.c:80
@ eTakeOwnership
An object can take ownership of another.
Definition: ncbi_types.h:136
@ eNoOwnership
No ownership is assumed.
Definition: ncbi_types.h:135
#define ERR_POST_X_ONCE(err_subcode, message)
Error posting only once during program execution with default error code and given error subcode.
Definition: ncbidiag.hpp:621
#define isnan
Definition: ncbifloat.h:92
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
#define finite
Define value of finite (Is Finite).
Definition: ncbifloat.h:103
const CMemberId & GetId(void) const
const string & GetName(void) const
void WriteVariant(CObjectOStream &out, TConstObjectPtr choicePtr) const
bool IsNillable(void) const
Definition: memberid.cpp:150
void WriteMember(CObjectOStream &out, TConstObjectPtr classPtr) const
const CItemInfo * GetItemInfo(TMemberIndex index) const
static TMemberIndex FirstIndex(void)
Definition: memberlist.hpp:78
bool HasNotag(void) const
const string & GetName(void) const
Definition: enumerated.cpp:79
bool HaveNoPrefix(void) const
TTypeInfo GetTypeInfo(void) const
const string & FindNameEx(TEnumValueType value, bool allowBadValue) const
Definition: enumerated.cpp:163
bool IsInteger(void) const
Check whether the type is defined as INTEGER in ASN.1 spec.
Definition: enumvalues.hpp:75
const CStringUTF8 & GetValue(void) const
Get normalized value.
int TEnumValueType
Definition: serialdef.hpp:232
size_t TMemberIndex
Type used for indexing class members and choice variants.
Definition: serialdef.hpp:230
const string & GetNamespaceName(void) const
Get namespace name.
const void * TConstObjectPtr
Definition: serialdef.hpp:59
const string & GetNamespacePrefix(void) const
Get namespace prefix.
ETypeFamily
Type family.
Definition: serialdef.hpp:138
EStringType
String type.
Definition: serialdef.hpp:185
static const TObjectType * SafeCast(TTypeInfo type)
Definition: serialutil.hpp:76
unsigned int TSerial_Format_Flags
MSerial_Format –.
Definition: serialbase.hpp:571
const string & GetName(void) const
Get local name.
const vector< CSerialAttribInfoItem > & GetAttributes(void) const
Get object attributes.
@ eNSQualified
Definition: serialdef.hpp:201
@ eNSUnqualified
Definition: serialdef.hpp:200
@ eSerialVerifyData_Yes
do verify
Definition: serialdef.hpp:111
@ fSerial_Xml_NoEol
do not write end-of-line symbol
Definition: serialdef.hpp:88
@ fSerial_Xml_NoIndentation
do not use indentation
Definition: serialdef.hpp:87
@ fSerial_Xml_NoSchemaLoc
do not write schemaLocation data
Definition: serialdef.hpp:92
@ fSerial_Xml_NoXmlDecl
do not write XMLDecl
Definition: serialdef.hpp:89
@ fSerial_Xml_RefSchema
use reference to a Schema
Definition: serialdef.hpp:91
@ fSerial_Xml_NoRefDTD
do not use reference to a DTD
Definition: serialdef.hpp:90
@ ePrimitiveValueAny
Definition: serialdef.hpp:160
@ eTypeFamilyContainer
Definition: serialdef.hpp:142
@ eTypeFamilyPointer
Definition: serialdef.hpp:143
@ eTypeFamilyPrimitive
Definition: serialdef.hpp:139
@ eStringTypeUTF8
UTF8-encoded string.
Definition: serialdef.hpp:187
@ eSerial_Xml
XML.
Definition: serialdef.hpp:75
virtual void WriteString(const string &s, EStringType type=eStringTypeVisible) override
Definition: objostrxml.cpp:927
static ETypeFamily GetRealTypeFamily(TTypeInfo typeInfo)
Definition: objstack.cpp:343
virtual void WriteEnum(const CEnumeratedTypeValues &values, TEnumValueType value) override
Definition: objostrxml.cpp:489
virtual void CopyStringStore(CObjectIStream &in) override
Definition: objostrxml.cpp:955
void SetDefaultStringEncoding(EEncoding enc)
Set default encoding of 'string' objects If XML data encoding is different, string will be converted ...
Definition: objostrxml.cpp:118
void WriteTag(const string &name)
Definition: objostrxml.cpp:997
virtual void WriteOther(TConstObjectPtr object, TTypeInfo typeInfo) override
char ReplaceVisibleChar(char c, EFixNonPrint fix_method, const CObjectStack *io, const CTempString &str, char subst)
Definition: objistr.cpp:1855
static string sm_DefaultDTDFilePrefix
Definition: objostrxml.hpp:438
virtual void WriteBytes(const ByteBlock &block, const char *bytes, size_t length) override
bool m_FastWriteDouble
Definition: objostr.hpp:806
bool GetReferenceDTD(void) const
Get DTD referencing parameter.
Definition: objostrxml.cpp:140
MLIOVIR void WriteClassMemberSpecialCase(const CMemberId &memberId, TTypeInfo memberType, TConstObjectPtr memberPtr, ESpecialCaseWrite how)
Definition: objostr.cpp:580
void x_WriteClassNamespace(TTypeInfo type)
Definition: objostrxml.cpp:284
void CloseTagEnd(void)
void WriteClassMember(const CConstObjectInfoMI &member)
Definition: objostr.cpp:571
void EolIfEmptyTag(void)
ERealValueFormat m_RealFmt
Definition: objostrxml.hpp:442
EFixNonPrint x_FixCharsMethod(void) const
Definition: objostr.cpp:287
void WriteEscapedChar(char c)
Definition: objostrxml.cpp:502
bool x_SpecialCaseWrite(void)
Definition: objostrxml.cpp:584
virtual void EndContainer(void) override
virtual void EndNamedType(void) override
virtual void BeginClassMember(const CMemberId &id) override
#define END_OBJECT_2FRAMES_OF(Stream)
Definition: objstack.hpp:234
virtual void BeginChoice(const CChoiceTypeInfo *choiceType) override
bool GetEnforcedStdXml(void)
Get scope prefixes handling parameter.
Definition: objostrxml.hpp:126
virtual void SetFormattingFlags(TSerial_Format_Flags flags) override
Set output formatting flags.
Definition: objostrxml.cpp:174
virtual void EndClassMember(void) override
static TTypeInfo GetRealTypeInfo(TTypeInfo typeInfo)
Definition: objstack.cpp:331
void SetUseSchemaLocation(bool use_loc=true)
Put Schema location information into generated XML document.
Definition: objostrxml.cpp:145
virtual void WriteAnyContentObject(const CAnyContentObject &obj) override
Definition: objostrxml.cpp:726
void CopyObject(TTypeInfo objectType, CObjectStreamCopier &copier)
void SetReferenceSchema(bool use_schema=true)
Make generated XML document reference XML schema.
Definition: objostrxml.cpp:128
void OpenStackTag(size_t level)
EEncoding m_Encoding
Definition: objostrxml.hpp:443
virtual void WriteDouble(double data) override
Definition: objostrxml.cpp:710
#define ThrowError(flag, mess)
Definition: objstack.hpp:113
bool GetUseSchemaLocation(void) const
Get Schema location output parameter.
Definition: objostrxml.cpp:149
map< string, string > m_NsNameToPrefix
Definition: objostrxml.hpp:449
void CloseTag(const string &name)
void PrintTagName(size_t level)
virtual void WriteBool(bool data) override
Definition: objostrxml.cpp:604
bool IsCompressed(void) const
Definition: objstack.cpp:193
void SetReferenceDTD(bool use_dtd=true)
Make generated XML document reference DTD.
Definition: objostrxml.cpp:136
EEncoding m_StringEncoding
Definition: objostrxml.hpp:444
#define BEGIN_OBJECT_FRAME2(Type, Arg)
Definition: objstack.hpp:225
map< string, string > m_NsPrefixToName
Definition: objostrxml.hpp:450
void WriteContainerContents(const CContainerTypeInfo *containerType, TConstObjectPtr containerPtr)
bool x_IsStdXml(void)
Definition: objostrxml.hpp:406
virtual void WriteOtherEnd(TTypeInfo typeInfo) override
virtual void WriteNull(void) override
Definition: objostrxml.cpp:720
MLIOVIR void WriteContainer(const CContainerTypeInfo *containerType, TConstObjectPtr containerPtr)
Definition: objostr.cpp:810
virtual void BeginNamedType(TTypeInfo namedTypeInfo)
Definition: objistr.cpp:1276
char x_VerifyChar(char)
Definition: objostrxml.cpp:551
void SetNotag(bool set=true)
virtual void WriteBitString(const CBitString &obj) override
Definition: objostrxml.cpp:868
virtual void EndChoice(void) override
void WriteDouble2(double data, unsigned digits)
Definition: objostrxml.cpp:661
TFrame & FetchFrameFromTop(size_t index)
virtual void EndOfWrite(void) override
Definition: objostrxml.cpp:278
virtual void WriteSeparator(void) override
virtual void EndNamedType(void)
Definition: objistr.cpp:1280
void WriteObject(const CConstObjectInfo &object)
Definition: objostr.cpp:566
deque< string > m_NsPrefixes
Definition: objostrxml.hpp:451
string GetDefaultSchemaNamespace(void)
Get default value of namespace name of generated DTD documents.
void CloseTagIfNamed(TTypeInfo type)
virtual void BeginContainerElement(TTypeInfo elementType) override
void Write(const CConstObjectInfo &object)
Definition: objostr.cpp:593
virtual void CopyString(CObjectIStream &in, EStringType type=eStringTypeVisible) override
Definition: objostrxml.cpp:944
ERealValueFormat
formatting of values of type 'real' ('double')
Definition: objostrxml.hpp:248
void EndArrayElement(void)
void WriteEncodedChar(const char *&src, EStringType type=eStringTypeVisible)
Definition: objostrxml.cpp:556
static TTypeInfo GetContainerElementTypeInfo(TTypeInfo typeInfo)
Definition: objstack.cpp:348
bool GetReferenceSchema(void) const
Get Schema referencing parameter.
Definition: objostrxml.cpp:132
#define END_OBJECT_FRAME()
Definition: objstack.hpp:227
size_t GetStackDepth(void) const
CObjectIStream & In(void) const
virtual ~CObjectOStreamXml(void)
Destructor.
Definition: objostrxml.cpp:104
virtual void CopyAnyContentObject(CObjectIStream &in) override
Definition: objostrxml.cpp:861
virtual void BeginClass(const CClassTypeInfo *classInfo) override
size_t TObjectIndex
Definition: objostr.hpp:775
virtual void EndChoiceVariant(void) override
bool WillHaveName(TTypeInfo elementType)
string GetModuleName(TTypeInfo type)
Definition: objostrxml.cpp:213
void OpenTagIfNamed(TTypeInfo type)
ESpecialCaseWrite m_SpecialCaseWrite
Definition: objostr.hpp:803
const TFrame & TopFrame(void) const
TTypeInfo GetTypeInfo(void) const
virtual void WriteInt8(Int8 data) override
Definition: objostrxml.cpp:645
ERealValueFormat GetRealValueFormat(void) const
Get formatting of values of type real.
Definition: objostrxml.cpp:156
char x_FixCharsSubst(void) const
Definition: objostr.hpp:790
MLIOVIR void CopyNamedType(TTypeInfo namedTypeInfo, TTypeInfo typeInfo, CObjectStreamCopier &copier)
Definition: objostr.cpp:761
virtual void EndOfWrite(void)
Definition: objostr.cpp:559
MLIOVIR void WriteClass(const CClassTypeInfo *objectType, TConstObjectPtr objectPtr)
Definition: objostr.cpp:892
bool IsNsQualified(void)
Definition: objstack.cpp:148
void WriteBase64Bytes(const char *bytes, size_t length)
void BeginArrayElement(TTypeInfo elementType)
COStreamBuffer m_Output
Definition: objostr.hpp:796
virtual void CopyBitString(CObjectIStream &in) override
Definition: objostrxml.cpp:907
bool StackIsEmpty(void) const
const CMemberId & GetMemberId(void) const
void WriteChoiceContents(const CChoiceTypeInfo *choiceType, TConstObjectPtr choicePtr)
virtual void WriteChar(char data) override
Definition: objostrxml.cpp:624
virtual void CopyEnum(const CEnumeratedTypeValues &values, CObjectIStream &in) override
Definition: objostrxml.cpp:495
virtual void WriteFileHeader(TTypeInfo type) override
Definition: objostrxml.cpp:232
#define BEGIN_OBJECT_2FRAMES_OF2(Stream, Type, Arg)
Definition: objstack.hpp:249
void FlushBuffer(void)
void OpenTagEnd(void)
void CloseStackTag(size_t level)
virtual void WriteNullPointer(void) override
Definition: objostrxml.cpp:964
bool HasMemberId(void) const
virtual void WriteFloat(float data) override
Definition: objostrxml.cpp:715
virtual void EndClass(void) override
void x_EndNamespace(const string &ns_name)
Definition: objostrxml.cpp:404
EEncoding GetEncoding(void) const
Get XML character encoding.
Definition: objostrxml.cpp:113
EEncoding GetDefaultStringEncoding(void) const
Get default encoding of 'string' objects.
Definition: objostrxml.cpp:123
virtual void WriteUint8(Uint8 data) override
Definition: objostrxml.cpp:653
virtual void WriteChars(const CharBlock &block, const char *chars, size_t length) override
virtual void WriteUint4(Uint4 data) override
Definition: objostrxml.cpp:637
void x_EndTypeNamespace(void)
Definition: objostrxml.cpp:359
virtual void WriteObjectReference(TObjectIndex index) override
Definition: objostrxml.cpp:983
string GetDTDFilePrefix(void) const
Get DTD or schema file prefix.
bool x_ProcessTypeNamespace(TTypeInfo type)
Definition: objostrxml.cpp:344
void OpenTag(const string &name)
EFrameType GetFrameType(void) const
string GetSeparator(void) const
Get separator.
virtual void WriteCString(const char *str) override
Definition: objostrxml.cpp:914
virtual void WriteInt4(Int4 data) override
Definition: objostrxml.cpp:629
bool x_BeginNamespace(const string &ns_name, const string &ns_prefix)
Definition: objostrxml.cpp:371
void SetEncoding(EEncoding enc)
Set XML character encoding.
Definition: objostrxml.cpp:108
MLIOVIR void WriteNamedType(TTypeInfo namedTypeInfo, TTypeInfo typeInfo, TConstObjectPtr object)
Definition: objostr.cpp:742
bool m_WriteNamedIntegersByValue
Definition: objostr.hpp:805
virtual void WriteOtherBegin(TTypeInfo typeInfo) override
virtual void EndContainerElement(void) override
void SetEnforcedStdXml(bool set=true)
Set up scope prefixes handling.
Definition: objostrxml.cpp:166
EDataSpecRef m_SpecRef
Definition: objostrxml.hpp:429
void SetRealValueFormat(ERealValueFormat fmt)
Set formatting of values of type real The method is provided for convenience only.
Definition: objostrxml.cpp:160
virtual void BeginNamedType(TTypeInfo namedTypeInfo) override
ETagAction m_LastTagAction
Definition: objostrxml.hpp:422
void SelfCloseTagEnd(void)
virtual void WriteStringStore(const string &s) override
Definition: objostrxml.cpp:937
static CObjectOStream * OpenObjectOStreamXml(CNcbiOstream &out, EOwnership deleteOut)
Definition: objostrxml.cpp:60
virtual void SetFormattingFlags(TSerial_Format_Flags flags)
Set output formatting flags.
Definition: objostr.cpp:1193
void CheckStdXml(TTypeInfo classType)
virtual void BeginContainer(const CContainerTypeInfo *containerType) override
void OpenTagEndBack(void)
CObjectOStreamXml(CNcbiOstream &out, bool deleteOut)
Constructor.
Definition: objostrxml.cpp:74
ESerialVerifyData GetVerifyData(void) const
Get output data verification parameter.
void OpenTagStart(void)
void CloseTagStart(void)
void SetSpecialCaseWrite(ESpecialCaseWrite how)
Definition: objostr.hpp:763
virtual string GetPosition(void) const override
Get current stream position as string.
Definition: objostrxml.cpp:194
virtual void BeginChoiceVariant(const CChoiceTypeInfo *choiceType, const CMemberId &id) override
@ fIllegalCall
Illegal in a given context function call.
Definition: objostr.hpp:324
@ fInvalidData
Output data is incorrect.
Definition: objostr.hpp:322
@ fUnassigned
Mandatory object member is unassigned Normally this results in throwing CUnassignedMember exception.
Definition: objostr.hpp:333
@ eRealFixedFormat
use 'f' formatting type
Definition: objostrxml.hpp:249
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
uint64_t Uint8
8-byte (64-bit) unsigned integer
Definition: ncbitype.h:105
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
std::string CStringUTF8
Definition: ncbistl.hpp:254
void IncIndentLevel(size_t step=2)
void PutIndent(void)
void SetBackLimit(size_t limit)
void PutChar(char c)
void BackChar(char c)
size_t GetLine(void) const
void PutString(const char *str, size_t length)
void PutInt8(Int8 v)
Definition: strbuffer.cpp:1001
void PutEol(bool indent=true)
void PutUint4(Uint4 v)
Definition: strbuffer.cpp:975
void DecIndentLevel(size_t step=2)
void PutUint8(Uint8 v)
Definition: strbuffer.cpp:1045
void PutInt4(Int4 v)
Definition: strbuffer.cpp:950
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
EEncoding
Definition: ncbistr.hpp:199
static string SizetToString(size_t value, TNumToStringFlags flags=0, int base=10)
Convert size_t to string.
Definition: ncbistr.cpp:2742
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
Definition: ncbistr.hpp:5181
#define kEmptyStr
Definition: ncbistr.hpp:123
static SIZE_TYPE DoubleToStringPosix(double value, unsigned int precision, char *buf, SIZE_TYPE buf_size)
Convert double to string with specified precision and put the result into a character buffer,...
Definition: ncbistr.cpp:2653
static string EncodingToString(EEncoding encoding)
Give Encoding name as string.
Definition: ncbistr.cpp:6769
char32_t TUnicodeSymbol
Unicode character.
Definition: ncbistr.hpp:141
static char SymbolToChar(TUnicodeSymbol sym, EEncoding encoding)
Convert Unicode code point into encoded character.
Definition: ncbistr.cpp:6855
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
Definition: ncbistr.hpp:3883
static TUnicodeSymbol CharToSymbol(char ch, EEncoding encoding)
Convert encoded character into Unicode.
Definition: ncbistr.cpp:6830
static TUnicodeSymbol Decode(const char *&src)
Convert sequence of UTF8 code units into Unicode code point.
Definition: ncbistr.hpp:5656
@ eEncoding_UTF8
Definition: ncbistr.hpp:201
@ eEncoding_Unknown
Definition: ncbistr.hpp:200
@ fDoublePosix
DoubleToString*(): Use C locale for double conversions.
Definition: ncbistr.hpp:257
const string & GetName(void) const
Get name of this type.
Definition: typeinfo.cpp:249
bool HasNamespaceName(void) const
Check if data type has namespace name.
Definition: typeinfo.cpp:187
const CItemsInfo & GetItems(void) const
EDataSpec GetDataSpec(void) const
Definition: typeinfo.hpp:278
ETypeFamily GetTypeFamily(void) const
const string & GetNamespaceName(void) const
Get namespace name.
Definition: typeinfo.cpp:192
TMemberIndex GetIndex(TConstObjectPtr object) const
const CMemberInfo * GetMemberInfo(TMemberIndex index) const
const CVariantInfo * GetVariantInfo(TMemberIndex index) const
const CItemInfo * GetItemInfo(const string &name) const
bool Implicit(void) const
size_t GetCodeVersion(void) const
Definition: typeinfo.hpp:274
ENsQualifiedMode IsNsQualified(void) const
Get namespace 'qualified' property.
Definition: typeinfo.cpp:211
TConstObjectPtr GetElementPtr(const CConstIterator &it) const
bool InitIterator(CConstIterator &it, TConstObjectPtr containerPtr) const
bool NextElement(CConstIterator &it) const
TConstObjectPtr GetObjectPointer(TConstObjectPtr object) const
bool IsFullAlias(void) const
Definition: aliasinfo.hpp:79
TTypeInfo GetElementType(void) const
bool IsImplicitNonEmpty(void) const
Definition: classinfo.cpp:112
enum ENcbiOwnership EOwnership
Ownership relations between objects.
size_t serialize(const BV &bv, unsigned char *buf, bm::word_t *temp_block=0, unsigned serialization_flags=0)
Saves bitvector into memory.
Definition: bmserial.h:3071
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
Definition of all error codes used in serial libraries (xser.lib, xcser.lib).
char * buf
int i
int len
unsigned int word_t
Definition: bmconst.h:39
void aligned_free(void *ptr) BMNOEXCEPT
Aligned free.
Definition: bmalloc.h:464
void * aligned_new_malloc(size_t size)
Aligned malloc (unlike classic malloc it throws bad_alloc exception)
Definition: bmalloc.h:436
const unsigned set_block_alloc_size
Definition: bmconst.h:61
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static const BitmapCharRec *const chars[]
Definition: ncbi_10x20.c:1829
#define fabs(v)
Definition: ncbi_dispd.c:46
unsigned int a
Definition: ncbi_localip.c:102
EIPRangeType t
Definition: ncbi_localip.c:101
int isalnum(Uchar c)
Definition: ncbictype.hpp:62
T log10(T x_)
T min(T x_, T y_)
std::istream & in(std::istream &in_, double &x_)
bool BAD_CHAR(char x)
Definition: objostrxml.cpp:548
const char * sm_DefaultSchemaNamespace
Definition: objostrxml.cpp:69
static string GetPublicModuleName(TTypeInfo type)
Definition: objostrxml.cpp:199
const char * sm_DefaultNamespacePrefix
Definition: objostrxml.cpp:68
static const char * s_SchemaInstanceNamespace
Definition: objostrxml.cpp:71
static const char *const HEX
static uint8_t * buffer
Definition: pcre2test.c:1016
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define BASE64_Encode
Definition: ncbi_base64.h:41
Definition: type.c:6
#define _ASSERT
done
Definition: token1.c:1
void free(voidpf ptr)
voidp malloc(uInt size)
Modified on Fri Sep 20 14:57:57 2024 by modify_doxy.py rev. 669887