A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__Stream.html below:

C++ IOStream Fixups And Utilities

enum   ECompareTextMode { eCompareText_IgnoreEol , eCompareText_IgnoreWhiteSpace }   Mode to compare streams in text form. More...
  enum   EEncodingForm {
  eEncodingForm_Unknown , eEncodingForm_ISO8859_1 , eEncodingForm_Windows_1252 , eEncodingForm_Utf8 ,
  eEncodingForm_Utf16Native , eEncodingForm_Utf16Foreign
}   Helper functions to read plain-text data streams. More...
  enum   EReadUnknownNoBOM { eNoBOM_RawRead , eNoBOM_GuessEncoding }   How to read the text if the encoding form is not known (i.e. More...
  enum   EBOMDiscard { eBOM_Discard , eBOM_Keep }   Whether to discard BOM or to keep it in the input stream. More...
  enum   ERW_Result {
  eRW_NotImplemented = -1 , eRW_Success = 0 , eRW_Timeout , eRW_Error ,
  eRW_Eof
}   Result codes for I/O operations. More...
  enum   CStreamUtils::EPushback_How { CStreamUtils::ePushback_Copy , CStreamUtils::ePushback_NoCopy , CStreamUtils::ePushback_Stepback }     CNcbiIstrstream::CNcbiIstrstream (const string &_Str)     CNcbiIstrstream::CNcbiIstrstream (const char *_Ptr)     CNcbiIstrstream::CNcbiIstrstream (char *_Ptr)   template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>   CNcbiIstrstream::CNcbiIstrstream (char *_Ptr, TInteger _Count)   template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>   CNcbiIstrstream::CNcbiIstrstream (const char *_Ptr, TInteger _Count)     CNcbistrstream_Base< _Base, _DefMode >::CNcbistrstream_Base (void)   template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>   CNcbistrstream_Base< _Base, _DefMode >::CNcbistrstream_Base (char *_Ptr, TInteger _Count, IOS_BASE::openmode _Mode=_DefMode)   const char *  Endl (void)   Platform-specific EndOfLine. More...
  CNcbiIstreamNcbiGetline (CNcbiIstream &is, string &str, char delim, string::size_type *count=NULL)   Read from "is" to "str" up to the delimiter symbol "delim" (or EOF) More...
  CNcbiIstreamNcbiGetline (CNcbiIstream &is, string &str, const string &delims, string::size_type *count=NULL)   Read from "is" to "str" up to any symbol contained within "delims" (or EOF) More...
  CNcbiIstreamNcbiGetlineEOL (CNcbiIstream &is, string &str, string::size_type *count=NULL)   Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line) More...
  bool  NcbiStreamCopy (CNcbiOstream &os, CNcbiIstream &is)   Copy the entire contents of stream "is" to stream "os". More...
  void  NcbiStreamCopyThrow (CNcbiOstream &os, CNcbiIstream &is)   Same as NcbiStreamCopy() but throws an CCoreException when copy fails. More...
  void  NcbiStreamCopyHead (CNcbiOstream &os, CNcbiIstream &is, string::size_type count)   Similar to NcbiStreamCopyThrow() but copies (and consumes) only the specified number of bytes (and bypasses operator<< altogether). More...
  size_t  NcbiStreamToString (string *s, CNcbiIstream &is, size_t pos=0)   Input the entire contents of an istream into a string (NULL causes drain). More...
  bool  NcbiStreamCompare (CNcbiIstream &is1, CNcbiIstream &is2)   Compare stream contents in binary form. More...
  bool  NcbiStreamCompareText (CNcbiIstream &is1, CNcbiIstream &is2, ECompareTextMode mode, size_t buf_size=0)   Compare stream contents in text form. More...
  bool  NcbiStreamCompareText (CNcbiIstream &is, const string &str, ECompareTextMode mode, size_t buf_size=0)   Compare stream content with string in text form. More...
  Int8  NcbiStreamposToInt8 (NCBI_NS_STD::char_traits< char >::pos_type stream_pos)   Convert stream position to 64-bit int. More...
  NCBI_NS_STD::char_traits< char >::pos_type  NcbiInt8ToStreampos (Int8 pos)   Convert plain numeric stream position (offset) into stream position usable with STL stream library. More...
    CNcbiOstrstreamToString::CNcbiOstrstreamToString (const CNcbiOstrstreamToString &)   CNcbiOstrstreamToStringCNcbiOstrstreamToString::operator= (const CNcbiOstrstreamToString &)     CNcbiOstrstreamToString::CNcbiOstrstreamToString (CNcbiOstrstream &out)     CNcbiOstrstreamToString::operator string (void) const   CNcbiOstreamoperator<< (CNcbiOstream &out, const CNcbiOstrstreamToString &s)   Int8  GetOssSize (CNcbiOstrstream &oss)   bool  IsOssEmpty (CNcbiOstrstream &oss)     CUpcaseStringConverter::CUpcaseStringConverter (const string &s)     CUpcaseCharPtrConverter::CUpcaseCharPtrConverter (const char *s)     CLocaseStringConverter::CLocaseStringConverter (const string &s)     CLocaseCharPtrConverter::CLocaseCharPtrConverter (const char *s)     CPrintableStringConverter::CPrintableStringConverter (const string &s)     CPrintableCharPtrConverter::CPrintableCharPtrConverter (const char *s)   string  Printable (char c)   Convert one single character to a "printable" form. More...
  char  Upcase (char c)   CUpcaseStringConverter  Upcase (const string &s)   CUpcaseCharPtrConverter  Upcase (const char *s)   char  Locase (char c)   CLocaseStringConverter  Locase (const string &s)   CLocaseCharPtrConverter  Locase (const char *s)   CPrintableStringConverter  Printable (const string &s)   CPrintableCharPtrConverter  Printable (const char *s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CUpcaseStringConverter s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CUpcaseCharPtrConverter s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CLocaseStringConverter s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CLocaseCharPtrConverter s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CPrintableStringConverter s)   CNcbiOstreamoperator<< (CNcbiOstream &out, CPrintableCharPtrConverter s)   EEncodingForm  ReadIntoUtf8 (CNcbiIstream &input, CStringUTF8 *result, EEncodingForm encoding_form=eEncodingForm_Unknown, EReadUnknownNoBOM what_if_no_bom=eNoBOM_GuessEncoding)   Read all input data from stream and try convert it into UTF8 string. More...
  EEncodingForm  GetTextEncodingForm (CNcbiIstream &input, EBOMDiscard discard_bom)   Detect if the stream has BOM. More...
    CByteOrderMark::CByteOrderMark (void)     CByteOrderMark::CByteOrderMark (EEncodingForm encodingForm)   EEncodingForm  CByteOrderMark::GetEncodingForm (void) const   void  CByteOrderMark::SetEncodingForm (EEncodingForm encodingForm)   CNcbiOstreamoperator<< (CNcbiOstream &str, const CByteOrderMark &bom)   Write Byte Order Mark into output stream. More...
  CNcbiIstreamoperator>> (CNcbiIstream &str, CByteOrderMark &bom)   Read Byte Order Mark, if present, from input stream. More...
  NCBI_NS_NCBI::CNcbiOstreamoperator<< (NCBI_NS_NCBI::CNcbiOstream &os, const NCBI_NS_STD::string &str)   NCBI_NS_NCBI::CNcbiIstreamoperator>> (NCBI_NS_NCBI::CNcbiIstream &is, NCBI_NS_STD::string &str)   const char *  g_RW_ResultToString (ERW_Result res)   virtual ERW_Result  IReader::Read (void *buf, size_t count, size_t *bytes_read=0)=0   Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
  virtual ERW_Result  IReader::PendingCount (size_t *count)=0   Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking. More...
  virtual ERW_Result  IReader::Pushback (const void *buf, size_t count, void *del_ptr=0)   This method gets called by RStream buffer destructor to return buffered yet still unread (from the stream) portion of data back to the device. More...
  virtual  IReader::~IReader ()   virtual ERW_Result  IWriter::Write (const void *buf, size_t count, size_t *bytes_written=0)=0   Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device. More...
  virtual ERW_Result  IWriter::Flush (void)=0   Flush pending data (if any) down to the output device. More...
  virtual  IWriter::~IWriter ()   virtual  IReaderWriter::~IReaderWriter ()     CRStream::CRStream (IReader *r, streamsize buf_size=0, CT_CHAR_TYPE *buf=0, CRWStreambuf::TFlags stm_flags=0)     CWStream::CWStream (IWriter *w, streamsize buf_size=0, CT_CHAR_TYPE *buf=0, CRWStreambuf::TFlags stm_flags=0)     CRWStream::CRWStream (IReaderWriter *rw, streamsize buf_size=0, CT_CHAR_TYPE *buf=0, CRWStreambuf::TFlags stm_flags=0)     CRWStream::CRWStream (IReader *r, IWriter *w, streamsize buf_size=0, CT_CHAR_TYPE *buf=0, CRWStreambuf::TFlags stm_flags=0)   static void  CStreamUtils::Pushback (CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size, void *del_ptr)   static void  CStreamUtils::Pushback (CNcbiIstream &is, const CT_CHAR_TYPE *buf, streamsize buf_size)   static void  CStreamUtils::Stepback (CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size, void *del_ptr=0)   static streamsize  CStreamUtils::Readsome (CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size)   static void  CStreamUtils::x_Pushback (CNcbiIstream &is, CT_CHAR_TYPE *buf, streamsize buf_size, void *del_ptr=0, EPushback_How how=ePushback_Copy)     CStreamReader::CStreamReader (CNcbiIstream &is, EOwnership own=eNoOwnership)   virtual ERW_Result  CStreamReader::Read (void *buf, size_t count, size_t *bytes_read)   Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
  virtual ERW_Result  CStreamReader::PendingCount (size_t *count)   Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking. More...
  virtual ERW_Result  CStreamReader::Pushback (const void *buf, size_t count, void *del_ptr)   This method gets called by RStream buffer destructor to return buffered yet still unread (from the stream) portion of data back to the device. More...
    CStreamReader::CStreamReader (const CStreamReader &)   void  CStreamReader::operator= (const CStreamReader &)     CStreamWriter::CStreamWriter (CNcbiOstream &os, EOwnership own=eNoOwnership)   virtual ERW_Result  CStreamWriter::Write (const void *buf, size_t count, size_t *bytes_written)   Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device. More...
  virtual ERW_Result  CStreamWriter::Flush (void)   Flush pending data (if any) down to the output device. More...
    CStreamWriter::CStreamWriter (const CStreamWriter &)   void  CStreamWriter::operator= (const CStreamWriter &)     CStringReader::CStringReader (const string &s)   virtual ERW_Result  CStringReader::Read (void *buf, size_t count, size_t *bytes_read)   Read as many as "count" bytes into a buffer pointed to by the "buf" argument. More...
  virtual ERW_Result  CStringReader::PendingCount (size_t *count)   Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking. More...
  void  g_ExtractReaderContents (IReader &reader, string &s)   Append all IReader contents to a given string. More...
  ◆ CT_CHAR_TYPE #define CT_CHAR_TYPE   NCBI_NS_STD::char_traits<char>::char_type

