本文整理汇总了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));
}
示例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;
}
示例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;
}
示例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;
}
}