本文整理汇总了C++中SetField函数的典型用法代码示例。如果您正苦于以下问题:C++ SetField函数的具体用法?C++ SetField怎么用?C++ SetField使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetField函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BRow
PropertyRow::PropertyRow(const char* name, const char* value)
: BRow(),
fName(name), fValue(value)
{
SetField(new BStringField(name), kNameColumn);
SetField(new BStringField(value), kValueColumn);
}
示例2: Push
void Push(lua_State *L, GeoPoint value) {
if (value.IsValid()) {
lua_newtable(L);
lua_newtable(L);
SetField(L, -2, "__tostring", l_GeoPoint_tostring);
lua_setmetatable(L, -2);
SetField(L, -2, "longitude", value.longitude);
SetField(L, -2, "latitude", value.latitude);
} else
lua_pushnil(L);
}
示例3: mem
// modify size fields (if present); clear orientation field (if present)
void ExifBlock::ModifySizeFields(CSize img_size, bool clearOrientation)
{
if (exif_buffer.empty() || exif_buffer.size() < offsetIfd0Entries)
return;
MemPointer mem(&exif_buffer.front(), exif_buffer.size());
mem.SetByteOrder(bigEndianByteOrder);
mem += offsetIfd0Entries;
for (uint32 i= 0; i < ifd0Entries; ++i)
{
uint16 tag= mem.GetUInt16();
if (tag == EXIF_IMG_WIDTH || tag == EXIF_IMG_HEIGHT)
{
SetField(mem, tag == EXIF_IMG_WIDTH ? img_size.cx : img_size.cy);
// ModifySize(img_size, tag, mem);
}
else if (tag == EXIF_ORIENTATION)
{
SetField(mem, 1); // 'normal' orientation
}
else if (tag == EXIF_SUB_IFD)
{
uint16 fmt= mem.GetUInt16();
uint32 components= mem.GetUInt32();
uint32 offset= mem.GetUInt32();
// read sub IFD
ptrdiff_t temp= mem.GetPos();
mem.SetPos(ifd0Start + offset);
uint16 entries= mem.GetUInt16(); // no of entries in sub IFD
for (uint32 i= 0; i < entries; ++i)
{
uint16 tag= mem.GetUInt16();
if (tag == EXIF_IMG_WIDTH || tag == EXIF_IMG_HEIGHT)
SetField(mem, tag == EXIF_IMG_WIDTH ? img_size.cx : img_size.cy);
// ModifySize(img_size, tag, mem);
else
mem += 2 + 4 + 4;
}
mem.SetPos(temp);
}
else
mem += 2 + 4 + 4;
}
}
示例4: fResData
ResDataRow::ResDataRow(ResourceData *data)
: fResData(data)
{
if (data) {
SetField(new BStringField(fResData->GetIDString()), 0);
SetField(new TypeCodeField(fResData->GetType(), fResData), 1);
SetField(new BStringField(fResData->GetName()), 2);
BField *field = gResRoster.MakeFieldForType(fResData->GetType(),
fResData->GetData(),
fResData->GetLength());
if (field)
SetField(field, 3);
SetField(new BSizeField(fResData->GetLength()), 4);
}
}
示例5: get_system_info
status_t
TeamRow::_SetTo(TeamInfo* info)
{
fTeamInfo = *info;
app_info appInfo;
status_t status = be_roster->GetRunningAppInfo(fTeamInfo.TeamID(),
&appInfo);
if (status != B_OK) {
// Not an application known to be_roster
if (fTeamInfo.TeamID() == B_SYSTEM_TEAM) {
// Get icon and name from kernel image
system_info systemInfo;
get_system_info(&systemInfo);
BPath kernelPath;
find_directory(B_BEOS_SYSTEM_DIRECTORY, &kernelPath);
kernelPath.Append(systemInfo.kernel_name);
get_ref_for_path(kernelPath.Path(), &appInfo.ref);
} else
BPrivate::get_app_ref(fTeamInfo.TeamID(), &appInfo.ref);
}
BBitmap* icon = new BBitmap(BRect(0, 0, B_MINI_ICON - 1, B_MINI_ICON - 1),
B_RGBA32);
status = BNodeInfo::GetTrackerIcon(&appInfo.ref, icon, B_MINI_ICON);
if (status != B_OK) {
BMimeType genericAppType(B_APP_MIME_TYPE);
status = genericAppType.GetIcon(icon, B_MINI_ICON);
}
if (status != B_OK) {
delete icon;
icon = NULL;
}
BString tmp;
tmp << fTeamInfo.TeamID();
SetField(new BBitmapStringField(icon, fTeamInfo.Arguments()), kNameColumn);
SetField(new BStringField(tmp), kIDColumn);
return status;
}
示例6: SetField
static inline void
SetField(lua_State *L, const char *package, const char *name, V &&value)
{
lua_getglobal(L, package);
SetField(L, -2, name, value);
lua_pop(L, 1);
}
示例7: lua_getglobal
void
Lua::InitLegacy(lua_State *L)
{
lua_getglobal(L, "xcsoar");
SetField(L, -2, "fire_legacy_event", l_fire_legacy_event);
lua_pop(L, 1);
}
示例8: path
void
HEventRow::SetPath(const char* _path)
{
fPath = _path;
BPath path(_path);
SetField(new BStringField(_path ? path.Leaf() : "<none>"), kSoundColumn);
}
示例9: SetField
void emMinesFileModel::OpenField(int x, int y, int z, bool saveFile)
{
int x1,y1,z1,x2,y2,z2,f;
f=GetField(x,y,z);
if ((f&2)!=0) return;
f|=2;
f&=~4;
SetField(x,y,z,f);
if (GetSurroundings(x,y,z)==0) {
z1=z-1; if (z1<0) z1=0;
z2=z+2; if (z2>SizeZ) z2=SizeZ;
y1=y-1; if (y1<0) y1=0;
y2=y+2; if (y2>SizeY) y2=SizeY;
x1=x-1; if (x1<0) x1=0;
x2=x+2; if (x2>SizeX) x2=SizeX;
for (z=z1; z<z2; z++) {
for (y=y1; y<y2; y++) {
for (x=x1; x<x2; x++) {
OpenField(x,y,z,false);
}
}
}
}
if (saveFile) Save(true);
}
示例10: SetField
void SOMReader::Fill(const QColor &color) {
for(unsigned int y = 0; y < m_iHeight; y++) {
for(unsigned int x = 0; x < m_iWidth; x++) {
SetField(QPoint(x, y), color);
}
}
}
示例11: BRow
ShortcutsSpec::ShortcutsSpec(BMessage* from)
:
BRow(),
fCommand(NULL),
fBitmap(ICON_BITMAP_RECT, ICON_BITMAP_SPACE),
fLastBitmapName(NULL),
fBitmapValid(false),
fCursorPtsValid(false)
{
const char* temp;
if (from->FindString("command", &temp) != B_NO_ERROR) {
printf(CLASS);
printf(" Error, no command string in archive BMessage!\n");
temp = "";
}
SetCommand(temp);
if (from->FindInt32("key", (int32*) &fKey) != B_NO_ERROR) {
printf(CLASS);
printf(" Error, no key int32 in archive BMessage!\n");
}
for (int i = 0; i < NUM_META_COLUMNS; i++)
if (from->FindInt32("mcidx", i, (int32*)&fMetaCellStateIndex[i])
!= B_NO_ERROR) {
printf(CLASS);
printf(" Error, no modifiers int32 in archive BMessage!\n");
}
for (int i = 0; i <= STRING_COLUMN_INDEX; i++)
SetField(new BStringField(GetCellText(i)), i);
}
示例12: SetField
bool CXmlUtil::SetFieldBool(const XMLDOMDocumentPtr& doc,
const XMLDOMElementPtr& ele,
const wchar_t* filename,
BOOL value)
{
return SetField(doc, ele, filename, value ? L"true" : L"false");
}
示例13: SetField
void Mesg::SetFields(const Mesg& mesg)
{
if (mesg.GetNum() != GetNum())
return;
for (int i=0; i < (int)mesg.fields.size(); i++)
SetField(mesg.fields[i]);
}
示例14: BRow
HEventRow::HEventRow(const char* name, const char* path)
:
BRow(),
fName(name)
{
SetField(new BStringField(name), kEventColumn);
SetPath(path);
}
示例15: SetField
void
PackageRow::UpdateSize()
{
if (fPackage.Get() == NULL)
return;
SetField(new SizeField(fPackage->Size()), kSizeColumn);
}