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

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

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

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

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

示例1: writeCString

void VerticalRowOutputStream::writeSpecialRow(const Block & block, size_t row_num, const char * title){    writeCString("/n", ostr);    row_number = 0;    field_number = 0;    size_t columns = block.columns();    writeCString(title, ostr);    writeCString(":/n", ostr);    size_t width = strlen(title) + 1;    for (size_t i = 0; i < width; ++i)        writeCString("─", ostr);    writeChar('/n', ostr);    for (size_t i = 0; i < columns; ++i)    {        if (i != 0)            writeFieldDelimiter();        auto & col = block.getByPosition(i);        writeField(*col.column, *col.type, row_num);    }}
开发者ID:kellylg,项目名称:ClickHouse,代码行数:26,


示例2: writeNStringP

/** * Writes a null terminated string from flash program memory to UART. * You can use the macro writeString_P(STRING); , this macro * ensures that the String is stored in program memory only! * Otherwise you need to use PSTR("your string") from AVRLibC for this. * * Example: * *			writeNStringP(PSTR("Robotarm System/n")); * *			// There is also a Macro that makes life easier and *			// you can simply write: *			writeString_P("Robot ARm System/n"); * */void writeNStringP(const char *pstring){    uint8_t c;    for (;(c = pgm_read_byte_near(pstring++));writeChar(c));}
开发者ID:ulrichard,项目名称:robotloader,代码行数:22,


示例3: wb

String FieldVisitorToString::operator() (const Array & x) const{    String res;    WriteBufferFromString wb(res);    writeChar('[', wb);    for (Array::const_iterator it = x.begin(); it != x.end(); ++it)    {        if (it != x.begin())            wb.write(", ", 2);        writeString(applyVisitor(*this, *it), wb);    }    writeChar(']', wb);    return res;}
开发者ID:yurial,项目名称:ClickHouse,代码行数:16,


示例4: writeChar

void TabSeparatedRowOutputStream::writeExtremes(){	if (extremes)	{		size_t rows = extremes.rows();		size_t columns = extremes.columns();		writeChar('/n', ostr);		for (size_t i = 0; i < rows; ++i)		{			if (i != 0)				writeRowBetweenDelimiter();			writeRowStartDelimiter();			for (size_t j = 0; j < columns; ++j)			{				if (j != 0)					writeFieldDelimiter();				writeField(*extremes.unsafeGetByPosition(j).column.get(), *extremes.unsafeGetByPosition(j).type.get(), i);			}			writeRowEndDelimiter();		}	}}
开发者ID:maniacs-db,项目名称:ClickHouse,代码行数:27,


示例5: ss

