当前位置: 首页>>代码示例>>C++>>正文


C++ stream_type::get方法代码示例

本文整理汇总了C++中stream_type::get方法的典型用法代码示例。如果您正苦于以下问题:C++ stream_type::get方法的具体用法?C++ stream_type::get怎么用?C++ stream_type::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在stream_type的用法示例。


在下文中一共展示了stream_type::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: readAlignmentGz

			static bool readAlignmentGz(
				stream_type & GZ,
				::libmaus::bambam::BamAlignment & alignment,
				::libmaus::bambam::BamHeader const * bamheader = 0,
				bool const validate = true
			)
			{
				/* read alignment block size */
				int64_t const bs0 = GZ.get();
				int64_t const bs1 = GZ.get();
				int64_t const bs2 = GZ.get();
				int64_t const bs3 = GZ.get();
				if ( bs3 < 0 )
					// reached end of file
					return false;
				
				/* assemble block size as LE integer */
				alignment.blocksize = (bs0 << 0) | (bs1 << 8) | (bs2 << 16) | (bs3 << 24) ;

				/* read alignment block */
				if ( alignment.blocksize > alignment.D.size() )
					alignment.D = ::libmaus::bambam::BamAlignment::D_array_type(alignment.blocksize,false);
				GZ.read(reinterpret_cast<char *>(alignment.D.begin()),alignment.blocksize);

				if ( static_cast<int64_t>(GZ.gcount()) != static_cast<int64_t>(alignment.blocksize) )
				{
					::libmaus::exception::LibMausException se;
					se.getStream() << "Invalid alignment (EOF in alignment block of length " << alignment.blocksize  << ")" << std::endl;
					se.finish();
					throw se;
				}
				
				if ( validate )
				{
					libmaus_bambam_alignment_validity const validity = bamheader ? alignment.valid(*bamheader) : alignment.valid();
					if ( validity != ::libmaus::bambam::libmaus_bambam_alignment_validity_ok )
					{
						::libmaus::exception::LibMausException se;
						se.getStream() << "Invalid alignment: " << validity << std::endl;
						se.finish();
						throw se;					
					}
				}
				
				return true;
			}
开发者ID:allenday,项目名称:libmaus,代码行数:46,代码来源:BamAlignmentDecoder.hpp

示例2: blocklen

			CompactFastQHeader(stream_type & stream)
			:
			  blocklen(::libmaus::util::NumberSerialisation::deserialiseNumber(stream)),
			  numreads(::libmaus::util::NumberSerialisation::deserialiseNumber(stream)),
			  qbits(stream.get()),
			  quant(stream)
			{
			
			}
开发者ID:srl147,项目名称:libmaus,代码行数:9,代码来源:CompactFastQHeader.hpp

示例3: getByte

			static uint8_t getByte(stream_type & in)
			{
				int const c = in.get();

				if ( c < 0 )
				{
					::libmaus2::exception::LibMausException se;
					se.getStream() << "Unexpected EOF in ::libmaus2::bambam::DecoderBase::getByte()" << std::endl;
					se.finish();
					throw se;
				}

				return c;
			}
开发者ID:whitwham,项目名称:libmaus2,代码行数:14,代码来源:DecoderBase.hpp

示例4: getLEInteger

			static value_type getLEInteger(stream_type & stream)
			{
				value_type v = 0;
				
				for ( uint64_t i = 0; i < length; ++i )
					if ( stream.peek() == stream_type::traits_type::eof() )
					{
						libmaus2::exception::LibMausException ex;
						ex.getStream() << "Failed to little endian number of length " << length << " in BamIndex::getLEInteger." << std::endl;
						ex.finish();
						throw ex;		
					}
					else
					{
						v |= static_cast<value_type>(stream.get()) << (8*i);
					}
									
				return v;
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:19,代码来源:BamIndex.hpp


注:本文中的stream_type::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。