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


C++ SharedBuffer::readNextBAShort方法代码示例

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


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

示例1:

void 
TilesNotice::load( SharedBuffer& buf )
{
   // Offset.
   m_offset = buf.readNextBALong();
   
   // start lat
   m_startLatIdx = buf.readNextBALong();
   // end lat
   m_endLatIdx = buf.readNextBALong();
   // start lon
   m_startLonIdx = buf.readNextBALong();
   // end lon 
   m_endLonIdx = buf.readNextBALong();

   // Size of m_impRange.
   m_nbrLayers = buf.readNextBAShort();
   MC2_ASSERT( m_nbrLayers > 0 );
   delete [] m_impRange;
   m_impRange = new impRange_t[ m_nbrLayers ];
   for ( uint32 i = 0; i < m_nbrLayers; ++i ) {
      m_impRange[ i ].m_layerID = buf.readNextBAShort();
      m_impRange[ i ].m_firstImp = buf.readNextBALong();
      m_impRange[ i ].m_lastImp = buf.readNextBALong();
   } 
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:26,代码来源:TileCollectionNotice.cpp

示例2: innerLoad

void
SFDLoadableHeader::loadRemainingHeader( SharedBuffer& buf )
{
   // File size.
   m_fileSize = buf.readNextBALong();

   // The name.
   m_name = buf.readNextString();

   mc2dbg << "[SFDLH] m_name = " << m_name << endl;

   // Check the file size.
   if ( m_fileHandler->getFileSize() != m_fileSize ) {
      m_state = failed_to_load;
      m_nbrBytesToRead = 0;
      innerLoad();
      return;
   }

   // Creation time.
   m_creationTime = buf.readNextBALong();

   // Null terminated strings?
   m_stringsAreNullTerminated = buf.readNextBAByte();

   // Longest length of string.
   m_maxStringSize = buf.readNextBAByte();

   // Nbr initial chars.
   byte nbrInitialChars = buf.readNextBAByte();
   m_initialCharacters.resize( nbrInitialChars );
   // Initial chars.
   {for ( byte b = 0; b < nbrInitialChars; ++b ) {
      m_initialCharacters[ b ] = buf.readNextBAByte();
   }}
   
   // Nbr route ids.
   byte nbrRouteIDs = buf.readNextBAByte();
   m_routeIDs.reserve( nbrRouteIDs );
   {for ( byte b = 0; b < nbrRouteIDs; ++b ) {
      uint32 id = buf.readNextBALong();
      uint32 creationTime = buf.readNextBALong(); 
      m_routeIDs.push_back( RouteID( id, creationTime ) );
   }}

   // Number of bits for the string index.
   m_strIdxEntrySizeBits = buf.readNextBALong();

   // Position for the start of strings index.
   m_strIdxStartOffset = buf.readNextBALong();

   // Number strings.
   m_nbrStrings = buf.readNextBALong();
   
   // Position for the start of string data.
   m_strDataStartOffset = buf.readNextBALong();

   // Position for the start of the buffers index.
   m_bufferIdxStartOffset = buf.readNextBALong();

   // Position for the start of the buffer data.
   m_bufferDataStartOffset = buf.readNextBALong();
  
   // If to read debug param strings for the multi buffers.
   m_readDebugParams = buf.readNextBAByte();
   
   // The tile collections.
   uint32 nbrCollections = buf.readNextBAShort();

   m_tileCollection.resize( nbrCollections );
   {for ( uint32 i = 0; i < nbrCollections; ++i ) {
      m_tileCollection[ i ].load( buf );
   }}
  
   // All is now loaded.
   m_state = loaded_all_header;
   m_nbrBytesToRead = 0;
   innerLoad();
}
开发者ID:VLjs,项目名称:Wayfinder-S60-Navigator,代码行数:79,代码来源:SFDLoadableHeader.cpp


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