Definition at line 729 of file ncbistre.hpp.

◆ CT_EOF #define CT_EOF   NCBI_NS_STD::char_traits<char>::eof()

Definition at line 732 of file ncbistre.hpp.

◆ CT_EQ_INT_TYPE #define CT_EQ_INT_TYPE   NCBI_NS_STD::char_traits<char>::eq_int_type

Definition at line 736 of file ncbistre.hpp.

◆ CT_INT_TYPE #define CT_INT_TYPE   NCBI_NS_STD::char_traits<char>::int_type

Definition at line 728 of file ncbistre.hpp.

◆ CT_NOT_EOF #define CT_NOT_EOF   NCBI_NS_STD::char_traits<char>::not_eof

Definition at line 733 of file ncbistre.hpp.

◆ CT_OFF_TYPE #define CT_OFF_TYPE   NCBI_NS_STD::char_traits<char>::off_type

Definition at line 731 of file ncbistre.hpp.

◆ CT_POS_TYPE ◆ CT_TO_CHAR_TYPE #define CT_TO_CHAR_TYPE   NCBI_NS_STD::char_traits<char>::to_char_type

Definition at line 735 of file ncbistre.hpp.

◆ CT_TO_INT_TYPE #define CT_TO_INT_TYPE   NCBI_NS_STD::char_traits<char>::to_int_type

Definition at line 734 of file ncbistre.hpp.

◆ NCBI_STRSTREAM_INIT #define NCBI_STRSTREAM_INIT (   p,   l  )    (p), (l)

Portable alias for strstreambuf.

Portable alias for istrstream. Portable alias for ostrstream. Portable alias for strstream.

Definition at line 168 of file ncbistre.hpp.

◆ NcbiBadbit #define NcbiBadbit   IOS_PREFIX::badbit

Definition at line 571 of file ncbistre.hpp.

◆ NcbiCerr #define NcbiCerr   IO_PREFIX::cerr

Definition at line 544 of file ncbistre.hpp.

◆ NcbiCin #define NcbiCin   IO_PREFIX::cin

Definition at line 542 of file ncbistre.hpp.

◆ NcbiClog #define NcbiClog   IO_PREFIX::clog

Definition at line 545 of file ncbistre.hpp.

◆ NcbiCout #define NcbiCout   IO_PREFIX::cout

Definition at line 543 of file ncbistre.hpp.

◆ NcbiDec #define NcbiDec   IO_PREFIX::dec

