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


C++ writeLong函数代码示例

本文整理汇总了C++中writeLong函数的典型用法代码示例。如果您正苦于以下问题:C++ writeLong函数的具体用法?C++ writeLong怎么用?C++ writeLong使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: writeLong

void 
UpdateTrafficCostRequestPacket::init()
{
   writeLong(m_allcostspos, 0);
   writeLong(m_nbrcostspos, 0);
   setLength(m_firstcostpos);
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:7,代码来源:UpdateTrafficCostPacket.cpp

示例2: writeLong

void chunkArchive::newStream(unsigned long magic)
{
	VALIDF;
	F->seek(0);
	writeLong(CHNK_MAGIC);	// CHNK
	writeLong(magic);
}
开发者ID:itadinanta,项目名称:emufxtool,代码行数:7,代码来源:chunkfile.C

示例3: writeString4

//-----------------------------------------------------------------------------
void Tes4SubRecordXCLCCELL::writeFile(FILE* pFile)
{
	writeString4(_name, pFile);
	writeUShort4(_size, pFile);
	writeLong   (_x,    pFile);
	writeLong   (_y,    pFile);
}
开发者ID:skyfox69,项目名称:TESConvert,代码行数:8,代码来源:tes4subrecordxclccell.cpp

示例4: readPC

auto R65816::op_write_longr_w(Reg16& idx) {
  aa.l = readPC();
  aa.h = readPC();
  aa.b = readPC();
  writeLong(aa.d + idx + 0, r.a.l);
L writeLong(aa.d + idx + 1, r.a.h);
}
开发者ID:jeapostrophe,项目名称:higan,代码行数:7,代码来源:instructions-write.cpp

示例5: TABLE_ENTRY

//---------------------------------------------------------------------------
void PacketFile::reserve(int32_t count, bool useCheckSum)
{
	//---------------------------------------------------
	// If we already have packets, reserve does nothing.
	// Otherwise, reserve sets up the file.  Must be
	// called before any writing to a newly created file.
	if(numPackets)
	{
		return;
	}
	usesCheckSum = useCheckSum;
	numPackets = count;
	int32_t firstPacketOffset = TABLE_ENTRY(numPackets);
	writeLong(PACKET_FILE_VERSION);
	writeLong(firstPacketOffset);
	//----------------------------
	// initialize the seek table
	while(count-- > 0)
		writeLong(SetPacketType(firstPacketOffset, STORAGE_TYPE_NUL));
	//-------------------------------------------------------------
	// If we called this, chances are we are writing a packet file
	// from start to finish.  It is MUCH faster if this table is
	// updated in memory and flushed when the file is closed.
	if(!seekTable)
	{
		seekTable = (int32_t*)systemHeap->Malloc(numPackets * sizeof(int32_t));
		if(seekTable != nullptr)
		{
			seek(sizeof(int32_t) * 2);							//File Version & File Length
			read(puint8_t(seekTable), (numPackets * sizeof(int32_t)));
		}
	}
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:34,代码来源:packet.cpp

示例6: writeTypedListElement

void writeTypedListElement( TAThread thread, const TypedListElement * value ) {
    const int * start;
    switch ( value->type ) {
        case IntTObjCode    : writeString( thread, "IntTObj"     ); writeInt   ( thread, value->data.IntTObj     ); break;
        case CharTObjCode   : writeString( thread, "CharTObj"    ); writeChar  ( thread, value->data.CharTObj    ); break;
        case ShortTObjCode  : writeString( thread, "ShortTObj"   ); writeShort ( thread, value->data.ShortTObj   ); break;
        case LongTObjCode   : writeString( thread, "LongTObj"    ); writeLong  ( thread, value->data.LongTObj    ); break;
        case LLongTObjCode  : writeString( thread, "LLongTObj"   ); writeLLong ( thread, value->data.LLongTObj   ); break;
        case IntMaxTObjCode : writeString( thread, "IntMaxTObj"  ); writeIntMax( thread, value->data.IntMaxTObj  ); break;
        case SizeTObjCode   : writeString( thread, "SizeTObj"    ); writeSize  ( thread, value->data.SizeTObj    ); break;
        case PtrDiffTObjCode: writeString( thread, "PtrDiffTObj" ); writeLong  ( thread, value->data.PtrDiffTObj ); break;
        case WIntTObjCode   : writeString( thread, "WIntTObj"    ); writeWChar ( thread, value->data.WIntTObj    ); break;
        case FloatTObjCode:
            start = (int *)& value->data.FloatTObj;
            writeString( thread, "FloatTObj" );
            writeIntArray( thread, start, sizeof( float ) / sizeof( int ) );
            break;
        case DoubleTObjCode:
            start = (int *)& value->data.DoubleTObj;
            writeString( thread, "DoubleTObj" );
            writeIntArray( thread, start, sizeof( double ) / sizeof( int ) );
            break;
        case LongDoubleTObjCode:
            start = (int *)& value->data.LongDoubleTObj;
            writeString( thread, "LongDoubleTObj" );
            writeIntArray( thread, start, sizeof( long double ) / sizeof( int ) );
            break;
        case CStringCode    : writeString( thread, "CString"     ); writeString ( thread, value->data.CString     ); break;
        case WStringCode    : writeString( thread, "WString"     ); writeWString( thread, value->data.WString     ); break;
        case VoidTPtrObjCode: writeString( thread, "VoidTPtrObj" ); writePointer( thread, value->data.VoidTPtrObj ); break;
        default: assertion( 0, "writeTypedListElement : unsupported type" ); break;
    }
} // writeTypedListElement
开发者ID:levenkov,项目名称:olver,代码行数:33,代码来源:process_common.c

示例7: getLength

//---------------------------------------------------------------------------
void PacketFile::atClose(void)
{
	if(isOpen() && fileMode != READ)								// update filesize
	{
		int32_t endPtr = getLength();
		//seek(sizeof(int32_t));								//Move Past Version Marker
		//writeLong(endPtr);								//Write File length
		int32_t tableEntry;
		currentPacket = numPackets;
		if(!seekTable)
		{
			while(--currentPacket >= 0)
			{
				seek(TABLE_ENTRY(currentPacket));
				tableEntry = readLong();
				if(GetPacketType(tableEntry) == STORAGE_TYPE_NUL)
				{
					seek(TABLE_ENTRY(currentPacket));
					writeLong(SetPacketType(endPtr, STORAGE_TYPE_NUL));
				}
				else
				{
					endPtr = GetPacketOffset(tableEntry);
				}
			}
		}
		else
		{
			while(--currentPacket >= 0)
			{
				tableEntry = seekTable[currentPacket];
				if(GetPacketType(tableEntry) == STORAGE_TYPE_NUL)
				{
					seekTable[currentPacket] = SetPacketType(endPtr, STORAGE_TYPE_NUL);
				}
				else
				{
					endPtr = GetPacketOffset(tableEntry);
				}
			}
		}
		//-----------------------------------------------------
		// If seekTable was being used, write it back to file
		if(seekTable)
		{
			seek(sizeof(int32_t) * 2);							//File Version & File Length
			write(puint8_t(seekTable), (numPackets * sizeof(int32_t)));
		}
		//------------------------------------------------------
		// Is we were using a checkSum, calc it and write it to
		// the beginning of the file.
		if(usesCheckSum)
		{
			int32_t checkSum = checkSumFile();
			seek(0);
			writeLong(checkSum);
		}
	}
	clear();
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:61,代码来源:packet.cpp

示例8: wxT

void Mega8Config::saveConfig(const wxString &profile)
{
    if (profile == wxEmptyString) {
        _currentProfile = wxT("General");
    } else {
        _currentProfile = profile;
    }

    saveKeyboard(_currentProfile);
    writeString(wxT("LastFolder"), _LastFolder);

    writeBool(wxT("FullScreen"), _FullScreen);
    writeBool(wxT("SpeedAuto"), _SpeedAuto);
    writeBool(wxT("DisplayHUD"), _DisplayHUD);
    writeBool(wxT("Filtered"), _Filtered);
    writeBool(wxT("SyncClock"), _SyncClock);
    writeLong(wxT("ColorTheme"), (int)_ColorTheme);
    writeBool(wxT("InverseColor"), _InverseColor);
    writeBool(wxT("Sound"), _Sound);
    writeBool(wxT("UseSleep"), _UseSleep);

    for (int i = 0; i <= sizeof(Chip8Types); i++) {
        writeLong(wxT("FrequencyRatio/") + getMachineTypeStr((Chip8Types)i), _FrequencyRatio[i]);
    }

    // Really save config
    if (_config != NULL) {
		writeConfig();
    }
}
开发者ID:Ready4Next,项目名称:Mega8,代码行数:30,代码来源:Mega8Config.cpp

示例9: write

bool MidiFile::writeTrack(const MidiTrack &t)
      {
      write("MTrk", 4);
      qint64 lenpos = fp->pos();
      writeLong(0);                 // dummy len

      status   = -1;
      int tick = 0;
      for (auto i : t.events()) {
            int ntick = i.first;
            putvl(ntick - tick);    // write tick delta
            //
            // if track channel != -1, then use this
            //    channel for all events in this track
            //
            if (t.outChannel() != -1)
                  writeEvent(i.second);
            tick = ntick;
            }

      //---------------------------------------------------
      //    write "End Of Track" Meta
      //    write Track Len
      //

      putvl(1);
      put(0xff);        // Meta
      put(0x2f);        // EOT
      putvl(0);         // len 0
      qint64 endpos = fp->pos();
      fp->seek(lenpos);
      writeLong(endpos-lenpos-4);   // tracklen
      fp->seek(endpos);
      return false;
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:35,代码来源:midifile.cpp

示例10: fseek

int SarReader::writeHeaderSub( ArchiveInfo *ai, FILE *fp, int archive_type, int nsa_offset )
{
    unsigned int i, j;

    fseek( fp, 0L, SEEK_SET );
    for (int k=0 ; k<nsa_offset ; k++)
        fputc( 0, fp );
    writeShort( fp, ai->num_of_files  );
    writeLong( fp, ai->base_offset-nsa_offset );
    
    for ( i=0 ; i<ai->num_of_files ; i++ ){

        for ( j=0 ; ai->fi_list[i].name[j] ; j++ )
            fputc( ai->fi_list[i].name[j], fp );
        fputc( ai->fi_list[i].name[j], fp );
        
        if ( archive_type >= ARCHIVE_TYPE_NSA )
            writeChar( fp, ai->fi_list[i].compression_type );

        writeLong( fp, ai->fi_list[i].offset  - ai->base_offset );
        writeLong( fp, ai->fi_list[i].length );

        if ( archive_type >= ARCHIVE_TYPE_NSA ){
            writeLong( fp, ai->fi_list[i].original_length );
        }
    }

    return 0;
}
开发者ID:DanielOaks,项目名称:onscripter-mirror,代码行数:29,代码来源:SarReader.cpp

示例11: ReplyPacket

ItemNamesReplyPacket::ItemNamesReplyPacket(const ItemNamesRequestPacket* p)
   : ReplyPacket(MAX_PACKET_SIZE, Packet::PACKETTYPE_ITEM_NAMES_REPLY, 
                 p, StringTable::OK)
{
   writeLong(ITEM_NAMES_REPLY_MAPID_POS, p->getMapID()); // MapID
   writeLong(ITEM_NAMES_REPLY_NBR_NAMES_POS, 0); // Nbr items
   setLength(ITEM_NAMES_REPLY_FIRST_NAME_POS);
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:8,代码来源:ItemNamesPacket.cpp

示例12: writeLong

void FileAllocator::write_node(FileOffset offset, const list_node *node)
{
    if (! (fseek(f, offset, SEEK_SET) == 0  &&
           writeLong(f, node->bytes) &&
           writeLong(f, node->prev) &&
           writeLong(f, node->next)))
        throw GenericException(__FILE__, __LINE__,
                               "FileAllocator node write at 0x%08lX failed",
                               (unsigned long)offset);
}
开发者ID:epicsdeb,项目名称:channelarchiver,代码行数:10,代码来源:FileAllocator.cpp

示例13: writeLong

void FSStorageUnit::writeString( char *str, long maxLength )
{
	if( maxLength == 0 )
		writeLong( strlen( str ) );
	else
		writeLong( maxLength );

	file->write( (const char *)str, strlen( str ) );

	if( maxLength > 0 )
		for( int o = strlen( str ); o < maxLength; o++ )
			file->put( (char)0 );
}
开发者ID:jskripsky,项目名称:ancient,代码行数:13,代码来源:FSSTORAG.CPP

示例14: UserRequestPacket

GetUserTrackRequestPacket::GetUserTrackRequestPacket(uint16 packetID, 
                                                   uint16 reqID, 
                                                   uint32 UIN)
   : UserRequestPacket(MAX_PACKET_SIZE,
                       Packet::PACKETTYPE_GETUSERTRACK_REQUEST,
                       packetID,
                       reqID,
                       UIN)
{
   writeLong(GETUSERTRACK_REQUEST_LOWER_INTERVAL, 0);
   writeLong(GETUSERTRACK_REQUEST_HIGHER_INTERVAL, 0);
   writeLong(GETUSERTRACK_REQUEST_MAXNBRHITS, 0);
   setLength(GETUSERTRACK_REQUEST_MAXNBRHITS + 4);
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:14,代码来源:GetUserTrackPacket.cpp

示例15: RequestPacket

RouteStorageGetRouteRequestPacket::RouteStorageGetRouteRequestPacket(
   uint32 routeID,
   uint32 createTime )
      : RequestPacket( REQUEST_HEADER_SIZE + endStatic_POS,
                       ROUTE_STORAGE_REQUEST_PRIO,
                       Packet::PACKETTYPE_ROUTESTORAGE_GET_ROUTE_REQUEST,
                       0,             // packetId
                       0,            //  requestID
                       MAX_UINT32 ) //   mapID
{
   writeLong( routeID_POS, routeID );
   writeLong( createTime_POS, createTime );
   setLength( endStatic_POS );
}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:14,代码来源:RouteStoragePacket.cpp


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