Exemplo n.º 1
0
void XlateTableWriteBase::WriteXlate(XlateTable *xt){
	unsigned i;
	for (i = 0; i < 10; i++)md[i] = xt->CopyMode('0'+i);
	lvl = 1;
	XlateTableRec *tb = md[0];
	int ch;
	for (ch = 1; ch <256; ch++){
		if (tb->dat[ch] != 0) {
			if (65535u != (i = ustridx(LowerCharList, ch))){
				if (!EqXE(tb->dat[ch], tb->dat[UpperCharList[i]])) {
					DoItem(tb->dat[ch], lvl);
					if (tb->dat[ch]->n != 0) DoNext(tb->dat[ch]->n);
				}
			}
			else {
				DoItem(tb->dat[ch],lvl);
				if (65535u != (i = ustridx(UpperCharList, ch))){
					if (EqXE(tb->dat[ch], tb->dat[LowerCharList[i]]))
						DoItem(tb->dat[LowerCharList[i]], 255);
				}
				if (tb->dat[ch]->n != 0) DoNext(tb->dat[ch]->n);
			}; // if (0 == (cpt ... else ...
		};  // if (tb-<dat[ch] != 0 ...
	}; // for (ch = 1 ...
//	WriteData(&c254, 1);
	UNCH tmp[2]; tmp[0] = 254; tmp[1] = 0;
	WriteData(tmp,2);
};
Exemplo n.º 2
0
void XlateTableWriteBase::DoNext( XlateEntryData *p ){
	lvl++;
	while (p != 0){
		DoItem(p, lvl);
		if ((p->f != 0) && (EqXE(p, p->f))){DoItem(p, 256); p= p->f;}
		if (p->n != 0) DoNext(p->n);
		p = p->f;
	}
	lvl--;
} ;
Exemplo n.º 3
0
void CMGetNewContent::DoItemList(TiXmlElement* pItemList)
{
	if(!pItemList)
			return;
	if(!m_lstItem)
		m_lstItem = new CMList<TNewContentItem*>;
    m_lstItem->clear();
    
    if(!m_lstCourseItem)
    	m_lstCourseItem = new CMList<TNewContentItem*>;
    m_lstCourseItem->clear();

	if(!m_lstNewsItem)
		m_lstNewsItem = new CMList<TNewContentItem*>;
	m_lstNewsItem->clear();

	TiXmlElement* pItem = pItemList->FirstChildElement("item");
	while(pItem)
	{
        TNewContentItem* newContentItem = new TNewContentItem;
        memset(newContentItem, 0, sizeof(TNewContentItem));
        DoItem(pItem, newContentItem);
        m_lstItem->push_back(newContentItem);
        if (strcmp(newContentItem->sType, "course") == 0)
        	{
        	 	m_lstCourseItem->push_back(newContentItem);
        	}
        	else if (strcmp(newContentItem->sType, "news") == 0)
        	{
        		m_lstNewsItem->push_back(newContentItem);
        	}
		pItem = pItem->NextSiblingElement("item");
	}
}
Exemplo n.º 4
0
void CMGetNewContent::DoHeadItemList(TiXmlElement* pHeadItemList)
{
	if(!m_lstHeadItem)
		m_lstHeadItem = new CMList<TNewContentItem*>;
	if(!pHeadItemList)
		return;
    
    m_lstHeadItem->clear();
    
	TiXmlElement* pHeadItem = pHeadItemList->FirstChildElement("item");
	while(pHeadItem)
	{
        TNewContentItem* newContentItem = new TNewContentItem;
        memset(newContentItem, 0, sizeof(TNewContentItem));
        
        DoItem(pHeadItem, newContentItem);
        
        m_lstHeadItem->push_back(newContentItem);

		pHeadItem = pHeadItem->NextSiblingElement("item");
	}
}