本文整理汇总了C++中AddField函数的典型用法代码示例。如果您正苦于以下问题:C++ AddField函数的具体用法?C++ AddField怎么用?C++ AddField使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddField函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:BigHNF,项目名称:tcpmp-revive,代码行数:7,代码来源:id3tag.c
示例2: CRuleTmpVar
CRuleTmpVar* CRuleStruct::AllocVar(CRuleType* pType)
{
uint32 nSize = m_oFields.GetSize();
CRuleTmpVar* pVar = new CRuleTmpVar(pType, nSize);
AddField(pVar);
return pVar;
}
开发者ID:nightstyles,项目名称:focp,代码行数:7,代码来源:RuleType.cpp
示例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);
}
开发者ID:stormbreakerbg,项目名称:stormsql,代码行数:36,代码来源:CreateTable.cpp
示例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);
}
}
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:35,代码来源:nsXBLContentSink.cpp
示例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;
}
开发者ID:NAGAVENDRA,项目名称:GenieForiOS,代码行数:31,代码来源:NptUri.cpp
示例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);
}
开发者ID:NAGAVENDRA,项目名称:GenieForiOS,代码行数:29,代码来源:NptUri.cpp
示例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);
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-ObjectPM,代码行数:16,代码来源:formdemo.cpp
示例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++;
}
}
}
开发者ID:ZeroTheSavior,项目名称:remotecontrol-for-winamp,代码行数:32,代码来源:Record.cpp
示例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;
}
开发者ID:didiradi,项目名称:C-CPP-Projects,代码行数:8,代码来源:FIXFLD.CPP
示例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;
}
开发者ID:Bevara,项目名称:GPAC,代码行数:8,代码来源:opencv_is.c
示例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;
}
开发者ID:bigbensk,项目名称:gpac,代码行数:8,代码来源:demo_is.c
示例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;
}
开发者ID:rsprouse,项目名称:espsfree,代码行数:58,代码来源:fea2esig.c
示例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 );
}
}
}
}
}
开发者ID:cpavlina,项目名称:kicad,代码行数:62,代码来源:bom_table_model.cpp
示例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);
}
开发者ID:RavenB,项目名称:Earth-and-Beyond-server,代码行数:9,代码来源:mysqlplus.cpp
示例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;
}
开发者ID:RobBullen,项目名称:AudioMorphing,代码行数:57,代码来源:esignal.c
示例16: AddFieldStr
static NOINLINE void AddFieldStr(pin* Pin,int Id,const tchar_t* Value)
{
if (Value[0])
{
tchar_t s[512];
GetFrameName(Id,s,TSIZEOF(s));
tcscat_s(s,TSIZEOF(s),Value);
AddField(Pin,Id,s);
}
}
开发者ID:BigHNF,项目名称:tcpmp-revive,代码行数:10,代码来源:id3tag.c
示例17: AddFieldAttachment
static NOINLINE void AddFieldAttachment(pin* Pin,int Id,filepos_t Pos,int Size,const tchar_t* ContentType)
{
if (Size>0)
{
tchar_t s[512];
GetFrameName(Id,s,TSIZEOF(s));
stcatprintf_s(s,TSIZEOF(s),T(":%d:%d:%s"),(int)Pos,Size,ContentType);
AddField(Pin,Id,s);
}
}
开发者ID:BigHNF,项目名称:tcpmp-revive,代码行数:10,代码来源:id3tag.c
示例18: CSymbol
CFrame::CFrame( const CClassInfo * currentClass, const CMethodInfo * method, const CTable* table )
{
// декорированное имя функции
std::string functionDecoratedName = currentClass->Name()->String() + "___" + method->Name()->String();
name = new CSymbol( functionDecoratedName );
framePointer = new CTemp( new CSymbol( functionDecoratedName + "___framePointer" ) );
thisPointer = new CTemp( new CSymbol( functionDecoratedName + "___thisPointer" ) );
returnValue = new CTemp( new CSymbol( functionDecoratedName + "___returnValue" ) );
// добавляем поля класса и всех его родителей
CSymbol* tempClass = currentClass->Name();
int inObjectNum = 0;
while( tempClass != nullptr ) {
CClassInfo* tempClassInfo = table->FindClass( tempClass );
for( auto var : tempClassInfo->VarList() ) {
AddField( var.second->Name(), new CInObject( inObjectNum++ ) );
}
tempClass = tempClassInfo->BaseClassName();
}
// добавляем аргументы метода ("this" -- нулевой)
int inFrameNum = 0;
AddField( new CSymbol( "this" ), new CInFrame( inFrameNum++ ) );
for( auto argument : method->FormalArgs() ) {
AddField( argument.second->Name(), new CInFrame( inFrameNum++ ) );
}
// добавляем локальные переменные метода
for( auto argument : method->LocalArgs() ) {
AddField( argument.second->Name(), new CInFrame( inFrameNum++ ) );
localsCount = method->LocalArgs().size();
}
registers.push_back( "EAX" );
registers.push_back( "EBX" );
registers.push_back( "ECX" );
registers.push_back( "EDX" );
registers.push_back( "ESI" );
registers.push_back( "EDI" );
eax = new CTemp( symbolStorage.Get( "EAX" ) );
edx = new CTemp( symbolStorage.Get( "EDX" ) );
}
开发者ID:AnnaSavinova,项目名称:GirlsHeapCompiler,代码行数:42,代码来源:Frame.cpp
示例19: switch
void mmCustomFieldListDialog::OnMenuSelected(wxCommandEvent& event)
{
switch(event.GetId())
{
case MENU_NEW_FIELD: AddField(); break;
case MENU_EDIT_FIELD: EditField(); break;
case MENU_DELETE_FIELD: DeleteField(); break;
case MENU_UPDATE_FIELD: UpdateField(); break;
default: break;
}
}
开发者ID:vomikan,项目名称:moneymanagerex,代码行数:11,代码来源:customfieldlistdialog.cpp
示例20: Q_UNUSED
void RegEdit::OnSocItemActivated(QTreeWidgetItem *current, int column)
{
Q_UNUSED(column);
if(current == 0)
return;
if(current->type() == SocTreeNewDevType)
AddDevice(current);
else if(current->type() == SocTreeNewRegType)
AddRegister(current);
else if(current->type() == SocTreeNewFieldType)
AddField(current);
}
开发者ID:Cortexelus,项目名称:rockbox,代码行数:12,代码来源:regedit.cpp
注:本文中的AddField函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论