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

Go to the SVN repository for this file.

1 /* $Id: objostrxml.cpp 96766 2022-05-09 13:12:28Z 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  switch (m_Encoding) {
237  default:
238  break;
239  case eEncoding_UTF8:
240  m_Output.PutString("\" encoding=\"UTF-8");
241  break;
242  case eEncoding_ISO8859_1:
243  m_Output.PutString("\" encoding=\"ISO-8859-1");
244  break;
246  m_Output.PutString("\" encoding=\"Windows-1252");
247  break;
248  }
249  m_Output.PutString("\"?>");
250  }
251 
252  if (m_SpecRef == eSpecRefNotSet) {
253  CheckStdXml(type);
254  m_SpecRef = (type->GetDataSpec() == EDataSpec::eDTD || !x_IsStdXml()) ? eSpecRefDTD : eSpecRefSchema;
255  }
256  if (GetReferenceDTD()) {
257  if (m_UseXmlDecl) {
258  m_Output.PutEol();
259  }
260  m_Output.PutString("<!DOCTYPE ");
261  m_Output.PutString(type->GetName());
262 
263  if (m_UsePublicId) {
264  m_Output.PutString(" PUBLIC \"");
265  if (m_PublicId.empty()) {
266  m_Output.PutString("-//NCBI//");
268  m_Output.PutString("/EN");
269  } else {
271  }
272  m_Output.PutString("\"");
273  } else {
274  m_Output.PutString(" SYSTEM");
275  }
276  m_Output.PutString(" \"");
278  m_Output.PutString(".dtd\">");
279  } else if (!m_UseXmlDecl) {
280  m_SkipIndent = true;
281  }
285 }
286 
288 {
289  m_Output.PutEol(false);
291 }
292 
294 {
295  if (type->GetName().find(':') != string::npos) {
296  return;
297  }
298  if (!m_Attlist) {
299  OpenTagEndBack();
300  }
301 
302  string ns_name( m_NsPrefixToName[m_CurrNsPrefix]);
303  if (ns_name.empty()) {
304  ns_name = GetDefaultSchemaNamespace();
305  }
306  if (type->HasNamespaceName() || ((type->GetDataSpec() != EDataSpec::eXSD) &&
307  m_NsNameToPrefix.find(ns_name) == m_NsNameToPrefix.end())) {
308  if (m_Attlist) {
309  m_Output.PutString(" xmlns");
310  } else {
311  m_Output.PutEol();
312  m_Output.PutString(" xmlns");
313  }
314  if (!m_CurrNsPrefix.empty()) {
315  m_Output.PutChar(':');
317  }
318  m_Output.PutString("=\"");
319  m_Output.PutString(ns_name + "\"");
320  m_NsPrefixToName[m_CurrNsPrefix] = ns_name;
321  m_NsNameToPrefix[ns_name] = m_CurrNsPrefix;
322  }
323 
324  if (m_UseSchemaLoc) {
325  string xs_name(s_SchemaInstanceNamespace);
326  string xs_prefix("xs");
327  if (m_NsNameToPrefix.find(xs_name) == m_NsNameToPrefix.end()) {
328  for (char a='a';
329  m_NsPrefixToName.find(xs_prefix) != m_NsPrefixToName.end(); ++a) {
330  xs_prefix += a;
331  }
332  m_NsPrefixToName[xs_prefix] = xs_name;
333  m_NsNameToPrefix[xs_name] = xs_prefix;
334  m_Output.PutEol();
335  m_Output.PutString(" xmlns:");
336  m_Output.PutString(xs_prefix + "=\"");
337  m_Output.PutString(xs_name + "\"");
338  m_Output.PutEol();
339  m_Output.PutString(" ");
340  m_Output.PutString(xs_prefix);
341  m_Output.PutString(":schemaLocation=\"");
342  m_Output.PutString(ns_name + " ");
344  m_Output.PutString(".xsd\"");
345  m_Output.PutEol();
346  }
347  }
348  if (!m_Attlist) {
349  OpenTagEnd();
350  }
351 }
352 
354 {
355  if (GetReferenceSchema()) {
356  if (type->HasNamespaceName()) {
357  string prefix(type->GetNamespacePrefix());
358  if (prefix.empty() && (type->IsNsQualified() == eNSUnqualified || (m_Attlist && type->IsNsQualified() == eNSQualified))) {
360  }
361  return x_BeginNamespace(type->GetNamespaceName(),prefix);
362  }
363  return true;
364  }
365  return false;
366 }
367 
369 {
370  if (GetReferenceSchema()) {
371  if (TopFrame().HasTypeInfo()) {
373  if (type->HasNamespaceName()) {
374  x_EndNamespace(type->GetNamespaceName());
375  }
376  }
377  }
378 }
379 
380 bool CObjectOStreamXml::x_BeginNamespace(const string& ns_name,
381  const string& ns_prefix)
382 {
383  if (!GetReferenceSchema() || ns_name.empty()) {
384  return false;
385  }
386  string nsPrefix(ns_prefix);
387  if (m_Attlist || m_NsNameToPrefix.find(ns_name) == m_NsNameToPrefix.end()) {
388  for (char a='a';
389  m_NsPrefixToName.find(nsPrefix) != m_NsPrefixToName.end(); ++a) {
390  nsPrefix += a;
391  }
392  if (m_Attlist && m_NsNameToPrefix.find(ns_name) != m_NsNameToPrefix.end()) {
393  if (!m_NsNameToPrefix.at(ns_name).empty()) {
394  m_CurrNsPrefix = m_NsNameToPrefix.at(ns_name);
395  m_NsPrefixes.push_back(m_CurrNsPrefix);
396  return false;
397  }
398  }
399  m_CurrNsPrefix = nsPrefix;
400  if (!m_Attlist) {
401  m_NsNameToPrefix[ns_name] = nsPrefix;
402  }
403  m_NsPrefixToName[nsPrefix] = ns_name;
404  m_NsPrefixes.push_back(nsPrefix);
405  return true;
406  } else {
407  m_CurrNsPrefix = m_NsNameToPrefix[ns_name];
408  m_NsPrefixes.push_back(m_CurrNsPrefix);
409  }
410  return false;
411 }
412 
413 void CObjectOStreamXml::x_EndNamespace(const string& ns_name)
414 {
415  if (!GetReferenceSchema() || ns_name.empty()) {
416  return;
417  }
418  string nsPrefix = m_CurrNsPrefix;
419 // we should erase them according to Namespace Scoping rules
420 // http://www.w3.org/TR/REC-xml-names/#scoping
421  m_NsPrefixes.pop_back();
422  if (find(m_NsPrefixes.begin(), m_NsPrefixes.end(), nsPrefix)
423  == m_NsPrefixes.end()) {
424  if (!m_Attlist) {
425  m_NsNameToPrefix.erase(ns_name);
426  }
427  m_NsPrefixToName.erase(nsPrefix);
428  }
429  m_CurrNsPrefix = m_NsPrefixes.empty() ? kEmptyStr : m_NsPrefixes.back();
430  if (!m_Attlist && GetStackDepth() <= 2) {
433  }
434 }
435 
438  const string& valueName)
439 {
440  bool skipname = valueName.empty() ||
442  bool valueonly = m_StdXml;
443  if (valueonly) {
444  if ( values.IsInteger() ) {
446  } else {
447  m_Output.PutString(valueName);
448  }
449  return;
450  }
451  if ( !m_SkipNextTag && !values.GetName().empty() ) {
452  OpenTagStart();
453  m_Output.PutString(values.GetName());
454  if ( !skipname ) {
455  m_Output.PutString(" value=\"");
456  m_Output.PutString(valueName);
457  m_Output.PutChar('\"');
458  }
459  if ( values.IsInteger() ) {
460  OpenTagEnd();
462  CloseTagStart();
463  m_Output.PutString(values.GetName());
464  CloseTagEnd();
465  }
466  else {
467  _ASSERT(!valueName.empty());
468  SelfCloseTagEnd();
470  }
471  }
472  else {
473  // local enum (member, variant or element)
474  if ( skipname ) {
475  _ASSERT(values.IsInteger());
477  }
478  else {
479  if (m_LastTagAction == eAttlistTag) {
480  m_Output.PutString(valueName);
481  } else {
482  OpenTagEndBack();
483  m_Output.PutString(" value=\"");
484  m_Output.PutString(valueName);
485  m_Output.PutChar('"');
486  if ( values.IsInteger() ) {
487  OpenTagEnd();
489  }
490  else {
491  SelfCloseTagEnd();
492  }
493  }
494  }
495  }
496 }
497 
500 {
501  WriteEnum(values, value, values.FindNameEx(value, values.IsInteger()));
502 }
503 
506 {
507  TEnumValueType value = in.ReadEnum(values);
508  WriteEnum(values, value, values.FindNameEx(value, values.IsInteger()));
509 }
510 
512 {
513 // http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char
514  switch ( c ) {
515  case '&':
516  m_Output.PutString("&amp;");
517  break;
518  case '<':
519  m_Output.PutString("&lt;");
520  break;
521  case '>':
522  m_Output.PutString("&gt;");
523  break;
524  case '\'':
525  m_Output.PutString("&apos;");
526  break;
527  case '"':
528  m_Output.PutString("&quot;");
529  break;
530  default:
531  if ((unsigned int)c < 0x20) {
532  m_Output.PutString("&#x");
533  Uint1 ch = c;
534  unsigned hi = ch >> 4;
535  unsigned lo = ch & 0xF;
536  if ( hi ) {
537  m_Output.PutChar("0123456789abcdef"[hi]);
538  }
539  m_Output.PutChar("0123456789abcdef"[lo]);
540  m_Output.PutChar(';');
541  } else {
542  m_Output.PutChar(c);
543  }
544  break;
545  }
546 }
547 
548 /*
549 In XML 1.1, almost all chars are allowed:
550 http://www.w3.org/TR/xml11/#NT-Char
551 BUT, we declare this as xml 1.0:
552  CObjectOStreamXml::WriteFileHeader
553 Once so, some chars are not allowed
554 http://www.w3.org/TR/xml/#charsets
555 
556 */
557 inline bool BAD_CHAR(char x) {
558  return (x < 0x20 && x > 0x0 && x != 0x9 && x != 0xA && x != 0xD);
559 }
560 inline char CObjectOStreamXml::x_VerifyChar(char x) {
561  return BAD_CHAR(x) ?
563 }
564 
566 {
569 
570  if (enc_in == enc_out || enc_in == eEncoding_Unknown || (*src & 0x80) == 0) {
571  char s = x_VerifyChar(*src);
572  if (s != '\0') {
573  WriteEscapedChar(s);
574  }
575  } else if (enc_out != eEncoding_UTF8) {
576  TUnicodeSymbol chU = (enc_in == eEncoding_UTF8) ?
577  CUtf8::Decode(src) : CUtf8::CharToSymbol( *src, enc_in);
578  char s = x_VerifyChar( CUtf8::SymbolToChar( chU, enc_out));
579  if (s != '\0') {
580  WriteEscapedChar(s);
581  }
582  } else {
583  CStringUTF8 tmp( CUtf8::AsUTF8( CTempString(src,1),enc_in));
584  for ( string::const_iterator t = tmp.begin(); t != tmp.end(); ++t ) {
585  char s = x_VerifyChar(*t);
586  if (s != '\0') {
587  WriteEscapedChar(s);
588  }
589  }
590  }
591 }
592 
594 {
596  OpenTagEndBack();
597  SelfCloseTagEnd();
598  return true;
599  }
600  else if (m_SpecialCaseWrite == eWriteAsNil) {
601  OpenTagEndBack();
602  m_Output.PutChar(' ');
603  if (GetReferenceSchema()) {
604  m_Output.PutString("xs:");
605  }
606  m_Output.PutString("nil=\"true\"");
607  SelfCloseTagEnd();
608  return true;
609  }
610  return false;
611 }
612 
614 {
616  return;
617  }
618  if ( !x_IsStdXml() ) {
619  OpenTagEndBack();
620  if ( data )
621  m_Output.PutString(" value=\"true\"");
622  else
623  m_Output.PutString(" value=\"false\"");
624  SelfCloseTagEnd();
625  } else {
626  if ( data )
627  m_Output.PutString("true");
628  else
629  m_Output.PutString("false");
630  }
631 }
632 
634 {
635  WriteEscapedChar(data);
636 }
637 
639 {
641  return;
642  }
643  m_Output.PutInt4(data);
644 }
645 
647 {
649  return;
650  }
651  m_Output.PutUint4(data);
652 }
653 
655 {
657  return;
658  }
659  m_Output.PutInt8(data);
660 }
661 
663 {
665  return;
666  }
667  m_Output.PutUint8(data);
668 }
669 
670 void CObjectOStreamXml::WriteDouble2(double data, unsigned digits)
671 {
673  return;
674  }
675  if (isnan(data)) {
676  m_Output.PutString("NaN", 3);
677  return;
678  }
679  if (!finite(data)) {
680  if (data < 0) {
681  m_Output.PutChar('-');
682  }
683  m_Output.PutString("INF", 3);
684  return;
685  }
686  char buffer[512];
687  SIZE_TYPE width;
688  if (m_RealFmt == eRealFixedFormat) {
689  int shift = int(ceil(log10(fabs(data))));
690  int precision = int(digits - shift);
691  if ( precision < 0 )
692  precision = 0;
693  if ( precision > 64 ) // limit precision of data
694  precision = 64;
695  width = NStr::DoubleToString(data, (unsigned int)precision,
696  buffer, sizeof(buffer), NStr::fDoublePosix);
697  if (precision != 0) {
698  while (buffer[width-1] == '0') {
699  --width;
700  }
701  if (buffer[width-1] == '.') {
702  --width;
703  }
704  }
705  } else {
706  if (m_FastWriteDouble) {
707  width = NStr::DoubleToStringPosix(data, digits, buffer, sizeof(buffer));
708  } else {
709  width = sprintf(buffer, "%.*g", (int)digits, data);
710  char* dot = strchr(buffer,',');
711  if (dot) {
712  *dot = '.'; // enforce C locale
713  }
714  }
715  }
716  m_Output.PutString(buffer, width);
717 }
718 
720 {
721  WriteDouble2(data, DBL_DIG);
722 }
723 
725 {
726  WriteDouble2(data, FLT_DIG);
727 }
728 
730 {
731  OpenTagEndBack();
732  SelfCloseTagEnd();
733 }
734 
736 {
737  string ns_name(obj.GetNamespaceName());
738  bool needNs = x_BeginNamespace(ns_name,obj.GetNamespacePrefix());
739  string obj_name = obj.GetName();
740  if (obj_name.empty()) {
741  if (!StackIsEmpty() && TopFrame().HasMemberId()) {
742  obj_name = TopFrame().GetMemberId().GetName();
743  }
744  }
745  if (obj_name.empty()) {
746  ThrowError(fInvalidData, "AnyContent object must have name");
747  }
748  OpenTag(obj_name);
749 
750  if (GetReferenceSchema()) {
751  OpenTagEndBack();
752  if (needNs) {
753  m_Output.PutEol();
754  m_Output.PutString(" xmlns");
755  if (!m_CurrNsPrefix.empty()) {
756  m_Output.PutChar(':');
758  }
759  m_Output.PutString("=\"");
760  m_Output.PutString(ns_name);
761  m_Output.PutChar('\"');
762  }
763 
764  const vector<CSerialAttribInfoItem>& attlist = obj.GetAttributes();
765  if (!attlist.empty()) {
766  m_Attlist = true;
767  vector<CSerialAttribInfoItem>::const_iterator it;
768  for ( it = attlist.begin(); it != attlist.end(); ++it) {
769  string ns(it->GetNamespaceName());
770  string ns_prefix;
771  if (x_BeginNamespace(ns,kEmptyStr)) {
772  m_Output.PutEol();
773  m_Output.PutString(" xmlns");
774  ns_prefix = m_NsNameToPrefix[ns];
775  if (!ns_prefix.empty()) {
776  m_Output.PutChar(':');
777  m_Output.PutString(ns_prefix);
778  }
779  m_Output.PutString("=\"");
780  m_Output.PutString(ns);
781  m_Output.PutChar('\"');
782  }
783  ns_prefix = m_NsNameToPrefix[ns];
784 
785  m_Output.PutEol();
786  m_Output.PutString(" ");
787  if (!ns_prefix.empty()) {
788  m_Output.PutString(ns_prefix);
789  m_Output.PutChar(':');
790  }
791  m_Output.PutString(it->GetName());
792  m_Output.PutString("=\"");
793  WriteString(it->GetValue(),eStringTypeUTF8);
794  m_Output.PutChar('\"');
795  x_EndNamespace(ns);
796  }
797  m_Attlist = false;
798  }
799  OpenTagEnd();
800  }
801 
802 // value
803 // no verification on write!
804  const string& value = obj.GetValue();
805  if (value.empty()) {
806  OpenTagEndBack();
807  SelfCloseTagEnd();
809  x_EndNamespace(ns_name);
810  return;
811  }
812  bool was_open = true, was_close=true;
813  bool is_tag = false;
814  char attr_close ='\0';
815  for (const char* is = value.c_str(); *is; ++is) {
816  if (*is == '/' && *(is+1) == '>') {
818  was_open = false;
819  }
820  if (*is == '<') {
821  if (*(is+1) == '/') {
823  if (!was_open && was_close) {
824  m_Output.PutEol();
825  }
826  is_tag = was_open = false;
827  } else {
828  if (was_close) {
829  m_Output.PutEol();
830  }
832  is_tag = was_open = true;
833  }
834  }
835  if (*is != '>' && *is != '<' && *is != attr_close) {
837  } else {
838  m_Output.PutChar(*is);
839  }
840  if (*is == '<') {
841  if (*(is+1) == '/') {
842  m_Output.PutChar(*(++is));
843  }
844  if (GetReferenceSchema() && !m_CurrNsPrefix.empty()) {
846  m_Output.PutChar(':');
847  }
848  }
849  if (*is == '>') {
850  was_close = true;
851  is_tag = false;
852  attr_close = '\0';
853  } else {
854  was_close = false;
855  }
856  if (is_tag && *is == '=' && (*(is+1) == '\"' || *(is+1) == '\'')) {
857  attr_close = *(is+1);
858  }
859  }
860 
861 // close tag
862  if (!was_open) {
863  m_EndTag = true;
864  }
865  m_SkipIndent = !was_close;
866  CloseTag(obj_name);
867  x_EndNamespace(ns_name);
868 }
869 
871 {
872  CAnyContentObject obj;
873  in.ReadAnyContentObject(obj);
875 }
876 
878 {
879 #if BITSTRING_AS_VECTOR
880  static const char ToHex[] = "0123456789ABCDEF";
881  Uint1 data, mask;
882  bool done = false;
883  for ( CBitString::const_iterator i = obj.begin(); !done; ) {
884  for (data=0, mask=0x8; !done && mask!=0; mask >>= 1) {
885  if (*i) {
886  data |= mask;
887  }
888  done = (++i == obj.end());
889  }
890  m_Output.PutChar(ToHex[data]);
891  }
892 #else
893  if (IsCompressed()) {
895  CBitString::statistics st;
896  obj.calc_stat(&st);
897  char* buf = (char*)malloc(st.max_serialize_mem);
898  size_t len = bm::serialize(obj, (unsigned char*)buf, tmp_block);
899  WriteBytes(buf,len);
900  free(buf);
901  bm::aligned_free(tmp_block);
902  return;
903  }
905  CBitString::size_type ilast = obj.size();
906  CBitString::enumerator e = obj.first();
907  for (; i < ilast; ++i) {
908  m_Output.PutChar( (i == *e) ? '1' : '0');
909  if (i == *e) {
910  ++e;
911  }
912  }
913 #endif
914 }
915 
917 {
918  CBitString obj;
919  in.ReadBitString(obj);
920  WriteBitString(obj);
921 }
922 
924 {
925  if ( str == 0 ) {
926  OpenTagEndBack();
927  SelfCloseTagEnd();
928  }
929  else {
930  for ( ; *str; ++str) {
932  }
933  }
934 }
935 
937 {
939  return;
940  }
941  for ( const char* src = str.c_str(); *src; ++src ) {
942  WriteEncodedChar(src,type);
943  }
944 }
945 
947 {
948  for ( string::const_iterator i = str.begin(); i != str.end(); ++i ) {
950  }
951 }
952 
955 {
956  string str;
957  in.ReadString(str, type);
959  in.SetSpecialCaseUsed(CObjectIStream::eReadAsNormal);
960  WriteString(str, type);
962 }
963 
965 {
966  string str;
967  in.ReadStringStore(str);
968  for ( string::const_iterator i = str.begin(); i != str.end(); ++i ) {
970  }
971 }
972 
974 {
975  bool notag = TopFrame().HasMemberId() && TopFrame().GetMemberId().HasNotag();
976  bool nillable = TopFrame().HasMemberId() && TopFrame().GetMemberId().IsNillable();
977  if (TopFrame().GetNotag() && !notag) {
978  if (m_LastTagAction == eTagClose) {
979  OpenStackTag(0);
983  CloseStackTag(0);
984  }
985  return;
986  }
990 }
991 
993 {
994  m_Output.PutString("<object index=");
995  if ( sizeof(TObjectIndex) == sizeof(Int4) )
996  m_Output.PutInt4(Int4(index));
997  else if ( sizeof(TObjectIndex) == sizeof(Int8) )
998  m_Output.PutInt8(index);
999  else
1000  ThrowError(fIllegalCall, "invalid size of TObjectIndex"
1001  "must be either sizeof(Int4) or sizeof(Int8)");
1002  m_Output.PutString("/>");
1003  m_EndTag = true;
1004 }
1005 
1006 void CObjectOStreamXml::WriteTag(const string& name)
1007 {
1008  if (!m_CurrNsPrefix.empty() && IsNsQualified()) {
1010  m_Output.PutChar(':');
1011  }
1012  m_Output.PutString(name);
1013 }
1014 
1016 {
1017  if (m_Attlist) {
1018  if ( m_LastTagAction == eTagOpen ) {
1019  m_Output.PutChar(' ');
1021  }
1022  } else {
1023  if (m_SkipIndent) {
1024  m_SkipIndent = false;
1025  } else {
1026  m_Output.PutEol(false);
1027  m_Output.PutIndent();
1028  }
1029  m_Output.PutChar('<');
1031  }
1032  m_EndTag = false;
1033 }
1034 
1036 {
1037  if (m_Attlist) {
1038  if ( m_LastTagAction == eAttlistTag ) {
1039  m_Output.PutString("=\"");
1040  }
1041  } else {
1042  if ( m_LastTagAction == eTagOpen ) {
1043  m_Output.PutChar('>');
1046  }
1047  }
1048 }
1049 
1051 {
1054  m_Output.BackChar('>');
1056 }
1057 
1059 {
1061  m_Output.PutString("/>");
1063  m_EndTag = true;
1064  m_SkipIndent = false;
1065 }
1066 
1068 {
1070  if ( m_LastTagAction == eTagOpen ) {
1072  }
1073 }
1074 
1076 {
1079  if (m_EndTag && !m_SkipIndent) {
1080  m_Output.PutEol(false);
1081  m_Output.PutIndent();
1082  }
1083  m_Output.PutString("</");
1085 }
1086 
1088 {
1089  m_Output.PutChar('>');
1091  m_EndTag = true;
1092  m_SkipIndent = false;
1093 }
1094 
1096 {
1097  const TFrame& frame = FetchFrameFromTop(level);
1098  switch ( frame.GetFrameType() ) {
1099  case TFrame::eFrameNamed:
1100  case TFrame::eFrameArray:
1101  case TFrame::eFrameClass:
1102  case TFrame::eFrameChoice:
1103  {
1104  _ASSERT(frame.GetTypeInfo());
1105  const string& name = frame.GetTypeInfo()->GetName();
1106  if ( !name.empty() ) {
1107  WriteTag(name);
1108 #if defined(NCBI_SERIAL_IO_TRACE)
1109  TraceTag(name);
1110 #endif
1111  } else {
1112  PrintTagName(level + 1);
1113  }
1114  return;
1115  }
1118  {
1119  bool attlist = m_Attlist;
1120  if (!x_IsStdXml()) {
1121  PrintTagName(level + 1);
1122  m_Output.PutChar('_');
1123  m_Attlist = true;
1124  }
1125  WriteTag(frame.GetMemberId().GetName());
1126  m_Attlist = attlist;
1127 #if defined(NCBI_SERIAL_IO_TRACE)
1128  TraceTag(frame.GetMemberId().GetName());
1129 #endif
1130  return;
1131  }
1133  {
1134  PrintTagName(level + 1);
1135  if (!x_IsStdXml()) {
1136  m_Output.PutString("_E");
1137  }
1138  return;
1139  }
1140  default:
1141  break;
1142  }
1143  ThrowError(fIllegalCall, "illegal frame type");
1144 }
1145 
1147 {
1148  OpenTag(typeInfo);
1149 }
1150 
1152 {
1153  CloseTag(typeInfo);
1154 }
1155 
1157  TTypeInfo typeInfo)
1158 {
1159  OpenTag(typeInfo);
1160  WriteObject(object, typeInfo);
1161  CloseTag(typeInfo);
1162 }
1163 
1165 {
1166  bool needNs = x_ProcessTypeNamespace(containerType);
1167  if (!m_StdXml) {
1168  if (TopFrame().GetFrameType() == CObjectStackFrame::eFrameArray &&
1169  FetchFrameFromTop(1).GetFrameType() == CObjectStackFrame::eFrameNamed) {
1170  const CClassTypeInfo* clType =
1171  dynamic_cast<const CClassTypeInfo*>(FetchFrameFromTop(1).GetTypeInfo());
1172  if (clType && clType->Implicit()) {
1173  TopFrame().SetNotag();
1174  return;
1175  }
1176  }
1177  OpenTagIfNamed(containerType);
1178  }
1179  if (needNs) {
1180  x_WriteClassNamespace(containerType);
1181  }
1182 }
1183 
1185 {
1186  if (!m_StdXml && !TopFrame().GetNotag()) {
1187  CloseTagIfNamed(TopFrame().GetTypeInfo());
1188  }
1190 }
1191 
1193 {
1194  while ( elementType->GetName().empty() ) {
1195  if ( elementType->GetTypeFamily() != eTypeFamilyPointer )
1196  return false;
1197  elementType = CTypeConverter<CPointerTypeInfo>::SafeCast(elementType)->GetPointedType();
1198  }
1199  // found named type
1200  return true;
1201 }
1202 
1204 {
1205  if ( !WillHaveName(elementType) ) {
1206  BeginArrayElement(elementType);
1207  }
1208 }
1209 
1211 {
1212  if ( !WillHaveName(TopFrame().GetTypeInfo()) ) {
1213  EndArrayElement();
1214  }
1215 }
1216 
1217 #ifdef VIRTUAL_MID_LEVEL_IO
1219  TConstObjectPtr containerPtr)
1220 {
1221  if ( !cType->GetName().empty() ) {
1222  BEGIN_OBJECT_FRAME2(eFrameArray, cType);
1223  OpenTag(cType);
1224 
1225  WriteContainerContents(cType, containerPtr);
1226 
1227  EolIfEmptyTag();
1228  CloseTag(cType);
1229  END_OBJECT_FRAME();
1230  }
1231  else {
1232  WriteContainerContents(cType, containerPtr);
1233  }
1234 }
1235 #endif
1237 {
1238  if (x_IsStdXml()) {
1239  CObjectTypeInfo type(GetRealTypeInfo(elementType));
1240  if (type.GetTypeFamily() != eTypeFamilyPrimitive ||
1241  type.GetPrimitiveValueType() == ePrimitiveValueAny) {
1242  TopFrame().SetNotag();
1243  return;
1244  }
1245  if (m_SkipNextTag && type.GetTypeFamily() == eTypeFamilyPrimitive) {
1246  m_Output.PutChar(' ');
1247  TopFrame().SetNotag();
1248  return;
1249  }
1250  }
1251  OpenStackTag(0);
1252 }
1253 
1255 {
1256  if (TopFrame().GetNotag()) {
1257  TopFrame().SetNotag(false);
1258  } else {
1259  CloseStackTag(0);
1260  }
1261 }
1262 
1264  TConstObjectPtr containerPtr)
1265 {
1266  TTypeInfo elementType = cType->GetElementType();
1268  if ( WillHaveName(elementType) ) {
1269  if ( cType->InitIterator(i, containerPtr) ) {
1270 
1271  const CPointerTypeInfo* pointerType =
1272  dynamic_cast<const CPointerTypeInfo*>(elementType);
1273  do {
1274  TConstObjectPtr elementPtr = cType->GetElementPtr(i);
1275  if ( pointerType &&
1276  !pointerType->GetObjectPointer(elementPtr) ) {
1277  if ( GetVerifyData() == eSerialVerifyData_Yes ) {
1279  "NULL element while writing container "+
1280  cType->GetName());
1281  }
1282  continue;
1283  }
1284 
1285  WriteObject(elementPtr, elementType);
1286 
1287  } while ( cType->NextElement(i) );
1288  }
1289  }
1290  else {
1291  BEGIN_OBJECT_FRAME2(eFrameArrayElement, elementType);
1292 
1293  if ( cType->InitIterator(i, containerPtr) ) {
1294 
1295  const CPointerTypeInfo* pointerType =
1296  dynamic_cast<const CPointerTypeInfo*>(elementType);
1297  do {
1298  TConstObjectPtr elementPtr = cType->GetElementPtr(i);
1299  if ( pointerType &&
1300  !pointerType->GetObjectPointer(elementPtr) ) {
1301  if ( GetVerifyData() == eSerialVerifyData_Yes ) {
1303  "NULL element while writing container "+
1304  cType->GetName());
1305  }
1306  continue;
1307  }
1308 
1309  BeginArrayElement(elementType);
1310  WriteObject(elementPtr, elementType);
1311  EndArrayElement();
1312  } while ( cType->NextElement(i) );
1313  } else {
1314  const TFrame& frame = FetchFrameFromTop(1);
1316  const CClassTypeInfo* clType =
1317  dynamic_cast<const CClassTypeInfo*>(frame.GetTypeInfo());
1318  if (clType && clType->Implicit() && clType->IsImplicitNonEmpty()) {
1319  ThrowError(fInvalidData, "container is empty");
1320  }
1321  }
1322  }
1323 
1324  END_OBJECT_FRAME();
1325  }
1326 }
1327 
1329 {
1330  CheckStdXml(namedTypeInfo);
1331  if (m_SkipNextTag || namedTypeInfo->GetName().empty()) {
1332  TopFrame().SetNotag();
1333  m_SkipNextTag = false;
1334  } else {
1335  TTypeInfo realtype = GetRealTypeInfo(namedTypeInfo);
1336  if (realtype->GetTypeFamily() == eTypeFamilyPrimitive &&
1337  GetStackDepth() > 2 && m_StdXml) {
1338  TopFrame().SetNotag();
1339  m_SkipNextTag = false;
1340  return;
1341  }
1342  bool needNs = x_ProcessTypeNamespace(namedTypeInfo);
1343  OpenTag(namedTypeInfo);
1344  if (needNs) {
1345  x_WriteClassNamespace(namedTypeInfo);
1346  }
1347  }
1348  const CAliasTypeInfo* aliasType =
1349  dynamic_cast<const CAliasTypeInfo*>(namedTypeInfo);
1350  if (aliasType) {
1351  m_SkipNextTag = aliasType->IsFullAlias();
1352  }
1353  else if (m_StdXml) {
1354  const CClassTypeInfo* classType = dynamic_cast<const CClassTypeInfo*>(namedTypeInfo);
1355  m_SkipNextTag = (classType && classType->Implicit());
1356  }
1357 }
1358 
1360 {
1361  m_SkipNextTag = false;
1362  if (TopFrame().GetNotag()) {
1363  TopFrame().SetNotag(false);
1364  return;
1365  }
1366  CloseTag(TopFrame().GetTypeInfo());
1368 }
1369 
1370 #ifdef VIRTUAL_MID_LEVEL_IO
1371 
1372 void CObjectOStreamXml::WriteNamedType(TTypeInfo namedTypeInfo,
1373  TTypeInfo typeInfo,
1374  TConstObjectPtr object)
1375 {
1376  BEGIN_OBJECT_FRAME2(eFrameNamed, namedTypeInfo);
1377 
1378  BeginNamedType(namedTypeInfo);
1379  WriteObject(object, typeInfo);
1380  EndNamedType();
1381 
1382  END_OBJECT_FRAME();
1383 }
1384 
1385 void CObjectOStreamXml::CopyNamedType(TTypeInfo namedTypeInfo,
1386  TTypeInfo objectType,
1387  CObjectStreamCopier& copier)
1388 {
1389  BEGIN_OBJECT_2FRAMES_OF2(copier, eFrameNamed, namedTypeInfo);
1390  copier.In().BeginNamedType(namedTypeInfo);
1391  BeginNamedType(namedTypeInfo);
1392  CopyObject(objectType, copier);
1393  EndNamedType();
1394  copier.In().EndNamedType();
1395  END_OBJECT_2FRAMES_OF(copier);
1396 }
1397 #endif
1398 
1400 {
1401  if (typeinfo->GetCodeVersion() > 21600) {
1402  m_StdXml = typeinfo->GetDataSpec() != EDataSpec::eASN;
1403  } else {
1404  const CClassTypeInfo* classType =
1405  dynamic_cast<const CClassTypeInfo*>(typeinfo);
1406  if (classType) {
1407  TMemberIndex first = classType->GetItems().FirstIndex();
1408  m_StdXml = classType->GetItems().GetItemInfo(first)->GetId().HaveNoPrefix();
1409  }
1410  }
1411 }
1412 
1414 {
1415  CheckStdXml(classInfo);
1416  if (m_SkipNextTag) {
1417  TopFrame().SetNotag();
1418  m_SkipNextTag = false;
1419  return;
1420  }
1421  bool needNs = x_ProcessTypeNamespace(classInfo);
1422  OpenTagIfNamed(classInfo);
1423  if (needNs) {
1424  x_WriteClassNamespace(classInfo);
1425  }
1426 }
1427 
1429 {
1430  if (TopFrame().GetNotag()) {
1431  TopFrame().SetNotag(false);
1432  return;
1433  }
1435  EolIfEmptyTag();
1436  }
1439  } else {
1440  CloseTagIfNamed(TopFrame().GetTypeInfo());
1441  }
1443 }
1444 
1446 {
1447  const CClassTypeInfoBase* classType = dynamic_cast<const CClassTypeInfoBase*>
1449  _ASSERT(classType);
1450  BeginClassMember(classType->GetItemInfo(id.GetName())->GetTypeInfo(),id);
1451 }
1452 
1454  const CMemberId& id)
1455 {
1456  if (x_IsStdXml()) {
1457  if(id.IsAttlist()) {
1458  if(m_LastTagAction == eTagClose) {
1459  OpenTagEndBack();
1460  }
1461  m_Attlist = true;
1462  TopFrame().SetNotag();
1463  } else {
1464  ETypeFamily type = GetRealTypeFamily(memberType);
1465  bool needTag = true;
1466  if (GetEnforcedStdXml()) {
1467  if (type == eTypeFamilyContainer) {
1468  TTypeInfo mem_type = GetRealTypeInfo(memberType);
1469  TTypeInfo elem_type = GetContainerElementTypeInfo(mem_type);
1470  needTag = (elem_type->GetTypeFamily() != eTypeFamilyPrimitive ||
1471  elem_type->GetName() != mem_type->GetName());
1472  }
1473  } else {
1474  needTag = !id.HasNotag() && !id.HasAnyContent() && type != eTypeFamilyContainer;
1476  if (needTag && m_SkipNextTag) {
1477  if (memberType->HasNamespaceName() && m_NsNameToPrefix.find(memberType->GetNamespaceName()) == m_NsNameToPrefix.end()) {
1478  needTag = m_SkipNextTag = false;
1479  }
1480  }
1481  }
1482  if (needTag) {
1483  OpenStackTag(0);
1484  } else {
1485  TopFrame().SetNotag();
1486  }
1487  if (type == eTypeFamilyPrimitive) {
1488  m_SkipIndent = id.HasNotag();
1489  }
1490  }
1491  } else {
1492  OpenStackTag(0);
1493  }
1494 }
1495 
1497 {
1498  m_SkipNextTag = false;
1499  if (TopFrame().GetNotag()) {
1500  TopFrame().SetNotag(false);
1501  m_Attlist = false;
1502  if(m_LastTagAction == eTagOpen) {
1503  OpenTagEnd();
1504  }
1505  } else {
1506  CloseStackTag(0);
1507  }
1508 }
1509 
1510 
1511 #ifdef VIRTUAL_MID_LEVEL_IO
1512 
1513 void CObjectOStreamXml::WriteClass(const CClassTypeInfo* classType,
1514  TConstObjectPtr classPtr)
1515 {
1516  if ( (m_Attlist && classType->IsNsQualified() == eNSQualified) || !classType->GetName().empty() ) {
1517  BEGIN_OBJECT_FRAME2(eFrameClass, classType);
1518 
1519  BeginClass(classType);
1520  for ( CClassTypeInfo::CIterator i(classType); i.Valid(); ++i ) {
1521  classType->GetMemberInfo(i)->WriteMember(*this, classPtr);
1522  }
1523  EndClass();
1524 
1525  END_OBJECT_FRAME();
1526  }
1527  else {
1528  for ( CClassTypeInfo::CIterator i(classType); i.Valid(); ++i ) {
1529  classType->GetMemberInfo(i)->WriteMember(*this, classPtr);
1530  }
1531  }
1532 }
1533 
1534 void CObjectOStreamXml::WriteClassMember(const CMemberId& memberId,
1535  TTypeInfo memberType,
1536  TConstObjectPtr memberPtr)
1537 {
1538  BEGIN_OBJECT_FRAME2(eFrameClassMember,memberId);
1539 
1540  BeginClassMember(memberType,memberId);
1541  WriteObject(memberPtr, memberType);
1542  EndClassMember();
1543 
1544  END_OBJECT_FRAME();
1545 }
1546 
1547 bool CObjectOStreamXml::WriteClassMember(const CMemberId& memberId,
1548  const CDelayBuffer& buffer)
1549 {
1550  if ( !buffer.HaveFormat(eSerial_Xml) )
1551  return false;
1552 
1553  BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId);
1554  OpenStackTag(0);
1555 
1556  Write(buffer.GetSource());
1557 
1558  CloseStackTag(0);
1559  END_OBJECT_FRAME();
1560 
1561  return true;
1562 }
1563 
1565  TTypeInfo /*memberType*/, TConstObjectPtr /*memberPtr*/, ESpecialCaseWrite how)
1566 {
1567  if (m_Attlist) {
1568  return;
1569  }
1570  m_SpecialCaseWrite = how;
1571  if (memberId.HasNotag() || m_SkipNextTag) {
1573  } else {
1574  BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId);
1575  OpenStackTag(0);
1578  CloseStackTag(0);
1579  END_OBJECT_FRAME();
1580  }
1582 }
1583 #endif
1584 
1586 {
1587  CheckStdXml(choiceType);
1588  if (m_SkipNextTag) {
1589  TopFrame().SetNotag();
1590  m_SkipNextTag = false;
1591  return;
1592  }
1593  bool needNs = x_ProcessTypeNamespace(choiceType);
1594  OpenTagIfNamed(choiceType);
1595  if (needNs) {
1596  x_WriteClassNamespace(choiceType);
1597  }
1598 }
1599 
1601 {
1602  if (TopFrame().GetNotag()) {
1603  TopFrame().SetNotag(false);
1604  return;
1605  }
1606  CloseTagIfNamed(TopFrame().GetTypeInfo());
1608 }
1609 
1611  const CMemberId& id)
1612 {
1613  if (x_IsStdXml()) {
1614  const CVariantInfo* var_info = choiceType->GetVariantInfo(id.GetName());
1616  bool needTag = true;
1617  if (GetEnforcedStdXml()) {
1618  if (type == eTypeFamilyContainer) {
1619  TTypeInfo var_type = GetRealTypeInfo(var_info->GetTypeInfo());
1620  TTypeInfo elem_type = GetContainerElementTypeInfo(var_type);
1621  needTag = (elem_type->GetTypeFamily() != eTypeFamilyPrimitive ||
1622  elem_type->GetName() != var_type->GetName());
1623  }
1624  } else {
1625  needTag = !id.HasNotag() && !id.HasAnyContent() && type != eTypeFamilyContainer;
1627  if (needTag && m_SkipNextTag) {
1628  TTypeInfo var_type = choiceType->GetItemInfo(id.GetName())->GetTypeInfo();
1629  if (var_type->HasNamespaceName() && m_NsNameToPrefix.find(var_type->GetNamespaceName()) == m_NsNameToPrefix.end()) {
1630  needTag = m_SkipNextTag = false;
1631  }
1632  }
1633  }
1634  if (needTag) {
1635  OpenStackTag(0);
1636  } else {
1637  TopFrame().SetNotag();
1638  }
1639  if (type == eTypeFamilyPrimitive) {
1640  m_SkipIndent = id.HasNotag();
1641  }
1642  } else {
1643  OpenStackTag(0);
1644  }
1645 }
1646 
1648 {
1649  m_SkipNextTag = false;
1650  if (TopFrame().GetNotag()) {
1651  TopFrame().SetNotag(false);
1652  } else {
1653  CloseStackTag(0);
1654  }
1655 }
1656 
1658  TConstObjectPtr choicePtr)
1659 {
1660  TMemberIndex index = choiceType->GetIndex(choicePtr);
1661  const CVariantInfo* variantInfo = choiceType->GetVariantInfo(index);
1662  BEGIN_OBJECT_FRAME2(eFrameChoiceVariant, variantInfo->GetId());
1663  OpenStackTag(0);
1664 
1665  variantInfo->WriteVariant(*this, choicePtr);
1666 
1667  CloseStackTag(0);
1668  END_OBJECT_FRAME();
1669 }
1670 
1671 static const char* const HEX = "0123456789ABCDEF";
1672 
1674  const char* bytes, size_t length)
1675 {
1676  if (IsCompressed()) {
1677  WriteBase64Bytes(bytes,length);
1678  return;
1679  }
1680  WriteBytes(bytes,length);
1681 }
1682 
1683 void CObjectOStreamXml::WriteBase64Bytes(const char* bytes, size_t length)
1684 {
1685  const size_t chunk_in = 57;
1686  const size_t chunk_out = 80;
1687  if (length > chunk_in) {
1688  m_Output.PutEol(false);
1689  }
1690  char dst_buf[chunk_out];
1691  size_t bytes_left = length;
1692  size_t src_read=0, dst_written=0, line_len=0;
1693  while (bytes_left > 0 && bytes_left <= length) {
1694  BASE64_Encode(bytes, min(bytes_left,chunk_in), &src_read,
1695  dst_buf, chunk_out, &dst_written, &line_len);
1696  m_Output.PutString(dst_buf,dst_written);
1697  bytes_left -= src_read;
1698  bytes += src_read;
1699  if (bytes_left > 0) {
1700  m_Output.PutEol(false);
1701  }
1702  }
1703  if (length > chunk_in) {
1704  m_Output.PutEol(false);
1705  }
1706 }
1707 
1708 void CObjectOStreamXml::WriteBytes(const char* bytes, size_t length)
1709 {
1710  while ( length-- > 0 ) {
1711  char c = *bytes++;
1712  m_Output.PutChar(HEX[(c >> 4) & 0xf]);
1713  m_Output.PutChar(HEX[c & 0xf]);
1714  }
1715 }
1716 
1718  const char* chars, size_t length)
1719 {
1720  while ( length-- > 0 ) {
1721  char c = *chars++;
1722  WriteEscapedChar(c);
1723  }
1724 }
1725 
1726 
1728 {
1730  FlushBuffer();
1731 }
1732 
1733 #if defined(NCBI_SERIAL_IO_TRACE)
1734 
1735 void CObjectOStreamXml::TraceTag(const string& name)
1736 {
1737  cout << ", Tag=" << name;
1738 }
1739 
1740 #endif
1741 
ncbi::TMaskedQueryRegions mask
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
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
char value[7]
Definition: config.c:431
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:46
std::ofstream out("events_result.xml")
main entry point for tests
static char precision
Definition: genparams.c:28
static int type
Definition: getdata.c:31
@ 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:89
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
#define finite
Define value of finite (Is Finite).
Definition: ncbifloat.h:109
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:936
static ETypeFamily GetRealTypeFamily(TTypeInfo typeInfo)
Definition: objstack.cpp:343
virtual void WriteEnum(const CEnumeratedTypeValues &values, TEnumValueType value) override
Definition: objostrxml.cpp:498
virtual void CopyStringStore(CObjectIStream &in) override
Definition: objostrxml.cpp:964
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)
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:293
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:511
bool x_SpecialCaseWrite(void)
Definition: objostrxml.cpp:593
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:735
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:719
#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:613
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:729
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:560
void SetNotag(bool set=true)
virtual void WriteBitString(const CBitString &obj) override
Definition: objostrxml.cpp:877
virtual void EndChoice(void) override
void WriteDouble2(double data, unsigned digits)
Definition: objostrxml.cpp:670
TFrame & FetchFrameFromTop(size_t index)
virtual void EndOfWrite(void) override
Definition: objostrxml.cpp:287
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:953
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:565
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:870
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:654
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:916
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:633
virtual void CopyEnum(const CEnumeratedTypeValues &values, CObjectIStream &in) override
Definition: objostrxml.cpp:504
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:973
bool HasMemberId(void) const
virtual void WriteFloat(float data) override
Definition: objostrxml.cpp:724
virtual void EndClass(void) override
void x_EndNamespace(const string &ns_name)
Definition: objostrxml.cpp:413
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:662
virtual void WriteChars(const CharBlock &block, const char *chars, size_t length) override
virtual void WriteUint4(Uint4 data) override
Definition: objostrxml.cpp:646
void x_EndTypeNamespace(void)
Definition: objostrxml.cpp:368
virtual void WriteObjectReference(TObjectIndex index) override
Definition: objostrxml.cpp:992
string GetDTDFilePrefix(void) const
Get DTD or schema file prefix.
bool x_ProcessTypeNamespace(TTypeInfo type)
Definition: objostrxml.cpp:353
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:923
virtual void WriteInt4(Int4 data) override
Definition: objostrxml.cpp:638
bool x_BeginNamespace(const string &ns_name, const string &ns_prefix)
Definition: objostrxml.cpp:380
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:946
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:2751
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
Definition: ncbistr.hpp:5186
#define kEmptyStr
Definition: ncbistr.hpp:123
Uint4 TUnicodeSymbol
Unicode character.
Definition: ncbistr.hpp:141
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:2662
static char SymbolToChar(TUnicodeSymbol sym, EEncoding encoding)
Convert Unicode code point into encoded character.
Definition: ncbistr.cpp:6860
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
Definition: ncbistr.hpp:3888
static TUnicodeSymbol CharToSymbol(char ch, EEncoding encoding)
Convert encoded character into Unicode.
Definition: ncbistr.cpp:6835
static TUnicodeSymbol Decode(const char *&src)
Convert sequence of UTF8 code units into Unicode code point.
Definition: ncbistr.hpp:5661
@ eEncoding_Windows_1252
Definition: ncbistr.hpp:207
@ eEncoding_ISO8859_1
Note: From the point of view of the C++.
Definition: ncbistr.hpp:203
@ 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
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:557
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 char tmp[2048]
Definition: utf8.c:42
static const char * prefix[]
Definition: pcregrep.c:405
static pcre_uint8 * buffer
Definition: pcretest.c:1051
#define BASE64_Encode
Definition: ncbi_base64.h:41
static const char * str(char *buf, int n)
Definition: stats.c:84
Definition: type.c:6
#define _ASSERT
done
Definition: token1.c:1
void free(voidpf ptr)
voidp malloc(uInt size)
Modified on Sat Dec 02 09:23:24 2023 by modify_doxy.py rev. 669887