本文整理汇总了C++中BuildList函数的典型用法代码示例。如果您正苦于以下问题:C++ BuildList函数的具体用法?C++ BuildList怎么用?C++ BuildList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BuildList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildList
//-----------------------------------------------------------------------------
// Fixes up all elements
//-----------------------------------------------------------------------------
void CImportSFMV6::BuildList( CDmElement *pElement, CUtlRBTree< CDmElement *, int >& list )
{
if ( !pElement )
return;
if ( list.Find( pElement ) != list.InvalidIndex() )
return;
list.Insert( pElement );
// Descend to bottom of tree, then do fixup coming back up the tree
for ( CDmAttribute *pAttribute = pElement->FirstAttribute(); pAttribute; pAttribute = pAttribute->NextAttribute() )
{
if ( pAttribute->GetType() == AT_ELEMENT )
{
CDmElement *pElement = pAttribute->GetValueElement<CDmElement>( );
BuildList( pElement, list );
continue;
}
if ( pAttribute->GetType() == AT_ELEMENT_ARRAY )
{
CDmrElementArray<> array( pAttribute );
int nCount = array.Count();
for ( int i = 0; i < nCount; ++i )
{
CDmElement *pChild = array[ i ];
BuildList( pChild, list );
}
continue;
}
}
}
示例2: main
int main()
{
int m, n;
while (scanf("%d %d", &m, &n) != EOF)
{
ListNode* head1 = BuildList(m);
ListNode* head2 = BuildList(n);
int diff = m-n;
ListNode* pHeadLong = head1;
ListNode* pHeadShort = head2;
if (m < n)
{
diff = n-m;
pHeadLong = head2;
pHeadShort = head1;
}
// forward to the proper position
for (int i = 0; i < diff; ++i)
pHeadLong = pHeadLong->pNext;
bool bFound = false;
while (pHeadLong)
{ // search for the first common node
if (pHeadLong->nValue == pHeadShort->nValue)
{
bFound = true;
break;
}
else
{
pHeadLong = pHeadLong->pNext;
pHeadShort = pHeadShort->pNext;
}
}
if (bFound)
printf("%d\n", pHeadLong->nValue);
else
printf("My God\n");
DestroyList(head1);
DestroyList(head2);
}
return 0;
}
示例3: BuildList
void GUIgraph::SetDatasets(const vector<GUIgraph::Dataset>& newData,bool showDif,int button,string name)
{
this->showDif=showDif;
graphNames[button]=name;
data[button].clear();
data[button].insert(data[button].begin(), newData.begin(), newData.end());
maximum=0;
for(int a=0;a<2;++a){
vector<GUIgraph::Dataset>::iterator i=data[a].begin();
vector<GUIgraph::Dataset>::iterator e=data[a].end();
for(;i!=e; i++)
{
vector<float>::iterator j=i->points.begin();
vector<float>::iterator k=i->points.end();
float last=0;
for(;j!=k; j++){
if(*j-last>maximum)
maximum=*j-last;
if(showDif)
last=*j;
}
}
}
BuildList();
}
示例4: LeaveDirectory
static void LeaveDirectory( void ) {
char *s;
int i;
s = strrchr( m_demos.browse, '/' );
if( !s ) {
return;
}
*s = 0;
// rebuild list
FreeList();
BuildList();
MenuList_Init( &m_demos.list );
// move cursor to the previous directory
for( i = 0; i < m_demos.numDirs; i++ ) {
demoEntry_t *e = m_demos.list.items[i];
if( !strcmp( e->name, s + 1 ) ) {
MenuList_SetValue( &m_demos.list, i );
break;
}
}
if( s == m_demos.browse ) {
m_demos.browse[0] = '/';
m_demos.browse[1] = 0;
}
}
示例5: Activate
static menuSound_t Activate( menuCommon_t *self ) {
size_t len, baselen;
demoEntry_t *e = m_demos.list.items[m_demos.list.curvalue];
switch( e->type ) {
case ENTRY_UP:
LeaveDirectory();
return QMS_OUT;
case ENTRY_DN:
baselen = strlen( m_demos.browse );
len = strlen( e->name );
if( baselen + 1 + len >= sizeof( m_demos.browse ) ) {
return QMS_BEEP;
}
if( !baselen || m_demos.browse[ baselen - 1 ] != '/' ) {
m_demos.browse[ baselen++ ] = '/';
}
memcpy( m_demos.browse + baselen, e->name, len + 1 );
// rebuild list
FreeList();
BuildList();
MenuList_Init( &m_demos.list );
return QMS_IN;
case ENTRY_DEMO:
Cbuf_AddText( &cmd_buffer, va( "demo \"%s/%s\"\n", m_demos.browse[1] ?
m_demos.browse : "", e->name ) );
return QMS_SILENT;
}
return QMS_NOTHANDLED;
}
示例6: Test1
void Test1()
{
ListNode* pHead = BuildList();
ListNode* pReversedHead = Test("Test1", pHead, 1);
DestroyList(pReversedHead);
}
示例7: LeaveDirectory
static menuSound_t LeaveDirectory(void)
{
char *s;
int i;
s = strrchr(m_demos.browse, '/');
if (!s) {
return QMS_BEEP;
}
if (s == m_demos.browse) {
strcpy(m_demos.browse, "/");
} else {
*s = 0;
}
// rebuild list
FreeList();
BuildList();
MenuList_Init(&m_demos.list);
// move cursor to the previous directory
for (i = 0; i < m_demos.numDirs; i++) {
demoEntry_t *e = m_demos.list.items[i];
if (!strcmp(e->name, s + 1)) {
MenuList_SetValue(&m_demos.list, i);
break;
}
}
return QMS_OUT;
}
示例8: WidgetLBGetCurSel
void ProjectPrefsGUI::DoRemove(void)
{
ActiveItem = WidgetLBGetCurSel(IDC_PARLIST);
HostProj->DL = HostProj->DirList_Remove(HostProj->DL, (short)ActiveItem);
BuildList(ActiveItem);
} // ProjectPrefsGUI::DoRemove()
示例9: BuildList
eOSState cMenuSearchResults::OnYellow()
{
eOSState state = osUnknown;
if(!HasSubMenu())
{
modeYellow = (modeYellow==showTitleEpisode?showEpisode:showTitleEpisode);
BuildList();
state = osContinue;
}
return state;
}
示例10: BuildList
void GUIbutton::SetCaption(const string& capt)
{
caption=capt;
if(autosizing)
{
w=(int)(guifont->GetWidth(caption.c_str()))+14;
}
BuildList();
}
示例11: GetSystemMetrics
BOOL CDialogClasses::OnInitDialog( )
{
m_ImageList.Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32, 1, 1);
m_ImageList.SetBkColor(RGB(255, 255, 255));
m_hClassIcon = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(IDI_ICON_CLASS));
m_ImageList.Add(m_hClassIcon);
BuildList();
return TRUE;
}
示例12: BuildList
void ProjectPrefsGUI::DoAdd(void)
{
struct DirList *DLNew;
if (DLNew = HostProj->DirList_Add(HostProj->DL, NULL, 0))
{
if (! HostProj->DL)
HostProj->DL = DLNew;
BuildList(HostProj->DirList_ItemExists(HostProj->DL, DLNew->Name));
} // if
} // ProjectPrefsGUI::DoAdd()
示例13: Expose
static void Expose( menuFrameWork_t *self ) {
time_t now = time( NULL );
struct tm *tm = localtime( &now );
if( tm ) {
m_demos.year = tm->tm_year;
}
BuildList();
// move cursor to previous position
MenuList_SetValue( &m_demos.list, m_demos.selection );
}
示例14: tr
// --- cMenuSearchResultsForBlacklist -------------------------------------------------------
cMenuSearchResultsForBlacklist::cMenuSearchResultsForBlacklist(cBlacklist* Blacklist)
:cMenuSearchResults(cTemplFile::GetTemplateByName("MenuSearchResults"))
{
ButtonBlue[0] = tr("Button$all channels");
ButtonBlue[1] = tr("Button$only FTA");
ButtonBlue[2] = tr("Button$Timer preview");
blacklist = Blacklist;
m_bSort = true;
modeBlue = blacklist->useChannel==3?showNoPayTV:(EPGSearchConfig.ignorePayTV?showNoPayTV:showAll);
BuildList();
}
示例15: BuildList
BOOL CEnvelopeTypeDialog::OnInitDialog()
{
CPmwDialogColor::OnInitDialog();
m_List.ReadList("ENVELOPE.DAT");
BuildList();
CreateWizzardButtons ();
EnableWizardButtons (m_WizFlags);
return TRUE; // return TRUE unless you set the focus to a control
}