您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ writeLong函数代码示例

51自学网 2021-06-03 10:04:21
  C++
这篇教程C++ writeLong函数代码示例写得很实用,希望能帮到您。

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

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

示例1: writeLong

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


示例2: writeLong

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


示例3: writeString4

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


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例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,


示例16: RequestPacket

ItemNamesRequestPacket::ItemNamesRequestPacket(uint32 mapID,                                                uint16 requestID,                                                uint16 packetID)   : RequestPacket(MAX_PACKET_SIZE,                   ITEMNAMESREQUESTPACKET_PRIO,                   Packet::PACKETTYPE_ITEM_NAMES_REQUEST,                   packetID,                   requestID,                   mapID){   writeLong(ITEM_NAMES_REQUEST_PREFERED_LANGUAGES_POS, 0);   writeLong(ITEM_NAMES_REQUEST_NBR_ITEMS_POS, 0);   setLength(ITEM_NAMES_REQUEST_FIRST_ITEM_POS);}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:14,


示例17: deleteByOffset

void deleteByOffset(DeletionHandler *dh, long offset) {	long head = readLong(dh->bfr, 0L); // read head	seekBinaryFile(dh->bfr->bf, offset); // point to offset	int size = readInt(dh->bfr, getStreamOffset(dh->bfr->bf));	size *= -1; // delete	seekBinaryFile(dh->bfw->bf, offset);	writeInt(dh->bfw, size, getStreamOffset(dh->bfw->bf)); // write deleted	seekBinaryFile(dh->bfw->bf, (offset + sizeof(int)));	writeLong(dh->bfw, head, getStreamOffset(dh->bfw->bf)); // write head	writeLong(dh->bfw, offset, 0L); // updated head with new offset}
开发者ID:jgcmarins,项目名称:dbms,代码行数:15,


示例18: __sysconf_cmd

static TACommandVerdict __sysconf_cmd(TAThread thread,TAInputStream stream){    int name;    long res;    /* Prepare */    name = readInt(&stream);    /* [ Set errno ] */    errno = readInt(&stream);    START_TARGET_OPERATION(thread);    /* Execute */    res = __sysconf(name);    END_TARGET_OPERATION(thread);    /* Response */    writeLong(thread, res);    writeInt(thread, errno);    sendResponse(thread);    return taDefaultVerdict;}
开发者ID:levenkov,项目名称:olver,代码行数:26,


示例19: do_tagging

void chunkArchive::writeString(const char *s){	do_tagging(CHUNK_STRING);	unsigned long size = strlen(s) + 1;	writeLong(size);	writeBlock((const char *) s, size);}
开发者ID:itadinanta,项目名称:emufxtool,代码行数:7,


示例20: fields

void MessageEncoder::writeProperties(const Properties& msg){    size_t fields(optimise ? optimisable(msg) : 13);    if (fields) {        void* token = startList32(&qpid::amqp::message::PROPERTIES);        if (msg.hasMessageId()) writeString(msg.getMessageId());        else writeNull();        if (msg.hasUserId()) writeBinary(msg.getUserId());        else if (fields > 1) writeNull();        if (msg.hasTo()) writeString(msg.getTo());        else if (fields > 2) writeNull();        if (msg.hasSubject()) writeString(msg.getSubject());        else if (fields > 3) writeNull();        if (msg.hasReplyTo()) writeString(msg.getReplyTo());        else if (fields > 4) writeNull();        if (msg.hasCorrelationId()) writeString(msg.getCorrelationId());        else if (fields > 5) writeNull();        if (msg.hasContentType()) writeSymbol(msg.getContentType());        else if (fields > 6) writeNull();        if (msg.hasContentEncoding()) writeSymbol(msg.getContentEncoding());        else if (fields > 7) writeNull();        if (msg.hasAbsoluteExpiryTime()) writeLong(msg.getAbsoluteExpiryTime());        else if (fields > 8) writeNull();        if (msg.hasCreationTime()) writeLong(msg.getCreationTime());        else if (fields > 9) writeNull();        if (msg.hasGroupId()) writeString(msg.getGroupId());        else if (fields > 10) writeNull();        if (msg.hasGroupSequence()) writeUInt(msg.getGroupSequence());        else if (fields > 11) writeNull();        if (msg.hasReplyToGroupId()) writeString(msg.getReplyToGroupId());        else if (fields > 12) writeNull();        endList32(fields, token);    }}
开发者ID:bbcarchdev,项目名称:qpid-cpp,代码行数:47,


示例21: main

int main(int argc, char **argv) {    int magic;    FILE *f;    char tag;    char c;    int i;    long l;    void *p;    char *s;    if (argc != 2) {	fprintf(stderr, "Incorrect number of arguments/n");	exit(1);    }    f = fopen(argv[1], "wb");    if (f == NULL) { 	fprintf(stderr, "Can't open file /"%s/"/n", argv[1]);	exit(1);    }    writeInt(f, 0x01020304);    writeChar(f, 2);    writeInt(f, 0);    writeChar(f, 2);    writeInt(f, 1);    writeString(f, "abcdefghijklmnopqrstuvwxyz");    writeChar(f, 3);    writeInt(f, 4);    writeInt(f, 2);    writeInt(f, 4);    writeInt(f, 6);    writeInt(f, 8);    writeChar(f, 4);    writeInt(f, 2);    writeLong(f, 4);    writeLong(f, -4);    writeChar(f, 5);    writeInt(f, 3);    writePtr(f, (void *)0xfffe0024540);    writePtr(f, (void *)0);    writePtr(f, (void *)0x0fffffffffffff00);    writeChar(f, 2);    writeInt(f, 1);    writeString(f, "zyxwvutsrqponmlkjihgfedcba");    fclose(f);    return 0;}
开发者ID:alista24ftp,项目名称:cpsc261,代码行数:47,


示例22: UserReplyPacket

GetUserTrackReplyPacket::GetUserTrackReplyPacket(const GetUserTrackRequestPacket* req)   : UserReplyPacket(MAX_PACKET_SIZE,                     Packet::PACKETTYPE_GETUSERTRACK_REPLY,                      req){   writeLong(GETUSERTRACK_REPLY_NBRELM_POS, 0);   setLength(GETUSERTRACK_REPLY_NBRELM_POS + 4);}
开发者ID:FlavioFalcao,项目名称:Wayfinder-Server,代码行数:8,


示例23: prime

void prime(){	for (long i = 2; i < 999999; i++) {		if (is_prime(i)) {			writeLong(i);		}	}}
开发者ID:EricMbuthia,项目名称:hh_courses,代码行数:8,


示例24: writeLong

void PacketWriter::reset(){  m_readCursor = m_buffStart;  m_writeCursor = m_buffStart;  // Reserve space for header  writeLong(0);}
开发者ID:4031651,项目名称:ultramysql,代码行数:8,


示例25: writeTree

void writeTree(FILE *file, Tree *t) {    if(t == NULL) return;    writeLong(file, (long)t); // first write the id of this node    writeTreeNode(file, t); // write the node    writeTree(file, t->left); // recursively write the left subtree    writeTree(file, t->right); // recursively write the right subtree}
开发者ID:alista24ftp,项目名称:cpsc261,代码行数:8,


示例26: closeChunk

void chunkArchive::newChunk(unsigned short id){	if (TEST_BIT(status_bits, bCHUNK))		closeChunk();	current_chunk_id = id;	writeShort(id);	writeLong(0);	current_chunk_start = F->pos();	SET_BIT(status_bits, bCHUNK);}
开发者ID:itadinanta,项目名称:emufxtool,代码行数:10,


示例27: file

voidcgicc::CgiEnvironment::save(const std::string& filename) 	const{    std::ofstream file( filename.c_str(), std::ios::binary |std::ios::out );    if( ! file )        throw std::runtime_error("I/O error");    writeLong(file, fContentLength);    writeLong(file, fServerPort);    writeLong(file, (unsigned long) usingHTTPS());    writeString(file, fServerSoftware);    writeString(file, fServerName);    writeString(file, fGatewayInterface);    writeString(file, fServerProtocol);    writeString(file, fRequestMethod);    writeString(file, fPathInfo);    writeString(file, fPathTranslated);    writeString(file, fScriptName);    writeString(file, fQueryString);    writeString(file, fRemoteHost);    writeString(file, fRemoteAddr);    writeString(file, fAuthType);    writeString(file, fRemoteUser);    writeString(file, fRemoteIdent);    writeString(file, fContentType);    writeString(file, fAccept);    writeString(file, fUserAgent);    writeString(file, fRedirectRequest);    writeString(file, fRedirectURL);    writeString(file, fRedirectStatus);    writeString(file, fReferrer);    writeString(file, fCookie);    if(stringsAreEqual(fRequestMethod, "post"))        writeString(file, fPostData);    if(file.bad() || file.fail())        throw std::runtime_error("I/O error");    file.close();}
开发者ID:gechen,项目名称:cgicc,代码行数:43,


示例28: sizeof

void chunkArchive::closeChunk(){	VALIDF;	current_chunk_end = F->pos();	F->seek(current_chunk_start - sizeof(unsigned long));	writeLong(current_chunk_end - current_chunk_start);	F->seek(current_chunk_end);	CLEAR_BIT(status_bits, bCHUNK);	current_chunk_id = 0;}
开发者ID:itadinanta,项目名称:emufxtool,代码行数:10,



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


C++ writeMessage函数代码示例
C++ writeLock函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。