void FTPClient::storData(std::string param){    int32_t ch;    std::ifstream in;    std::string token, reply;    std::stringstream ss(param);    // arg may be a ',' seperated list of arguments.    while ( getline(ss, token, ','/* DELIMITER */) )    {        // Establish Data Connection        dataConnect();        //########## Send file character by character ############        in.open(token.c_str(),std::ifstream::in);        ch = in.get();        while ( in.good() )        {            //#TODO if the file contains NULL character.            writeChar(this->datafd, (char)ch);            ch = in.get();        }        //#######################################################        in.close();        // Close Data Connection (Indicates EOF )        close(this->datafd);        // Create a new data socket for FUTURE.        createDataSock();    }}
开发者ID:khatribharat,项目名称:SimpleFTPServer,代码行数:31,


示例6: wakeSensors

//	4.3	- this function sends out the characters of the String cmd, one by onevoid SDI12::sendCommand(String cmd){  wakeSensors();							// wake up sensors  for (int i = 0; i < cmd.length(); i++){	writeChar(cmd[i]); 						// write each characters  }	  setState(LISTENING); 						// listen for reply}
开发者ID:Kevin-M-Smith,项目名称:Arduino-SDI-12,代码行数:8,


示例7: MQTTSNSerialize_register

/**  * Serializes the supplied register data into the supplied buffer, ready for sending  * @param buf the buffer into which the packet will be serialized  * @param buflen the length in bytes of the supplied buffer  * @param topicid if sent by a gateway, contains the id for the topicname, otherwise 0  * @param packetid integer - the MQTT packet identifier  * @param topicname null-terminated topic name string  * @return the length of the serialized data.  <= 0 indicates error  */int MQTTSNSerialize_register(unsigned char* buf, int buflen, unsigned short topicid, unsigned short packetid,		MQTTSNString* topicname){	unsigned char *ptr = buf;	int len = 0;	int rc = 0;	int topicnamelen = 0;	FUNC_ENTRY;	topicnamelen = (topicname->cstring) ? strlen(topicname->cstring) : topicname->lenstring.len;	if ((len = MQTTSNPacket_len(MQTTSNSerialize_registerLength(topicnamelen))) > buflen)	{		rc = MQTTSNPACKET_BUFFER_TOO_SHORT;		goto exit;	}	ptr += MQTTSNPacket_encode(ptr, len);  /* write length */	writeChar(&ptr, MQTTSN_REGISTER);      /* write message type */	writeInt(&ptr, topicid);	writeInt(&ptr, packetid);	memcpy(ptr, (topicname->cstring) ? topicname->cstring : topicname->lenstring.data, topicnamelen);	ptr += topicnamelen;	rc = ptr - buf;exit:	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:lucasmarwagner,项目名称:emb-6_dtls,代码行数:38,


示例8: writeString

void writeString(char * string, int length) {	int i;	for (i = 0; i < length; i++) {		writeChar(string[i]);	}}
开发者ID:JahwnMallard,项目名称:MSP430_LCDdriver,代码行数:7,


示例9: MQTTSerialize_unsuback

/**  * Serializes the supplied unsuback data into the supplied buffer, ready for sending  * @param buf the buffer into which the packet will be serialized  * @param buflen the length in bytes of the supplied buffer  * @param packetid integer - the MQTT packet identifier  * @return the length of the serialized data.  <= 0 indicates error  */int MQTTSerialize_unsuback(char* buf, int buflen, int packetid){	MQTTHeader header;	int rc = 0;	char *ptr = buf;	FUNC_ENTRY;	if (buflen < 2)	{		rc = MQTTPACKET_BUFFER_TOO_SHORT;		goto exit;	}	header.byte = 0;	header.bits.type = UNSUBACK;	writeChar(&ptr, header.byte); /* write header */	ptr += MQTTPacket_encode(ptr, 2); /* write remaining length */	writeInt(&ptr, packetid);	rc = ptr - buf;exit:	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:rjacolin,项目名称:MQTTOpenATSample,代码行数:32,


示例10: write

/* Blocking write to STDIN */int write(char * buf, int len){	int i;	for(i = 0; i < len; i++)		writeChar(buf[i]);	return len;}
开发者ID:adrianj,项目名称:Plasma,代码行数:8,


示例11: writeChar

void JSONRowOutputStream::writeRowEndDelimiter(){    writeChar('/n', *ostr);    writeCString("/t/t}", *ostr);    field_number = 0;    ++row_count;}
开发者ID:yurial,项目名称:ClickHouse,代码行数:7,


示例12: createFontAtlas

void createFontAtlas(u8 *buffer, u32 width, u32 height){  // write entire font set to buffer  u32 x = 1;  u32 y = 1;  u32 char_width  = s_glyph_width + 1;  u32 char_height = s_glyph_height + 1;  for (u32 c = 32; c < 127; ++c, x += char_width)   {    // if at end of buffer, go to next line    if ((width - x) < char_width)     {      x = 1;      y += char_height;    }    // stop at end of buffer    if ((height - y) < char_height)     {      break;    }    // write char to buffer     writeChar(c, &buffer[(y * width) + x], width, 255);  }}
开发者ID:papaver,项目名称:nektar,代码行数:26,


示例13: MQTTSPacket_send_willTopic

int MQTTSPacket_send_willTopic(Clients* client){	char *buf, *ptr;	MQTTS_WillTopic packet;	int rc, len;	FUNC_ENTRY;	len = 1 + strlen(client->will->topic);	ptr = buf = malloc(len);	packet.header.type = MQTTS_WILLTOPIC;	packet.header.len = len+2;	packet.flags.all = 0;	packet.flags.QoS = client->will->qos;	packet.flags.retain = client->will->retained;	writeChar(&ptr, packet.flags.all);	memcpy(ptr, client->will->topic, len-1);	rc = MQTTSPacket_send(client, packet.header, buf, len);	free(buf);	Log(LOG_PROTOCOL, 44, NULL, client->socket, client->addr, client->clientID,			client->will->qos, client->will->retained, client->will->topic, rc);	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:Frank-KunLi,项目名称:rsmb,代码行数:28,


示例14: MQTTSPacket_send_subscribe

int MQTTSPacket_send_subscribe(Clients* client, char* topicName, int qos, int msgId){	MQTTS_Subscribe packet;	int rc = 0;	char *buf, *ptr;	int datalen = 3 + strlen(topicName);	FUNC_ENTRY;	packet.header.len = datalen+2;	packet.header.type = MQTTS_SUBSCRIBE;	/* TODO: support TOPIC_TYPE_PREDEFINED/TOPIC_TYPE_SHORT */	packet.flags.all = 0;	packet.flags.topicIdType = MQTTS_TOPIC_TYPE_NORMAL;	packet.flags.QoS = qos;	ptr = buf = malloc(datalen);	writeChar(&ptr, packet.flags.all);	writeInt(&ptr, msgId);	memcpy(ptr, topicName, strlen(topicName));	rc = MQTTSPacket_send(client, packet.header, buf, datalen);	free(buf);	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:Frank-KunLi,项目名称:rsmb,代码行数:28,


示例15: I2C_transmissionError

/** * This function gets called automatically if there was an I2C Error like * the slave sent a "not acknowledge" (NACK, error codes e.g. 0x20 or 0x30). */void I2C_transmissionError(uint8_t errorState){	writeString_P("/n############ I2C ERROR!!!!! - TWI STATE: 0x");	writeInteger(errorState, HEX);	writeChar('/n');	errors++;}
开发者ID:b3nzchr3ur,项目名称:rp6,代码行数:11,


示例16: MQTTSPacket_send_puback

int MQTTSPacket_send_puback(Clients* client, /*char* shortTopic, */ int topicId, int msgId, char returnCode){	MQTTS_PubAck packet;	char *buf, *ptr;	int rc = 0;	int datalen = 5;	FUNC_ENTRY;	packet.header.len = 7;	packet.header.type = MQTTS_PUBACK;	ptr = buf = malloc(datalen);	/*if (shortTopic)	{		writeChar(&ptr, shortTopic[0]);		writeChar(&ptr, shortTopic[1]);	}	else */	writeInt(&ptr, topicId);	writeInt(&ptr, msgId);	writeChar(&ptr, returnCode);	rc = MQTTSPacket_send(client, packet.header, buf, datalen);	free(buf);	Log(LOG_PROTOCOL, 56, NULL, socket, client->addr, client->clientID, msgId, topicId, returnCode, rc);	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:Frank-KunLi,项目名称:rsmb,代码行数:29,


示例17: writeString

void writeString(char* strg2Write){	//goes to the null character at the end of the pointer	while(*strg2Write != 0){		writeChar(*strg2Write);		strg2Write++;	}}
开发者ID:jasonmossing15,项目名称:LCD_Libraries,代码行数:7,


示例18: writeUnsignedByte

void writeUnsignedByte(int value){        if (value < 0 || value > 255)		{			LOG_E(OMG, " Storage::writeUnsignedByte(): Invalid value, not in [0, 255]/n");		}		writeChar( ((unsigned char)value));}
开发者ID:mspublic,项目名称:openair4G-mirror,代码行数:7,


示例19: writeChar

void Modem::abortXModem(){    timer->stop();    writeChar(CCAN);    xreset();    emit xmodemDone(false);}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:7,


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


示例21: kdDebug

void Modem::writeLine(const char *line){    kdDebug() << "Modem::writeLine(): " << line << endl;    write(fd, (const void *) line, strlen(line));    writeChar('/r');}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:7,


示例22: in

void FileChecker::load(Map & map) const{	map.clear();	if (!Poco::File(files_info_path).exists())		return;	std::string content;	{		ReadBufferFromFile in(files_info_path);		WriteBufferFromString out(content);		/// Библиотека JSON не поддерживает пробельные символы. Удаляем их. Неэффективно.		while (!in.eof())		{			char c;			readChar(c, in);			if (!isspace(c))				writeChar(c, out);		}	}	JSON json(content);	JSON files = json["yandex"];	for (const auto & name_value : files)		map[unescapeForFileName(name_value.getName())] = name_value.getValue()["size"].toUInt();}
开发者ID:Aahart911,项目名称:ClickHouse,代码行数:27,


示例23: write

		boolean write(uint8_t num) {			if(num < 17) {				writeChar(num);				return true;			}			return false;		}
开发者ID:manasdas17,项目名称:iotduino,代码行数:7,


示例24: writeString

void JSONEachRowRowOutputStream::writeField(const IColumn & column, const IDataType & type, size_t row_num){	writeString(fields[field_number], ostr);	writeChar(':', ostr);	type.serializeTextJSON(column, row_num, ostr);	++field_number;}
开发者ID:Aahart911,项目名称:ClickHouse,代码行数:7,


示例25: MQTTPacket_send_subscribe

/** * Send an MQTT subscribe packet down a socket. * @param topics list of topics * @param qoss list of corresponding QoSs * @param msgid the MQTT message id to use * @param dup boolean - whether to set the MQTT DUP flag * @param socket the open socket to send the data to * @param clientID the string client identifier, only used for tracing * @return the completion code (e.g. TCPSOCKET_COMPLETE) */int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, int socket, char* clientID){	Header header;	char *data, *ptr;	int rc = -1;	ListElement *elem = NULL, *qosElem = NULL;	int datalen;	FUNC_ENTRY;	header.bits.type = SUBSCRIBE;	header.bits.dup = dup;	header.bits.qos = 1;	header.bits.retain = 0;	datalen = 2 + topics->count * 3; // utf length + char qos == 3	while (ListNextElement(topics, &elem))		datalen += strlen((char*)(elem->content));	ptr = data = malloc(datalen);	writeInt(&ptr, msgid);	elem = NULL;	while (ListNextElement(topics, &elem))	{		ListNextElement(qoss, &qosElem);		writeUTF(&ptr, (char*)(elem->content));		writeChar(&ptr, *(int*)(qosElem->content));	}	rc = MQTTPacket_send(socket, header, data, datalen);	Log(LOG_PROTOCOL, 22, NULL, socket, clientID, msgid, rc);	free(data);	FUNC_EXIT_RC(rc);	return rc;}
开发者ID:Frank-KunLi,项目名称:rsmb,代码行数:43,


示例26: writeByte

void writeByte(int value){        if (value < -128 || value > 127)		{			LOG_E(OMG, " Storage::writeByte(): Invalid value, not in [-128, 127]/n");		}		writeChar( (unsigned char)( (value+256) % 256 ) );}
开发者ID:mspublic,项目名称:openair4G-mirror,代码行数:7,


示例27: FilterRequestData

extern void FilterRequestData(REQUEST_STRUCT* request, char request_buffer[], size_t separatorindex, size_t startindex, size_t endindex){	if((separatorindex - startindex) > 0 && (endindex - separatorindex) > 2 && request != NULL)	{					char cmdbuffer[(separatorindex - startindex)+1];		strncpy(cmdbuffer, request_buffer+startindex, ((separatorindex - startindex)+1));				static char* proper_keys[2] = {"cmd", "val"};		int index = -1;				for(uint8_t i = 0; i < 2;i++)		{			if(strncmp(cmdbuffer, proper_keys[i], strlen(proper_keys[i])) == 0)			{	 							index = i;				break;			}		}				switch(index)		{			case 0://CMD			{				uint16_t length = (endindex-separatorindex+1);								if(length > 0)				{				//									char filtervalue [length];					strncpy(filtervalue, request_buffer+(separatorindex+1), length);										uint16_t value = strtol(filtervalue, NULL, 0);												writeString("{cmd=0x");						writeInteger(value, HEX);						writeChar('}');												(*request).cmd = value;				}				//				break;			}			case 1: //VAL			{				//								char filtervalue [(endindex-separatorindex)+1];				strncpy(filtervalue, request_buffer+(separatorindex+1), (endindex-separatorindex+1));								if(strlen(filtervalue) > 0)				{					uint16_t value = strtol(filtervalue, NULL, 0);					(*request).val = value;				}				//				break;			}		}	}}
开发者ID:yopspanjers,项目名称:ftg-main,代码行数:59,


示例28: while

//Function to Print String on LCDvoid LCD::print(char *str){	while(*str != '/0')	{		writeChar(*str);		str++;	}}
开发者ID:Jenil10,项目名称:CS101_MorseCodeDecoder,代码行数:9,


示例29: writeString

void AnalyzeLambdas::dump(WriteBuffer & out) const{    for (const auto & ast : higher_order_functions)    {        writeString(ast->getColumnName(), out);        writeChar('/n', out);    }}
开发者ID:bamx23,项目名称:ClickHouse,代码行数:8,



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


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