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


C++ AppServerLink::ReadString方法代码示例

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


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

示例1: sizeof

void
BFont::GetFamilyAndStyle(font_family* family, font_style* style) const
{
	if (family == NULL && style == NULL)
		return;

	// it's okay to call this function with either family or style set to NULL

	font_family familyBuffer;
	font_style styleBuffer;

	if (family == NULL)
		family = &familyBuffer;
	if (style == NULL)
		style = &styleBuffer;

	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_FAMILY_AND_STYLE);
	link.Attach<uint16>(fFamilyID);
	link.Attach<uint16>(fStyleID);

	int32 code;
	if (link.FlushWithReply(code) != B_OK || code != B_OK) {
		// the least we can do is to clear the buffers
		memset(*family, 0, sizeof(font_family));
		memset(*style, 0, sizeof(font_style));
		return;
	}

	link.ReadString(*family, sizeof(font_family));
	link.ReadString(*style, sizeof(font_style));
}
开发者ID:looncraz,项目名称:haiku,代码行数:32,代码来源:Font.cpp

示例2:

/*!	\brief queries the server for the current decorator
	\param ref entry_ref into which to store current decorator's location
	\return boolean true/false
*/
bool
get_decorator(BString& path)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_DECORATOR);

	int32 code;
	if (link.FlushWithReply(code) != B_OK || code != B_OK)
		return false;

 	return link.ReadString(path) == B_OK;
}
开发者ID:royalharsh,项目名称:haiku,代码行数:16,代码来源:InterfaceDefs.cpp

示例3:

/*!	\brief queries the server for the name of the decorator with a certain index
	\param index The index of the decorator to get the name for
	\param name BString to receive the name of the decorator
	\return B_OK if successful, B_ERROR if not
*/
status_t
get_decorator_name(const int32 &index, BString &name)
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_DECORATOR_NAME);
	link.Attach<int32>(index);

	int32 code;
	if (link.FlushWithReply(code) == B_OK && code == B_OK) {
		char *string;
		if (link.ReadString(&string) == B_OK) {
			name = string;
			free(string);
			return B_OK;
		}
	}

	return B_ERROR;
}
开发者ID:mmanley,项目名称:Antares,代码行数:24,代码来源:InterfaceDefs.cpp

示例4: if

void
_init_global_fonts_()
{
	BPrivate::AppServerLink link;
	link.StartMessage(AS_GET_SYSTEM_FONTS);

	int32 code;
	if (link.FlushWithReply(code) != B_OK
		|| code != B_OK) {
		printf("DEBUG: Couldn't initialize global fonts!\n");
		return;
	}

	char type[B_OS_NAME_LENGTH];

	while (link.ReadString(type, sizeof(type)) >= B_OK && type[0]) {
		BFont dummy;
		BFont* font = &dummy;

		if (!strcmp(type, "plain"))
			font = &sPlainFont;
		else if (!strcmp(type, "bold"))
			font = &sBoldFont;
		else if (!strcmp(type, "fixed"))
			font = &sFixedFont;

		link.Read<uint16>(&font->fFamilyID);
		link.Read<uint16>(&font->fStyleID);
		link.Read<float>(&font->fSize);
		link.Read<uint16>(&font->fFace);
		link.Read<uint32>(&font->fFlags);

		font->fHeight.ascent = kUninitializedAscent;
		font->fExtraFlags = kUninitializedExtraFlags;
	}
}
开发者ID:looncraz,项目名称:haiku,代码行数:36,代码来源:Font.cpp


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