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


C++ StringWriter::write方法代码示例

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


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

示例1: startCell

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startCell ()
{
	if (!checkState (kInCell))
		return false;

	StringWriter writer (stream);
	String string;
	string.printf ("%s", START_TAG_STRING(CELL_TAG));
	writer.write (string);
	writer.write (ENDLINE_A);

	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:14,代码来源:vstrepresentation.cpp

示例2: endLayer

//------------------------------------------------------------------------
bool XmlRepresentationHelper::endLayer ()
{
	if (!checkState (kInCell))
		return false;

	StringWriter writer (stream);
	String string;
	string.printf ("%s", END_TAG_STRING(LAYER_TAG));
	writer.write (string);
	writer.write (ENDLINE_A);

	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:14,代码来源:vstrepresentation.cpp

示例3: startEndCell

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startEndCell ()
{
	if (!checkState (kInCell))
		return false;

	StringWriter writer (stream);
	String string;
	string.printf ("<%s/>", CELL_TAG);
	writer.write (string);
	writer.write (ENDLINE_A);

	if (!checkState (kInPage))
		return false;
	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:16,代码来源:vstrepresentation.cpp

示例4: startPage

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startPage (FIDString name, int32 unitID)
{
	if (!checkState (kInPage))
		return false;

	StringWriter writer (stream);
	String string;
	if (unitID != -1)
		string.printf ("<%s %s=\"%s\" %s=\"%d\">", PAGE_TAG, ATTR_NAME, name, ATTR_UNITID, unitID);
	else
		string.printf ("<%s %s=\"%s\">", PAGE_TAG, ATTR_NAME, name);
	writer.write (string);
	writer.write (ENDLINE_A);

	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:17,代码来源:vstrepresentation.cpp

示例5: writer

//------------------------------------------------------------------------
XmlRepresentationHelper::~XmlRepresentationHelper ()
{
	if (state == kInLayer)
		endLayer ();
	if (state == kInCell)
		endCell ();
	if (state == kInPage)
		endPage ();

	StringWriter writer (stream);
	String string;
	
	// end representation
	string.printf ("\t%s", END_TAG_STRING(REPRESENTATION_TAG));
	writer.write (string);
	writer.write (ENDLINE_A);

	// end piper
	writer.write (END_TAG_STRING(ROOTXML_TAG));
	writer.write (ENDLINE_A);
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:22,代码来源:vstrepresentation.cpp

示例6: sw

void * send_request(void * gg){
	Socket s = Socket("localhost",80);
	StringWriter sw ( s.getOutputStream() );
	StringReader sr ( s.getInputStream() );
	struct timeval start,end;
	static char * request =
		"GET /index.html HTTP/1.1\n"
		"Host: oink\n\n";
	gettimeofday( &start , NULL );
	sw.write( request );
	sr.readLine();
	gettimeofday( &end , NULL );
	long long val = 
		(long long)
		( end.tv_sec - start.tv_sec) * 1000000L +
		( end.tv_usec - start.tv_usec);
	update_times( (int) val);
	--thread_count;
}
开发者ID:priyananda,项目名称:student,代码行数:19,代码来源:heavy.cpp

示例7: startLayer

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startLayer (int32 type, int32 id, FIDString _function, FIDString style, bool ended)
{
	if (!checkState (kInLayer))
		return false;

	StringWriter writer (stream);
	String string;

	string.printf ("<%s %s=\"%s\" %s=\"%d\"", LAYER_TAG, ATTR_TYPE, Vst::LayerType::layerTypeFIDString[type], ATTR_PARAMID, id);
	writer.write (string);

	if (_function)
	{
		string.printf (" %s=\"%s\"", Vst::Attributes::kFunction, _function);
		writer.write (string);
	}
	if (style)
	{
		string = Vst::LayerType::layerTypeFIDString[type];
		if (type == Vst::LayerType::kSwitch)
			string.printf (" %s=\"%s\"", Vst::Attributes::kSwitchStyle, style);
		else if (type == Vst::LayerType::kLED)
			string.printf (" %s=\"%s\"", Vst::Attributes::kLEDStyle, style);
		else
			string.printf (" %s=\"%s\"",  Vst::Attributes::kStyle, style);
		writer.write (string);
	}

	if (ended)
	{
		writer.write ("/>");
		if (!checkState (kInCell))
			return false;
	}
	else
		writer.write (">");
	writer.write (ENDLINE_A);

	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:41,代码来源:vstrepresentation.cpp

示例8: startEndTitleDisplay

//------------------------------------------------------------------------
bool XmlRepresentationHelper::startEndTitleDisplay (Vst::ParameterInfo& info)
{
	String nameString (info.title);

	if (nameString.isEmpty ())
		return false;

	if (!checkState (kInTitleDisplay))
		return false;

	StringWriter writer (stream);
	String string;

	string.printf ("<%s>", TITLEDISPLAY_TAG);
	writer.write (string);
	writer.write (ENDLINE_A);

	// start of name scope

	if (!checkState (kInName))
	{
		string.printf ("%s", END_TAG_STRING (TITLEDISPLAY_TAG));
		writer.write (string);
		writer.write (ENDLINE_A);
		return false;
	}
	
	string.printf ("<%s>%s</%s>", NAME_TAG, nameString.text8 (), NAME_TAG);
	writer.write (string);
	writer.write (ENDLINE_A);
	
	if (nameString.length () > MEDIUM_TITLE_LIMIT)
	{
		nameString.assign (info.shortTitle);

		if (! nameString.isEmpty ())
		{
			nameString.removeChars ();							// remove space

			if (nameString.length () > MEDIUM_TITLE_LIMIT)
				nameString.remove (MEDIUM_TITLE_LIMIT);			// Trimming the rest to get a short string

			string.printf ("<%s>%s</%s>", NAME_TAG, nameString.text8 (), NAME_TAG);
			writer.write (string);
			writer.write (ENDLINE_A);
		}
	}

	if (nameString.length () > SHORT_TITLE_LIMIT)
	{
		nameString.remove (SHORT_TITLE_LIMIT);					// Trimming the rest to get a short string

		string.printf ("<%s>%s</%s>", NAME_TAG, nameString.text8 (), NAME_TAG);
		writer.write (string);
		writer.write (ENDLINE_A);
	}

	if (!checkState (kInTitleDisplay))
		return false;

	// end of name scope

	string.printf ("%s", END_TAG_STRING (TITLEDISPLAY_TAG));
	writer.write (string);
	writer.write (ENDLINE_A);

	if (!checkState (kInLayer))
		return false;

	return true;
}
开发者ID:KennyWZhang,项目名称:RenderMan,代码行数:72,代码来源:vstrepresentation.cpp

示例9: print

static size_t print(StringWriter& sb, const char* s) {
  return sb.write(reinterpret_cast<const uint8_t*>(s), strlen(s));
}
开发者ID:ericbarch,项目名称:arduino-libraries,代码行数:3,代码来源:StringWriter.cpp


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