本文整理匯總了C++中AddField函數的典型用法代碼示例。如果您正苦於以下問題:C++ AddField函數的具體用法?C++ AddField怎麽用?C++ AddField使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AddField函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AddFieldInt
static NOINLINE void AddFieldInt(pin* Pin,int Id,int Value)
{
tchar_t s[40];
GetFrameName(Id,s,TSIZEOF(s));
IntToString(s+tcslen(s),TSIZEOF(s)-tcslen(s),Value,0);
AddField(Pin,Id,s);
}
示例2: CRuleTmpVar
CRuleTmpVar* CRuleStruct::AllocVar(CRuleType* pType)
{
uint32 nSize = m_oFields.GetSize();
CRuleTmpVar* pVar = new CRuleTmpVar(pType, nSize);
AddField(pVar);
return pVar;
}
示例3: parseField
/*
* CREATE TABLE <name> (
* <columnDefinitions>
* )
*
* <name> == <columnName> == identifier
* <columnDefinitions> := <columnName> <columnType> [, <columnDefinitions>]
* <columnType> := byte | int | uint | char(<length>)
* <length> == int
*/
void CreateTable::Parse(Lexer& lex)
{
Token t;
// <name>
t = lex.NextToken(TokenType::Identifier, false);
name = t.strData;
// (
lex.NextToken("(", TokenType::Parenthesis);
string tableName;
// While not )
do
{
Field f = parseField(lex);
AddField(f);
// , or )
t = lex.NextToken();
}
while (t.type == TokenType::Separator);
if (t.type != TokenType::Parenthesis || t.strData != ")")
throw InvalidTokenException(t);
}
示例4: getter_AddRefs
void
nsXBLContentSink::ConstructField(const PRUnichar **aAtts, PRUint32 aLineNumber)
{
const PRUnichar* name = nsnull;
const PRUnichar* readonly = nsnull;
nsCOMPtr<nsIAtom> prefix, localName;
for (; *aAtts; aAtts += 2) {
PRInt32 nameSpaceID;
nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
getter_AddRefs(localName), &nameSpaceID);
if (nameSpaceID != kNameSpaceID_None) {
continue;
}
// Is this attribute one of the ones we care about?
if (localName == nsGkAtoms::name) {
name = aAtts[1];
}
else if (localName == nsGkAtoms::readonly) {
readonly = aAtts[1];
}
}
if (name) {
// All of our pointers are now filled in. Construct our field with all of
// these parameters.
mField = new nsXBLProtoImplField(name, readonly);
if (mField) {
mField->SetLineNumber(aLineNumber);
AddField(mField);
}
}
}
示例5: AddField
/*----------------------------------------------------------------------
| NPT_UrlQuery::Parse
+---------------------------------------------------------------------*/
NPT_Result
NPT_UrlQuery::Parse(const char* query)
{
const char* cursor = query;
NPT_String name;
NPT_String value;
bool in_name = true;
do {
if (*cursor == '\0' || *cursor == '&') {
if (!name.IsEmpty() && !value.IsEmpty()) {
AddField(name, value, true);
}
name.SetLength(0);
value.SetLength(0);
in_name = true;
} else if (*cursor == '=' && in_name) {
in_name = false;
} else {
if (in_name) {
name += *cursor;
} else {
value += *cursor;
}
}
} while (*cursor++);
return NPT_SUCCESS;
}
示例6: UrlEncode
/*----------------------------------------------------------------------
| NPT_UrlQuery::SetField
+---------------------------------------------------------------------*/
NPT_Result
NPT_UrlQuery::SetField(const char* name, const char* value, bool encoded)
{
NPT_String ename;
if (encoded) {
ename = name;
} else {
ename = UrlEncode(name);
}
for (NPT_List<Field>::Iterator it = m_Fields.GetFirstItem();
it;
++it) {
Field& field = *it;
if (field.m_Name == ename) {
if (encoded) {
field.m_Value = value;
} else {
field.m_Value = UrlEncode(value);
}
return NPT_SUCCESS;
}
}
// field not found, add it
return AddField(name, value, encoded);
}
示例7: CharForm
CharForm :: CharForm(wNoteBookPageList *pgList, FormData *data)
: wFormWindow(D_CHARS, 5, 0, DlgModeless)
{
wNoteBookPage *pg;
AddField( new wEditField(FtChar, 1, E_CHAR, &data->c, NULL) );
AddField( new wEditField(FtChar, 1, E_NUMERIC, &data->n, "%9") );
AddField( new wEditField(FtChar, 1, E_TOUPPER, &data->u, "%!") );
AddField( new wEditField(FtBool, 1, E_BOOLYN, &data->yn, "%rYN") );
AddField( new wEditField(FtBool, 1, E_BOOLTF, &data->tf, 0) );
pgList->InsertPage(pg = new wNoteBookPage(NULL, BpMinor | BpStatusTextOn, ""));
pg->SetStatusLine("Characters 2 of 3");
pg->SetTab("Char");
pg->SetPageHandle(IdCharPage);
}
示例8: while
//---------------------------------------------------------------------------
Record::Record(int RecordPos, int RecordIdx, int insertionPoint, VFILE *TableHandle, VFILE *IdxHandle, Table *p, Scanner *s)
{
Invalid = FALSE;
HTable = TableHandle;
Idx = IdxHandle;
RecordIndex=RecordIdx;
ParentTable = p;
ParentScanner = s;
InsertionPoint = insertionPoint;
int max=ParentTable->FieldsRecord ? ParentTable->FieldsRecord->Fields.GetNElements() : 128;
int n=0;
if (RecordPos != NULL)
{
int ThisPos = RecordPos;
while (ThisPos)
{
if (n >= max)
break;
Vfseek(HTable, ThisPos, SEEK_SET);
Field Entry (ThisPos, ParentTable);
Field *TypedEntry = Entry.ReadField(ThisPos);
Entry.SetDeletable();
if (!TypedEntry) break; // some db error?
AddField(TypedEntry);
ThisPos = TypedEntry->GetNextFieldPos();
n++;
}
}
}
示例9: Init
int FixedFieldBuffer :: Init(int numFields, int * FieldSize)
{
Initialized = TRUE;
Init (numFields);
for (int j =0; j < numFields; j++)
AddField(FieldSize[j]);
return TRUE;
}
示例10: OCV_RegisterDevice
static Bool OCV_RegisterDevice(struct __input_device *ifce, const char *urn, GF_BitStream *dsi, void (*AddField)(struct __input_device *_this, u32 fieldType, const char *name))
{
if (strncmp(urn, "OpenCV", 6)) return 0;
AddField(ifce, GF_SG_VRML_SFVEC2F, "position");
return 1;
}
示例11: DEV_RegisterDevice
static Bool DEV_RegisterDevice(struct __input_device *ifce, const char *urn, GF_BitStream *dsi, void (*AddField)(struct __input_device *_this, u32 fieldType, const char *name))
{
if (strcmp(urn, "DemoSensor")) return 0;
AddField(ifce, GF_SG_VRML_SFSTRING, "content");
return 1;
}
示例12: AddCommandLine
static FieldSpec *
AddCommandLine(FieldList *list,
char *line)
{
FieldSpec *field;
if (line == NULL)
return NULL;
field = FindField(*list, "commandLine");
if (field == NULL)
{
field = NewFieldSpec(ECHAR, 1);
if (field == NULL)
{
DebugMsg(1, "AddCommandLine: Couldn't create field spec.");
return NULL;
}
field->dim[0] = strlen(line);
field->name = savestring("commandLine");
field->occurrence = GLOBAL;
if (!AddField(list, field))
{
DebugMsg(1, "AddCommandLine: Couldn't add field spec.");
return NULL;
}
}
else /* field != NULL */
{
if (field->occurrence != GLOBAL)
{
DebugMsg(1, "AddCommandLine: non-GLOBAL field \'commandLine\".");
return NULL;
}
field->type = ECHAR;
field->rank = 1;
field->dim = (long *) ((field->dim == NULL)
? malloc(sizeof(long))
: realloc(field->dim, sizeof(long)));
if (field->dim == NULL)
{
DebugMsg(1, "AddCommandLine: couldn't (re)allocate dimension.");
return NULL;
}
field->dim[0] = 1 + strlen(line);
}
field->data = line;
return field;
}
示例13: GetFieldValue
/**
* If any changes have been made to this component,
* they are now applied to the schematic component
*/
void BOM_TABLE_COMPONENT::ApplyFieldChanges()
{
for( auto& unit : Units )
{
auto cmp = unit.GetComp();
if( !cmp )
continue;
// Iterate over each column
SCH_FIELD* field;
for( auto& column : m_columnList->Columns )
{
if( column && HasValueChanged( column ) )
{
wxString value = GetFieldValue( column->Id() );
switch( column->Id() )
{
// Ignore read-only fields
case BOM_COL_ID_REFERENCE:
case BOM_COL_ID_QUANTITY:
continue;
// Special field considerations
case BOM_COL_ID_FOOTPRINT:
field = cmp->GetField( FOOTPRINT );
break;
case BOM_COL_ID_VALUE:
field = cmp->GetField( VALUE );
break;
case BOM_COL_ID_DATASHEET:
field = cmp->GetField( DATASHEET );
break;
default:
// Find the field by name (but ignore default fields)
field = cmp->FindField( column->Title(), false );
break;
}
// New field needs to be added?
if( !field && !value.IsEmpty() )
{
SCH_FIELD newField( wxPoint( 0, 0 ), -1, cmp, column->Title() );
field = cmp->AddField( newField );
}
if( field )
{
field->SetText( value );
}
}
}
}
}
示例14: assert
void sql_query::AddData(char * Field, char * Value)
{
char tmp_buff[1024];
assert(strlen(Value) < sizeof(tmp_buff));
mysql_escape_string(tmp_buff, Value, strlen(Value));
sprintf(m_Values, "%s, '%s'", m_Values, tmp_buff);
AddField(Field);
}
示例15: SetFieldOrdering
int
SetFieldOrdering(FieldList *list,
int order)
{
FieldSpec *field;
if (*list == NULL)
{
DebugMsg(1, "SetFieldOrdering: NULL field list.");
return FALSE;
}
field = FindField(*list, "fieldOrder");
if (field == NULL)
{
if (order == TYPE_ORDER)
return TRUE;
field = NewFieldSpec(SHORT, 0);
if (field == NULL)
{
DebugMsg(1, "SetFieldOrdering: Couldn't create field spec.");
return FALSE;
}
field->name = StrDup("fieldOrder");
field->occurrence = GLOBAL;
if (!AddField(list, field))
{
DebugMsg(1, "SetFieldOrdering: Couldn't add field spec.");
return FALSE;
}
}
else /* field != NULL */
{
if (field->occurrence != GLOBAL)
{
DebugMsg(1, "SetFieldOrdering: non-GLOBAL field \"fieldOrder\".");
return FALSE;
}
field->type = SHORT;
field->rank = 0;
}
field->data = ((field->data == NULL)
? malloc(sizeof(short))
: realloc(field->data, sizeof(short)));
if (field->data == NULL)
{
DebugMsg(1, "SetFieldOrdering: couldn't (re)allocate data.");
return FALSE;
}
*(short *) field->data = order;
return TRUE;
}