Definition at line 552 of file ncbistre.hpp.

◆ NcbiEndl #define NcbiEndl   IO_PREFIX::endl

Definition at line 548 of file ncbistre.hpp.

◆ NcbiEnds #define NcbiEnds   IO_PREFIX::ends

Definition at line 549 of file ncbistre.hpp.

◆ NcbiEofbit #define NcbiEofbit   IOS_PREFIX::eofbit

Definition at line 569 of file ncbistre.hpp.

◆ NcbiFailbit #define NcbiFailbit   IOS_PREFIX::failbit

Definition at line 570 of file ncbistre.hpp.

◆ NcbiFixed #define NcbiFixed   IO_PREFIX::fixed

Definition at line 557 of file ncbistre.hpp.

◆ NcbiFlush #define NcbiFlush   IO_PREFIX::flush

Definition at line 550 of file ncbistre.hpp.

◆ NcbiGoodbit #define NcbiGoodbit   IOS_PREFIX::goodbit

Definition at line 568 of file ncbistre.hpp.

◆ NcbiHardfail #define NcbiHardfail   IOS_PREFIX::hardfail

Definition at line 572 of file ncbistre.hpp.

◆ NcbiHex ◆ NcbiOct #define NcbiOct   IO_PREFIX::oct

Definition at line 554 of file ncbistre.hpp.

◆ NcbiResetiosflags #define NcbiResetiosflags   IO_PREFIX::resetiosflags

Definition at line 561 of file ncbistre.hpp.

◆ NcbiScientific #define NcbiScientific   IO_PREFIX::scientific

Definition at line 558 of file ncbistre.hpp.

◆ NcbiSetbase #define NcbiSetbase   IO_PREFIX::setbase

Definition at line 560 of file ncbistre.hpp.

◆ NcbiSetfill #define NcbiSetfill   IO_PREFIX::setfill

Definition at line 563 of file ncbistre.hpp.

◆ NcbiSetiosflags #define NcbiSetiosflags   IO_PREFIX::setiosflags

Definition at line 562 of file ncbistre.hpp.

◆ NcbiSetprecision #define NcbiSetprecision   IO_PREFIX::setprecision

Definition at line 564 of file ncbistre.hpp.

◆ NcbiSetw #define NcbiSetw   IO_PREFIX::setw

Definition at line 565 of file ncbistre.hpp.

◆ NcbiWs ◆ _Mybase [1/2] ◆ _Mybase [2/2]

template<typename _Base , IOS_BASE::openmode _DefMode>

Definition at line 243 of file ncbistre.hpp.

◆ CNcbiFilebuf ◆ CNcbiFstream ◆ CNcbiIfstream ◆ CNcbiIos ◆ CNcbiIostream ◆ CNcbiIstream ◆ CNcbiOfstream ◆ CNcbiOstream ◆ CNcbiOstrstream ◆ CNcbiStreambuf ◆ CNcbiStreamoff ◆ CNcbiStreampos ◆ CNcbiStrstream ◆ enable_if_integral [1/2] ◆ enable_if_integral [2/2]

template<typename _Base , IOS_BASE::openmode _DefMode>

template<class T >

Definition at line 254 of file ncbistre.hpp.

◆ EBOMDiscard

Whether to discard BOM or to keep it in the input stream.

See also
GetTextEncodingForm
Enumerator eBOM_Discard 

Discard the read BOM bytes.

eBOM_Keep 

Push the read BOM bytes back into the input stream.

Definition at line 1056 of file ncbistre.hpp.

◆ ECompareTextMode

Mode to compare streams in text form.

Enumerator eCompareText_IgnoreEol 

