本文整理匯總了C++中GetField函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetField函數的具體用法?C++ GetField怎麽用?C++ GetField使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetField函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: IMPORT_LOG0
/*
This is where the real work happens!
Go through the field map and set the data in a new database row
*/
nsresult nsTextAddress::ProcessLine(const nsAString &aLine, nsString& errors)
{
if (!m_fieldMap) {
IMPORT_LOG0("*** Error, text import needs a field map\n");
return NS_ERROR_FAILURE;
}
nsresult rv;
// Wait until we get our first non-empty field, then create a new row,
// fill in the data, then add the row to the database.
nsCOMPtr<nsIMdbRow> newRow;
nsAutoString fieldVal;
int32_t fieldNum;
int32_t numFields = 0;
bool active;
rv = m_fieldMap->GetMapSize(&numFields);
for (int32_t i = 0; (i < numFields) && NS_SUCCEEDED(rv); i++) {
active = false;
rv = m_fieldMap->GetFieldMap(i, &fieldNum);
if (NS_SUCCEEDED(rv))
rv = m_fieldMap->GetFieldActive(i, &active);
if (NS_SUCCEEDED(rv) && active) {
if (GetField(aLine, i, fieldVal, m_delim)) {
if (!fieldVal.IsEmpty()) {
if (!newRow) {
rv = m_database->GetNewRow(getter_AddRefs(newRow));
if (NS_FAILED(rv)) {
IMPORT_LOG0("*** Error getting new address database row\n");
}
}
if (newRow) {
rv = m_fieldMap->SetFieldValue(m_database, newRow, fieldNum, fieldVal.get());
}
}
}
else
break;
}
else if (active) {
IMPORT_LOG1("*** Error getting field map for index %ld\n", (long) i);
}
}
if (NS_SUCCEEDED(rv) && newRow)
rv = m_database->AddCardRowToDB(newRow);
return rv;
}
示例2: ProcessFieldAnim
void ProcessFieldAnim(int x, int y)
{
int oldt, t;
TSprite *s;
int rx, ry, drawx, drawy;
t = oldt = GetField(x, y)->Terrain2;
t = CycleF(t, 389, 390, 900, 901, 902, 903, 904, 905);
t = CycleF(t, 391, 392, 906, 907, 908, 909, 910, 911);
t = CycleF(t, 395, 396, 397, 912, 913, 914, 915, 916);
t = CycleF(t, 398, 399, 400, 918, 919, 920, 921, 922);
if (t != oldt) {
PlaceL2(x, y, t, 1);
s = (TSprite*)(BmpTerr2[GetField(x, y)->Terrain2]);
if (s) {
rx = GetRelX(x), ry = GetRelY(y);
drawx = 28 * (rx - ry) + 28;
drawy = 14 * (rx + ry - (GetField(x, y)->Height)) + 14;
StartDraw(drawx - s->dx, drawy - s->dy, s->w, s->h);
PaintUnits();
EndDraw();
}
}
}
示例3: IsHeartRateLocalDeviceTypeValid
///////////////////////////////////////////////////////////////////////
// Checks the validity of heart_rate_local_device_type field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsHeartRateLocalDeviceTypeValid() const
{
const Field* field = GetField(20);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
if( !CanSupportSubField( field, (FIT_UINT16) Profile::DIVE_SETTINGS_MESG_HEART_RATE_SOURCE_FIELD_HEART_RATE_LOCAL_DEVICE_TYPE ) )
{
return FIT_FALSE;
}
return field->IsValueValid(0, (FIT_UINT16) Profile::DIVE_SETTINGS_MESG_HEART_RATE_SOURCE_FIELD_HEART_RATE_LOCAL_DEVICE_TYPE);
}
示例4: GetField
const FIT_UINT16 Profile::GetSubFieldIndex(const std::string& mesgName, const std::string& fieldName, const std::string& subFieldName)
{
const FIELD *field = GetField(mesgName, fieldName);
if (field == NULL)
return FIT_SUBFIELD_INDEX_MAIN_FIELD;
for (FIT_UINT16 i = 0; i < field->numSubFields; i++)
{
if (field->subFields[i].name == subFieldName)
return i;
}
return FIT_SUBFIELD_INDEX_MAIN_FIELD;
}
示例5: while
void MainWindow::onLoadTareas()
{
addingTarea_ = true;
while (ui->tblTareas->rowCount())
ui->tblTareas->removeRow(0);
//Obtenemos las tareas
QSqlQuery q = db_.exec("SELECT * "
"FROM tareas "
"WHERE id_categ = " + ui->comboCategoria->currentData().toString());
while (q.next()) {
//Añadimos la tarea a la tabla de categorias
int rowNumber = ui->tblTareas->rowCount();
int id = GetField(q, "id").toInt();
ui->tblTareas->insertRow(rowNumber);
QTableWidgetItem* item = new QTableWidgetItem(GetField(q, "name").toString());
item->setData(Qt::UserRole, id);
ui->tblTareas->setItem(rowNumber, 0, item);
ui->tblTareas->setItem(rowNumber, 1, new QTableWidgetItem(GetField(q, "date").toString()));
item = new QTableWidgetItem("");
item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
if (GetField(q, "done").toInt())
item->setCheckState(Qt::Checked);
else
item->setCheckState(Qt::Unchecked);
ui->tblTareas->setItem(rowNumber, 2, item);
}
//Activamos el sorting en la tabla de categorias
ui->tblTareas->setSortingEnabled(true);
addingTarea_ = false;
}
示例6: FieldTurnEnd
void FieldTurnEnd(int x, int y)
{
int oldt, t;
int anim = 1;
t = oldt = GetField(x, y)->Terrain2;
t = DegradeF(t, 401, 398, 399, 400, 918, 919, 920, 921, 922);
t = DegradeF(t, 398, 395, 396, 397, 912, 913, 914, 915, 916);
t = DegradeF(t, 393, 391, 392, 906, 907, 908, 909, 910, 911);
t = DegradeF(t, 391, 389, 390, 900, 901, 902, 903, 904, 905);
if (t != oldt) {
if ((t == 401) || (t == 393)) anim = 0;
PlaceL2(x, y, t, anim);
}
}
示例7: IsAnalogLayoutValid
///////////////////////////////////////////////////////////////////////
// Checks the validity of analog_layout field
// Returns FIT_TRUE if field is valid
///////////////////////////////////////////////////////////////////////
FIT_BOOL IsAnalogLayoutValid() const
{
const Field* field = GetField(1);
if( FIT_NULL == field )
{
return FIT_FALSE;
}
if( !CanSupportSubField( field, (FIT_UINT16) Profile::WATCHFACE_SETTINGS_MESG_LAYOUT_FIELD_ANALOG_LAYOUT ) )
{
return FIT_FALSE;
}
return field->IsValueValid(0, (FIT_UINT16) Profile::WATCHFACE_SETTINGS_MESG_LAYOUT_FIELD_ANALOG_LAYOUT);
}
示例8: AssignResult5
int AssignResult5 ()
{
int i, t = 0;
Base8 = GetField (B8X, B8Y) -> Unit;
if (Base8 == NO_UNIT || Units [Base8] -> Type % BADLIFE != unBase)
Base8 = NO_UNIT;
for (i = 0; i < BADLIFE; i++)
if (Units [i] != NULL && Units [i] -> Type < unRadar) t++;
if (t == 0) return -1; // GoodLife prohral
if (Base8 == NO_UNIT || Base8 < BADLIFE) return 1; // BadLife prohral
return 0; // Zatim se jeste hraje
}
示例9: GetFormal
const IAccess* CFrame::GetAccess( std::string _name ) const
{
const IAccess* result = GetFormal( _name );
if( result != 0 ) {
return result;
}
result = GetLocal( _name );
if( result != 0 ) {
return result;
}
result = GetField( _name );
if( result != 0 ) {
return result;
}
return nullptr;
}
示例10: GetField
// get the subtype
string MimeHeader::GetSubType() const
{
string strSubType;
MimeField *pfd = GetField(CMimeConst::ContentType());
if (pfd != NULL)
{
string strType;
pfd->GetValue(strType);
string::size_type nSlash = strType.find('/');
if (nSlash > 0)
strSubType = strType.substr(nSlash+1);
}
else
strSubType = "plain";
return strSubType;
}
示例11: HideHelpers
void TThor::GoOverground(int over)
{
int i;
if (over == IsOverground) return;
if (TimeUnits < 30) {
if (ID < BADLIFE) Message(MSG_OUT_OF_TIME);
return;
}
TimeUnits -= 30;
IsOverground = over;
HideHelpers();
if (GetField(X, Y)->Visib == 2) {
if (over) PlaySample(GetUnitSound(6), 6, EffectsVolume, GetFieldPanning(X, Y));
else PlaySample(GetUnitSound(7), 6, EffectsVolume, GetFieldPanning(X, Y));
}
if (over) {
for (i = 9; i < 16; i++) {
ActualSprite = i;
PaintUnit();
SDL_Delay(iniAnimDelay2);
}
Orient = 3; ActualSprite = 3;
Weapons[0]->Ammo = 8;
TotalRockets -= 8;
if (TotalRockets < 0) {
Weapons[0]->Ammo += TotalRockets;
TotalRockets = 0;
}
Defense[0] = -utTH_DND0, Defense[1] -= utTH_DND1, Defense[2] -= utTH_DND2;
}
else {
Rotate(3);
for (i = 15; i > 8; i--) {
ActualSprite = i;
PaintUnit();
SDL_Delay(iniAnimDelay2);
}
ActualSprite = 8;
TotalRockets += Weapons[0]->Ammo;
Weapons[0]->Ammo = 0;
Defense[0] += utTH_DND0, Defense[1] += utTH_DND1, Defense[2] += utTH_DND2;
}
ShowHelpers();
PaintUnit();
}
示例12: s_Field
void CDatabaseManager::RemoveField(QString *pICAO)
{
//First remove the directory
s_Field* lfld = new s_Field();
GetField(*pICAO, lfld);
QDir ldir(lfld->Path);
ldir.cd(lfld->Path);
QStringList lFiles;
lFiles = ldir.entryList();
QString fileName;
foreach(fileName, lFiles)
{
QString fn(lfld->Path);
fn.append("/");
fn.append(fileName);
QFile::remove(fn);
}
示例13: AssignResult19
int AssignResult19 ()
{
int i, t = 0;
Base1 = GetField (B1X, B1Y) -> Unit;
if (Base1 == NO_UNIT || Units [Base1] -> Type % BADLIFE != unArtefactHouse)
Base1 = NO_UNIT;
for (i = 0; i < BADLIFE; i++)
if (Units [i] != NULL) t++;
if (t == 0) return -1; // GoodLife prohral
if (Base1 == NO_UNIT || Base1 < BADLIFE) return 1;
return 0; // Zatim se jeste hraje
}
示例14: AssignResult8
int AssignResult8 ()
{
int i, t = 0;
Docks2 = GetField (D2X, D2Y) -> Unit;
if (Docks2 == NO_UNIT || Units [Docks2] -> Type % BADLIFE != unDocks)
Docks2 = NO_UNIT;
for (i = 0; i < BADLIFE; i++)
if (Units [i] != NULL) t++;
if (t == 0) return -1; // GoodLife prohral
if (Docks2 == NO_UNIT || Docks2 < BADLIFE) return 1; // BadLife prohral
return 0; // Zatim se jeste hraje
}
示例15: luacapstone_memoperand_metaIndex
static int luacapstone_memoperand_metaIndex(lua_State* l)
{
sparc_op_mem* memop = *((sparc_op_mem**)lua_touserdata(l, 1));
const char* field = lua_tostring(l, 2);
VALIDATE_FIELD(sparc_op_mem, field);
const sparc_op_mem_FieldInfo* fi = GetField(sparc_op_mem, field);
if(fi->IsIntegral)
lua_pushinteger(l, fieldValue<lua_Integer>(memop, fi));
else
{
NOT_IMPLEMENTED(field);
}
return 1;
}