Skip end-of-line characters ('\r' and '
')

Skip white spaces (in terms of isspace(), including end-of-line)

eCompareText_IgnoreWhiteSpace 

Definition at line 686 of file ncbistre.hpp.

◆ EEncodingForm

Helper functions to read plain-text data streams.

It understands Byte Order Mark (BOM) and converts the input if needed.

See clause 13.6 in http://www.unicode.org/unicode/uni2book/ch13.pdf and also http://unicode.org/faq/utf_bom.html#BOM

See also
ReadIntoUtf8, GetTextEncodingForm
Enumerator eEncodingForm_Unknown 

Stream has no BOM.

eEncodingForm_ISO8859_1 

Stream has no BOM.

eEncodingForm_Windows_1252 

Stream has no BOM.

eEncodingForm_Utf8 

Stream has UTF8 BOM.

eEncodingForm_Utf16Native 

Stream has UTF16 BOM. Byte order is native for this OS.

eEncodingForm_Utf16Foreign 

Stream has UTF16 BOM. Byte order is nonnative for this OS.

Definition at line 994 of file ncbistre.hpp.

◆ EPushback_How Enumerator ePushback_Copy  ePushback_NoCopy  ePushback_Stepback 

Definition at line 125 of file stream_utils.hpp.

◆ EReadUnknownNoBOM

How to read the text if the encoding form is not known (i.e.

passed "eEncodingForm_Unknown" and the stream does not have BOM too)

See also
ReadIntoUtf8
Enumerator eNoBOM_RawRead 

Read the text "as is" (raw octal data).

The read data can then be accessed using the regular std::string API (rather than the CStringUTF8 one).

eNoBOM_GuessEncoding 

Try to guess the text's encoding form.

Note
In this case the encoding is a guesswork, which is not necessarily correct. If the guess is wrong then the data may be distorted on read. Use CStringUTF8::IsValid() to verify that guess. If it does not verify, then the read data can be accessed using the regular std::string API (rather than the CStringUTF8 one).

Definition at line 1014 of file ncbistre.hpp.

◆ ERW_Result

Result codes for I/O operations.

Note
Exceptions (if any) thrown by IReader/IWriter interfaces should be treated as unrecoverable errors (eRW_Error).
See also
IReader, IWriter, IReaderWriter
Enumerator eRW_NotImplemented 

Action / information is not available.

eRW_Success 

Everything is okay, I/O completed.

eRW_Timeout 

Timeout expired, try again later.

eRW_Error 

Unrecoverable error, no retry possible.

eRW_Eof 

End of data, should be considered permanent.

Definition at line 60 of file reader_writer.hpp.

◆ CByteOrderMark() [1/2] ◆ CByteOrderMark() [2/2] CByteOrderMark::CByteOrderMark ( void  ) inline

Definition at line 1082 of file ncbistre.hpp.

◆ CLocaseCharPtrConverter() CLocaseCharPtrConverter::CLocaseCharPtrConverter ( const char *  s ) inlineexplicit

Definition at line 871 of file ncbistre.hpp.

◆ CLocaseStringConverter() ◆ CNcbiIstrstream() [1/5] CNcbiIstrstream::CNcbiIstrstream ( char *  _Ptr ) inlineexplicit

Definition at line 184 of file ncbistre.hpp.

◆ CNcbiIstrstream() [2/5]

template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>

CNcbiIstrstream::CNcbiIstrstream ( char *  _Ptr, TInteger  _Count  ) inline

Definition at line 193 of file ncbistre.hpp.

◆ CNcbiIstrstream() [3/5] CNcbiIstrstream::CNcbiIstrstream ( const char *  _Ptr ) inlineexplicit

Definition at line 179 of file ncbistre.hpp.

◆ CNcbiIstrstream() [4/5]

template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>

CNcbiIstrstream::CNcbiIstrstream ( const char *  _Ptr, TInteger  _Count  ) inline

Definition at line 198 of file ncbistre.hpp.

◆ CNcbiIstrstream() [5/5] ◆ CNcbiOstrstreamToString() [1/2] ◆ CNcbiOstrstreamToString() [2/2] ◆ CNcbistrstream_Base() [1/2]

template<typename _Base , IOS_BASE::openmode _DefMode>

template<typename TInteger , typename = typename enable_if_integral<TInteger>::type>

Definition at line 258 of file ncbistre.hpp.

◆ CNcbistrstream_Base() [2/2]

template<typename _Base , IOS_BASE::openmode _DefMode>

Definition at line 244 of file ncbistre.hpp.

◆ CPrintableCharPtrConverter() CPrintableCharPtrConverter::CPrintableCharPtrConverter ( const char *  s ) inlineexplicit

Definition at line 896 of file ncbistre.hpp.

◆ CPrintableStringConverter() CPrintableStringConverter::CPrintableStringConverter ( const strings ) inlineexplicit

Definition at line 889 of file ncbistre.hpp.

◆ CRStream() ◆ CRWStream() [1/2] ◆ CRWStream() [2/2] ◆ CStreamReader() [1/2] ◆ CStreamReader() [2/2] ◆ CStreamWriter() [1/2] ◆ CStreamWriter() [2/2] ◆ CStringReader() ◆ CUpcaseCharPtrConverter() CUpcaseCharPtrConverter::CUpcaseCharPtrConverter ( const char *  s ) inlineexplicit

Definition at line 851 of file ncbistre.hpp.

◆ CUpcaseStringConverter() ◆ CWStream() ◆ Endl() const char* Endl ( void  ) ◆ Flush() [1/2] ◆ Flush() [2/2]

Flush pending data (if any) down to the output device.

Implemented in COSSWriter, CBufferWriter< TBuffer >, CBufferWriter< Buffer >, CxBlobWriter, CBDB_CacheIWriter, CNetCacheWriter, CCgiStreamWrapperWriter, COSSWriter, COSSWriter, CTransmissionWriter, CMultiWriter, CChecksumStreamWriter, CBufferWriter< TBuffer >, CBufferWriter< Buffer >, COctetStringSequenceWriter, CWriter_HTMLEncoder, CBlobWriter, CBDB_BlobReaderWriter, CStreamWriter, CFileReaderWriter, CFileWriter, CSocketReaderWriter, NDirectNetStorageImpl::CWOFileTrack, NDirectNetStorageImpl::CWONetCache, NDirectNetStorageImpl::CRWNotFound, NDirectNetStorageImpl::CObj, SNetStorageObjectRPC, SNetStorageObjectRPC::SOState, SNetStorage_NetCacheBlob, SNetStorage_NetCacheBlob::SOState, SEmbeddedStreamReaderWriter, SH2S_ReaderWriter, CStringOrWriter, SNetStorageObjectIState, CMD5StreamWriter< Buffer >, and CNullWriter.

Referenced by SEmbeddedStreamReaderWriter::Flush(), CTransmissionWriter::Flush(), CRWStreambuf::overflow(), and CSegmentSmearGlyph::CSegMap::Serialize().

◆ g_ExtractReaderContents() ◆ g_RW_ResultToString() ◆ GetEncodingForm() ◆ GetOssSize() ◆ GetTextEncodingForm()

Detect if the stream has BOM.

Parameters
input Input stream discard_bom Whether to discard the read BOM bytes or to push them back to the stream

NOTE: If the function needs to push back more than one char then it uses CStreamUtils::Pushback().

See also
CStreamUtils::Pushback()

Definition at line 782 of file ncbistre.cpp.

References eBOM_Keep, eEncodingForm_Unknown, eEncodingForm_Utf16Foreign, eEncodingForm_Utf16Native, eEncodingForm_Utf8, input(), int, n, CStreamUtils::Pushback(), and tmp.

Referenced by operator>>(), and IRWRegistry::Read().

◆ IsOssEmpty()

Definition at line 831 of file ncbistre.hpp.

References GetOssSize().

Referenced by CRemoteCgiJob::Do(), Empty(), CEditingActionFlatFile::Find(), CFlatFileField::GetVal(), CAgpErrEx::LineDone(), CMonitoredProcessWatcher::MonitorRun(), CException::ReportThis(), CMacroFunction_FixSpelling::TheFunction(), CSeqUpdateWorker::x_LaunchSingleUpdateSequence(), CMonitoredProcessWatcher::x_Log(), IMacroFunction< CIRef< IMacroBioDataIter > >::x_LogError(), IMacroFunction< CIRef< IMacroBioDataIter > >::x_LogFunction(), CNcbiDiag::x_Put(), and CUpdateMultiSeq_Dlg::x_UpdateSelected().

◆ Locase() [1/3] ◆ Locase() [2/3] ◆ Locase() [3/3] ◆ NcbiGetline() [1/2]

Read from "is" to "str" up to the delimiter symbol "delim" (or EOF)

Referenced by CFormatGuess::EnsureStats(), CTableImportDataSource::LoadTable(), MyGetline(), CStreamLineReader::operator++(), CSplitCacheApp::Process(), ProcessStream(), CAgpReader::ReadStream(), COMSSAMerge::Run(), CAgpFastaComparator::Run(), s_GetBigBedFeats(), s_GetBigBedSummary(), CFormatGuess::TestFormatCLUSTAL(), CFormatGuess::TestFormatTextAsn(), CStreamLineReader::x_AdvanceEOLCRLF(), CStreamLineReader::x_AdvanceEOLSimple(), CStreamLineReader::x_AdvanceEOLUnknown(), CCgiEntryReaderContext::x_DelimitedRead(), CWigGraph::x_GetBigWigSummary(), CRegexpTemplateTester::x_GetLine(), CSDB_ConnectionParam::x_GetPassword(), CBlastVdbCmdApp::x_InitApplicationData(), CAgpValidateApplication::x_LoadLenFa(), CHTMLPage::x_LoadTemplateLib(), and CAgpValidateApplication::x_ValidateFile().

◆ NcbiGetline() [2/2]

Read from "is" to "str" up to any symbol contained within "delims" (or EOF)

Note
Special case – if two different delimiters are back to back and in the same order as in delims, treat them as a single delimiter. E.g. "\r\n" will handle mixed DOS/MAC/UNIX line endings such as "\r", "\n" and "\r\n".
◆ NcbiGetlineEOL()

Read from "is" to "str" the next line (taking into account platform specifics of End-of-Line)

Referenced by CLinkUtils::AddSequenceLinks(), AgpRead(), BOOST_AUTO_TEST_CASE(), CDBInterfacesFileConnParams::CDBInterfacesFileConnParams(), CBlastDBAliasApp::ConvertGiFile(), CDumpSysInfo::DumpSystemInfo(), CPhyObjectLoader::Execute(), CWinMaskConfig::FillIdList(), CFeedbackReport::Format(), CCodeGenerator::GenerateCvsignore(), CProjectsLstFileFilter::GetAllowedTagsInfo(), GetIDsFromFile(), Getline(), CTextUtil::GetWordFrequencies(), CProjectsLstFileFilter::InitFromFile(), CIdMapperConfig::Initialize(), CAgpConverter::LoadChromosomeMap(), CProjBulderApp::LoadDepGraph(), CSimpleMakeFileContents::LoadFrom(), CSimpleMakeFileContents::SParser::LoadInclude(), CProjBulderApp::LoadProjectTags(), CWinMaskUtil::CInputBioseq_CI::operator++(), CMakefilePatch::PatchTreeMakefiles(), PromoteIfDifferent(), CDiagErrCodeInfo::Read(), CSimpleDictionary::Read(), CGlimmerReader::Read(), CRepeatLibrary::Read(), CDistanceMatrix::Read(), CColumnarVCFReader::ReadData(), ReadTextFile(), CColumnarVCFReader::ReadVariantsForChrs(), CNcbiApplogApp::Redirect(), CDemoSeqQaApp::Run(), CNcbiApplogApp::Run(), CTax4BlastDemo::Run(), CAsn2FastaApp::Run(), CAsn2FlatApp::Run(), CPubmedFetchApplication::Run(), CAsnCacheTestApplication::Run(), CPrimeCacheApplication::Run(), CAsnSubCacheCreateApplication::Run(), CMytestApplication::Run(), s_CheckSorted(), s_LookForOidlistInAliasFile(), s_ReadIdsFromFile(), s_UpdateVolumesInAliasFile(), CTaxIdSet::SetMappingFromFile(), NuclWordFinderTextFixture::setupSequenceOffsets(), CCodeGenerator::UndoGenerateCode(), CBlastUsageReport::x_CheckRunEnv(), CBlastDBAliasApp::x_ConvertSeqIDFile(), CWigGraph::x_GetBigWigData(), CBlastVdbCmdApp::x_GetQueries(), CMakeProfileDBApp::x_GetSMPFilenames(), CBlastDBCmdApp::x_InitBlastDB_TaxIdList(), CUnicodeToAsciiTranslation::x_Initialize(), CBlastDBCmdApp::x_ProcessBatchEntry(), CBlastDBCmdApp::x_ProcessBatchEntry_NoDup(), CBlastDBCmdApp::x_ProcessBatchPig(), IRWRegistry::x_Read(), CPrimeCacheApplication::x_Read_Ids(), and CBLASTDatabases::x_UpdateDbMap().

◆ NcbiInt8ToStreampos() NCBI_NS_STD::char_traits<char>::pos_type NcbiInt8ToStreampos ( Int8  pos ) inline ◆ NcbiStreamCompare()

Compare stream contents in binary form.

Parameters
is1 First stream to compare. is2 Second stream to compare.
Returns
TRUE if streams content is equal; FALSE otherwise.

Definition at line 356 of file ncbistre.cpp.

◆ NcbiStreamCompareText() [1/2]

Compare stream content with string in text form.

Parameters
is Stream to compare. str String to compare. mode Type of white space characters to ignore. buf_size Size of buffer to read stream. Zero value means using default buffer size.
Returns
TRUE if stream and string content is equal; FALSE otherwise.

Definition at line 419 of file ncbistre.cpp.

References NcbiStreamCompareText(), and str().

◆ NcbiStreamCompareText() [2/2]

Compare stream contents in text form.

Parameters
is1 First stream to compare. is2 Second stream to compare. mode Type of white space characters to ignore. buf_size Size of buffer to read stream. Zero value means using default buffer size.
Returns
TRUE if streams content is equal; FALSE otherwise.

Definition at line 394 of file ncbistre.cpp.

References x_GetChar().

Referenced by CFile::CompareTextContents(), and NcbiStreamCompareText().

◆ NcbiStreamCopy()

Copy the entire contents of stream "is" to stream "os".

Returns
"true" if the operation was successful, i.e. "is" had been read entirely with all of its _available_ contents (including none) written to "os"; "false" if either extraction from "is" or insertion into "os" failed.

The call may throw exceptions only if they are enabled on the respective stream(s).

Note
The call is an extension to the standard ostream& ostream::operator<<(streambuf*), which severely lacks error checking (esp. for partial write failures).
Input ("is") stream state is not always asserted accurately: in particular, upon successful completion "is.eof()" may not necessarily be true; or, in case of fatal read errors "is" may not have its "is.bad()" state set (however, the return code should still be "false" to properly indicate the copy failure in this case).
Attention
This call (as well as the mentioned STL counterpart) provides only the mechanism of delivering data to the destination stream(buf) "os"; and a successful return result does not generally guarantee that the data have yet reached the physical destination. Other "os"-specific API must be performed to assure the data integrity at the receiving device: such as checking for errors after doing a "close()" (if "os" is an ofstream, for example). For instance, uploading into the Toolkit FTP stream must be finalized with a read for the byte count delivered; otherwise, it may not work correctly.
See also
CConn_IOStream, NcbiStreamCopyStart, NcbiStreamCopyThrow

Definition at line 211 of file ncbistre.cpp.

References _ASSERT, CT_EOF, CT_EQ_INT_TYPE, and true.

Referenced by CChunkFile::Append(), CSeqIdChunkFile::Append(), CGridRPCBaseClient< CAsnBinCompressed >::AskStream(), CTmpStreamGuard::Close(), CBiosampleChkApp::CreateBiosampleUpdateWebService(), CCompareWithBiosample::CreateBiosampleUpdateWebService(), CGBenchFeedbackAttachment::EncodeData(), SAsyncWriteTask::Execute(), SFileTrackRequest::GetFileInfo(), CDoiLookup::GetPubFromCrossRef(), CCgiApplication::GetResultFromCache(), CProjectStorage::GetString(), CProjectStorage::GetVector(), CIdMapperConfig::Initialize(), CGBDocument::LoadFile(), CNetScheduleJobSerializer::LoadJobInput(), NcbiStreamCopyThrow(), CManipulatorOProxy< TInputStream, TOutputStream >::operator<<(), CManipulatorIProxy< TInputStream, TOutputStream >::operator>>(), CGridCommandLineInterfaceApp::PrepareRemoteAppJobInput(), CHttpSessionApp::PrintResponse(), CCgiRequestProcessor::ProcessHelpRequest(), CCgi2RCgiApp::ReadJob(), CSftpSampleApp::Run(), CHttpSessionApp::Run(), s_UpdateLocalFile(), CNetScheduleJobSerializer::SaveJobInput(), CNetScheduleJobSerializer::SaveJobOutput(), CCgiApplication::SaveResultToCache(), CProjectStorage::SaveStream(), CRemoteAppClientSampleApp::ShowBlob(), CRPCClient_Base::x_Ask(), CCompressedFile::x_DownloadFile(), CEutilsClient::x_FetchOnce(), CEutilsClient::x_GetOnce(), CTMS_DisplayTrack_Client::x_HttpFetch(), x_IsUrlAccessible(), CEutilsClient::x_LinkOnce(), CEutilsClient::x_LinkOnceT(), CGridCommandLineInterfaceApp::x_LoadJobInput(), CCgiRequest::x_ProcessInputStream(), and CEutilsClient::x_SearchOnce().

◆ NcbiStreamCopyHead()

Similar to NcbiStreamCopyThrow() but copies (and consumes) only the specified number of bytes (and bypasses operator<< altogether).

In the event of write failure, the number of bytes consumed may fall anywhere between the number of bytes written and the target count, inclusive. If the input stream has less data than requested, copies what it can, sets that stream's eof and fail flags, and returns normally; if anything else goes wrong, throws an exception in addition to setting appropriate flags (and copying what it can).

See also
NcbiStreamCopy, NcbiStreamCopyThrow, CCoreException
◆ NcbiStreamCopyThrow() ◆ NcbiStreamposToInt8() Int8 NcbiStreamposToInt8 ( NCBI_NS_STD::char_traits< char >::pos_type  stream_pos ) inline

Convert stream position to 64-bit int.

On most systems stream position is a structure, this function converts it to plain numeric value.

See also
NcbiInt8ToStreampos

Definition at line 771 of file ncbistre.hpp.

References CT_OFF_TYPE, and CT_POS_TYPE.

Referenced by CRowReader< TTraits >::CRowReader(), CBDB_ExtBlobStore< TBV >::Flush(), GetOssSize(), CObjectIStream::GetPosition(), CObjectOStream::GetPosition(), CObjectIStream::Location(), CLDS2_ObjectParser::ParseNext(), CProcessor_St_SE_SNPT::ProcessStream(), s_FindAttribute(), CLDS2_SeqEntry_Hook::SkipObject(), CFastaReader::StreamPosition(), CRowReader< TTraits >::Validate(), CRowReader< TTraits >::x_GetRowData(), CCgiApplication::x_OnEvent(), CLDS2_Manager::x_ParseFile(), CFastCgiApplicationMT::x_ProcessThreadedRequest(), and CRowReader< TTraits >::x_ReadNextRow().

◆ NcbiStreamToString()

Input the entire contents of an istream into a string (NULL causes drain).

"is" gets its failbit set if nothing was extracted from it; and gets its eofbit (w/o failbit) set if the stream has reached an EOF condition.

Parameters
pos Where in "*s" to begin saving data (ignored when "s" == NULL).
Returns
Size of copied data if the operation was successful (i.e. "is" had reached EOF), 0 otherwise.
Note
If "s" != NULL, then "s->size() >= pos" always upon return.
See also
NcbiStreamCopy

Definition at line 296 of file ncbistre.cpp.

References _ASSERT, buf, count, NcbiEofbit, NcbiFailbit, and str().

Referenced by edirect::Execute(), LoadFile(), CEUtils_Request::Read(), CId1FetchApp::Run(), fix_pub::s_IsIndexed(), and CMsvcConfigure::WriteBuildVer().

◆ operator string() CNcbiOstrstreamToString::operator string ( void  ) const ◆ operator<<() [1/9] ◆ operator<<() [2/9] ◆ operator<<() [3/9] ◆ operator<<() [4/9] ◆ operator<<() [5/9] ◆ operator<<() [6/9] ◆ operator<<() [7/9] ◆ operator<<() [8/9] ◆ operator<<() [9/9] ◆ operator=() [1/3] ◆ operator=() [2/3] ◆ operator=() [3/3] ◆ operator>>() [1/2] ◆ operator>>() [2/2] ◆ PendingCount() [1/3] ERW_Result CStreamReader::PendingCount ( size_t *  count ) virtual

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking.

Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem ("*count" does not need to be updated in the case of non-eRW_Success). Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero "*count", or return eRW_NotImplemented alone.

Implements IReader.

Definition at line 627 of file stream_utils.cpp.

References count, eRW_Eof, eRW_Error, eRW_Success, CStreamReader::m_Stream, and NcbiEofbit.

◆ PendingCount() [2/3] ERW_Result CStringReader::PendingCount ( size_t *  count ) virtual

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking.

Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem ("*count" does not need to be updated in the case of non-eRW_Success). Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero "*count", or return eRW_NotImplemented alone.

Implements IReader.

Definition at line 732 of file stream_utils.cpp.

References _ASSERT, count, eRW_Eof, eRW_Success, CStringReader::m_Position, and CStringReader::m_String.

◆ PendingCount() [3/3] virtual ERW_Result IReader::PendingCount ( size_t *  count ) pure virtual

Via parameter "count" (which is guaranteed to be supplied non-NULL) return the number of bytes that are ready to be read from the input device without blocking.

Return eRW_Success if the number of pending bytes has been stored at the location pointed to by "count". Return eRW_NotImplemented if the number cannot be determined. Otherwise, return other eRW_... condition to reflect the problem ("*count" does not need to be updated in the case of non-eRW_Success). Note that if reporting 0 bytes ready, the method may return either both eRW_Success and zero "*count", or return eRW_NotImplemented alone.

Implemented in NDirectNetStorageImpl::CROFileTrack, NDirectNetStorageImpl::CRONetCache, NDirectNetStorageImpl::CRWNotFound, NDirectNetStorageImpl::CObj, SNetStorageObjectRPC, SNetStorageObjectRPC::SIState, SNetStorage_NetCacheBlob, SNetStorage_NetCacheBlob::SIState, SH2S_ReaderWriter, CDataChunkReader, SNetStorageObjectOState, CTarReader, CMemoryReader, SPSG_BlobReader, CReaderOfLines, CxBlobReader, CBDB_CacheIReader, CNetCacheReader, CTransmissionReader, CNlmZipReader, CBlobReader, CBDB_BlobReaderWriter, CStringReader, CStreamReader, CFileReaderWriter, CFileReader, CStringOrBlobStorageReader, CSocketReaderWriter, CCgiEntryReader, SEmbeddedStreamReaderWriter, CCGIStreamReader, and CDB_Result_Reader.

Referenced by NCBI_PARAM_DEF_EX(), SEmbeddedStreamReaderWriter::PendingCount(), CTransmissionReader::PendingCount(), and CRWStreambuf::showmanyc().

◆ Printable() [1/3]

Convert one single character to a "printable" form.

A "printable" form is one of well-known C-style backslash-quoted sequences ('\0', '', '', '\f', '
', '\r', '\t', '\v', '\', '\'', '"'), or '\xXX' for other non-printable characters (per isprint()), or a graphical representation of 'c' as an ASCII character.

Note
*DO NOT USE* to convert strings! Because of the '\xXX' notation, such conversions can result in ambiguity (e.g. "\xAAA" is a valid _single_-character string per the standard).

Definition at line 505 of file ncbistre.cpp.

References isprint().

Referenced by CCgiResponse::BeginPart(), and IRegistry::Write().

◆ Printable() [2/3] ◆ Printable() [3/3] ◆ Pushback() [1/4] ◆ Pushback() [2/4] ◆ Pushback() [3/4] ERW_Result CStreamReader::Pushback ( const void *  buf, size_t  count, void *  del_ptr  ) virtual ◆ Pushback() [4/4] ERW_Result IReader::Pushback ( const void *  buf, size_t  count, void *  del_ptr = 0  ) virtual

This method gets called by RStream buffer destructor to return buffered yet still unread (from the stream) portion of data back to the device.

It's semantically equivalent to CStreamUtils::Pushback() with the only difference that IReader can only assume the ownership of "buf" when "del_ptr" is passed non-NULL. Return eRW_Success when data have been successfully pushed back and the ownership of the pointers has been assumed as described above. Any other error code results in pointers remained and handled within the stream buffer being deleted, with an error message suppressed for eRW_NotImplemented (default implementation).

See also
CStreamUtils::Pushback

Reimplemented in CStreamReader, and CSocketReaderWriter.

Definition at line 579 of file stream_utils.cpp.

References eRW_NotImplemented.

Referenced by CRWStreambuf::x_Pushback().

◆ Read() [1/3] ERW_Result CStreamReader::Read ( void *  buf, size_t  count, size_t *  bytes_read  ) virtual

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

Always store the number of bytes actually read (0 if read none) via the pointer "bytes_read", if provided non-NULL. Return non-eRW_Success code if EOF / error condition has been encountered during the operation (some data may have been read, nevertheless, and reflected in "*bytes_read"). Special case: if "count" is passed as 0, then the value of "buf" must be ignored, and no change should be made to the state of the input device (but may return non-eRW_Success to indicate that the input device has already been in an error condition).

Note
Apparently, may not return eRW_Success if hasn't been able to read "count" bytes as requested, and "bytes_read" was provided as NULL.
When returning "*bytes_read" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_read" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer is read or the call returns when at least some data are available. In general, it is advised that this call is made within a loop that checks for EOF condition and proceeds with the reading until the required amount of data has been retrieved.

Implements IReader.

Definition at line 600 of file stream_utils.cpp.

References buf, count, eRW_Eof, eRW_Error, eRW_Success, CStreamReader::m_Stream, NcbiBadbit, NcbiEofbit, NcbiFailbit, ok, r(), and result.

◆ Read() [2/3] ERW_Result CStringReader::Read ( void *  buf, size_t  count, size_t *  bytes_read  ) virtual

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

Always store the number of bytes actually read (0 if read none) via the pointer "bytes_read", if provided non-NULL. Return non-eRW_Success code if EOF / error condition has been encountered during the operation (some data may have been read, nevertheless, and reflected in "*bytes_read"). Special case: if "count" is passed as 0, then the value of "buf" must be ignored, and no change should be made to the state of the input device (but may return non-eRW_Success to indicate that the input device has already been in an error condition).

Note
Apparently, may not return eRW_Success if hasn't been able to read "count" bytes as requested, and "bytes_read" was provided as NULL.
When returning "*bytes_read" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_read" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer is read or the call returns when at least some data are available. In general, it is advised that this call is made within a loop that checks for EOF condition and proceeds with the reading until the required amount of data has been retrieved.

Implements IReader.

Definition at line 711 of file stream_utils.cpp.

References _ASSERT, buf, count, eRW_Eof, eRW_Error, eRW_Success, CStringReader::m_Position, CStringReader::m_String, min(), and n.

◆ Read() [3/3] virtual ERW_Result IReader::Read ( void *  buf, size_t  count, size_t *  bytes_read = 0  ) pure virtual

Read as many as "count" bytes into a buffer pointed to by the "buf" argument.

Always store the number of bytes actually read (0 if read none) via the pointer "bytes_read", if provided non-NULL. Return non-eRW_Success code if EOF / error condition has been encountered during the operation (some data may have been read, nevertheless, and reflected in "*bytes_read"). Special case: if "count" is passed as 0, then the value of "buf" must be ignored, and no change should be made to the state of the input device (but may return non-eRW_Success to indicate that the input device has already been in an error condition).

Note
Apparently, may not return eRW_Success if hasn't been able to read "count" bytes as requested, and "bytes_read" was provided as NULL.
When returning "*bytes_read" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_read" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer is read or the call returns when at least some data are available. In general, it is advised that this call is made within a loop that checks for EOF condition and proceeds with the reading until the required amount of data has been retrieved.

Implemented in NDirectNetStorageImpl::CROFileTrack, NDirectNetStorageImpl::CRONetCache, NDirectNetStorageImpl::CRWNotFound, SNetStorageObjectRPC::SIState, SNetStorage_NetCacheBlob::SIState, SNetStorageObjectOState, CNetCacheReader, SH2S_ReaderWriter, CDataChunkReader, CTarReader, SPSG_BlobReader, CReaderOfLines, CxBlobReader, CCGIStreamReader, CTransmissionReader, CNlmZipReader, CBlobReader, CFileReaderWriter, CFileReader, CStringOrBlobStorageReader, CSocketReaderWriter, SNetStorageObjectRPC, SNetStorage_NetCacheBlob, CMemoryReader, CBDB_CacheIReader, CDB_Result_Reader, CBDB_BlobReaderWriter, CStringReader, CStreamReader, CCgiEntryReader, SEmbeddedStreamReaderWriter, and NDirectNetStorageImpl::CObj.

Referenced by CSegmentSmearGlyph::CSegMap::Deserialize(), g_ExtractReaderContents(), NCBI_PARAM_DEF_EX(), CIRByteSourceReader::Read(), SEmbeddedStreamReaderWriter::Read(), CNlmZipReader::Read(), CTransmissionReader::Read(), SNetCacheAPIImpl::ReadBuffer(), CTransmissionReader::ReadData(), CNcbiSample_Dbapi_Advanced_Features::RunSample(), CRWStreambuf::underflow(), CNlmZipReader::x_Read(), CRWStreambuf::x_Read(), CBufferedLineReader::x_ReadBuffer(), CWigBufferedLineReader::x_ReadBuffer(), and CNlmZipReader::x_ReadZipHeader().

◆ ReadIntoUtf8()

Read all input data from stream and try convert it into UTF8 string.

Parameters
input Input text stream result UTF8 string (but it can be a raw octet string if the encoding is unknown) what_if_no_bom What to do if the 'encoding_form' is passed "eEncodingForm_Unknown" and the BOM is not detected in the stream
Returns
The encoding as detected based on the BOM ("eEncodingForm_Unknown" if there was no BOM).

Definition at line 650 of file ncbistre.cpp.

References CUtf8::AsUTF8(), buf, eEncoding_Ascii, eEncoding_ISO8859_1, eEncoding_Unknown, eEncoding_UTF8, eEncoding_Windows_1252, eEncodingForm_ISO8859_1, eEncodingForm_Unknown, eEncodingForm_Utf16Foreign, eEncodingForm_Utf16Native, eEncodingForm_Utf8, eEncodingForm_Windows_1252, eNoBOM_GuessEncoding, CUtf8::GetValidBytesCount(), CUtf8::GuessEncoding(), input(), int, max(), n, NCBI_THROW, NcbiSys_swab, result, and tmp.

Referenced by CCgiEntry::GetValueAsUTF8(), and IRWRegistry::Read().

◆ Readsome() ◆ SetEncodingForm() void CByteOrderMark::SetEncodingForm ( EEncodingForm  encodingForm ) inline ◆ Stepback() ◆ Upcase() [1/3] ◆ Upcase() [2/3] ◆ Upcase() [3/3] ◆ Write() [1/2] ERW_Result CStreamWriter::Write ( const void *  buf, size_t  count, size_t *  bytes_written  ) virtual

Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.

Always store the number of bytes actually written, or 0 if "count" has been passed as 0 ("buf" must be ignored in this case), via the "bytes_written" pointer, if provided non-NULL. Note that the method can return non-eRW_Success in case of an I/O error along with indicating (some) data delivered to the output device (and reflected in "*bytes_written").

Note
Apparently, may not return eRW_Success if hasn't been able to write "count" bytes as requested, and "bytes_written" was passed as NULL.
When returning "*bytes_written" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_written" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer or only some data has been written out. In general, it is advised that this call is made within a loop that checks for errors and proceeds with the writing until the required amount of data has been sent.

Implements IWriter.

Definition at line 659 of file stream_utils.cpp.

References buf, count, eRW_Error, eRW_Success, CStreamWriter::m_Stream, NcbiBadbit, NcbiFailbit, ok, and result.

◆ Write() [2/2] virtual ERW_Result IWriter::Write ( const void *  buf, size_t  count, size_t *  bytes_written = 0  ) pure virtual

Write up to "count" bytes from the buffer pointed to by the "buf" argument onto the output device.

Always store the number of bytes actually written, or 0 if "count" has been passed as 0 ("buf" must be ignored in this case), via the "bytes_written" pointer, if provided non-NULL. Note that the method can return non-eRW_Success in case of an I/O error along with indicating (some) data delivered to the output device (and reflected in "*bytes_written").

Note
Apparently, may not return eRW_Success if hasn't been able to write "count" bytes as requested, and "bytes_written" was passed as NULL.
When returning "*bytes_written" as zero for a non-zero "count" requested, the return status should not indicate eRW_Success.
Warning
"*bytes_written" may never be returned greater than "count".
Attention
It is implementation-dependent whether the call blocks until the entire buffer or only some data has been written out. In general, it is advised that this call is made within a loop that checks for errors and proceeds with the writing until the required amount of data has been sent.

Implemented in CBufferWriter< TBuffer >, CBufferWriter< Buffer >, CBufferWriter< TBuffer >, CBufferWriter< Buffer >, COSSWriter, COSSWriter, COSSWriter, COctetStringSequenceWriter, NDirectNetStorageImpl::CWOFileTrack, NDirectNetStorageImpl::CWONetCache, NDirectNetStorageImpl::CRWNotFound, SNetStorageObjectRPC::SOState, SNetStorage_NetCacheBlob::SOState, SIoStreamEmbeddedStreamReaderWriter, SNetStorageObjectIState, SH2S_ReaderWriter, CStringOrWriter, CMD5StreamWriter< Buffer >, CxBlobWriter, CBDB_CacheIWriter, CNetCacheWriter, CCgiStreamWrapperWriter, CTransmissionWriter, CMultiWriter, CChecksumStreamWriter, CWriter_HTMLEncoder, CBlobWriter, CFileReaderWriter, CFileWriter, CSocketReaderWriter, SNetStorageObjectRPC, SNetStorage_NetCacheBlob, CNullWriter, CBDB_BlobReaderWriter, CStreamWriter, SEmbeddedStreamReaderWriter, and NDirectNetStorageImpl::CObj.

Referenced by CWriterSourceCollector::AddChunk(), CRWStreambuf::overflow(), CNcbiSample_Dbapi_Advanced_Features::RunSample(), CSegmentSmearGlyph::CSegMap::Serialize(), SEmbeddedStreamReaderWriter::Write(), CTransmissionWriter::Write(), CTransmissionWriter::WriteUint4(), and CRWStreambuf::xsputn().

◆ x_Pushback()

Definition at line 379 of file stream_utils.cpp.

References _ASSERT, buf, CT_CHAR_TYPE, CStreamUtils::ePushback_Copy, CStreamUtils::ePushback_NoCopy, CStreamUtils::ePushback_Stepback, CPushback_Streambuf::kMinBufSize, CPushback_Streambuf::m_Buf, CPushback_Streambuf::m_BufSize, CPushback_Streambuf::m_DelPtr, max(), memmove, and NCBI_THROW.

Referenced by CStreamUtils::Pushback(), and CStreamUtils::Stepback().

◆ ~IReader() ◆ ~IReaderWriter() ◆ ~IWriter() ◆ m_EncodingForm ◆ m_Out ◆ m_Position ◆ m_Sb [1/3] ◆ m_Sb [2/3] ◆ m_Sb [3/3] ◆ m_Stream [1/2] ◆ m_Stream [2/2] ◆ m_String [1/7] ◆ m_String [2/7] const char* CUpcaseCharPtrConverter::m_String ◆ m_String [3/7] ◆ m_String [4/7] const char* CLocaseCharPtrConverter::m_String ◆ m_String [5/7] ◆ m_String [6/7] const char* CPrintableCharPtrConverter::m_String ◆ m_String [7/7] string CStringReader::m_String private ◆ operator<<

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4