wxString PartitioningTreeCtrl::getCADData()
{
	char a='"';
	wxString tab="	";
	wxString tabtab="		";
	wxString value;
	
	wxTreeItemId root = GetRootItem();
	wxTreeItemIdValue cookie;
	wxTreeItemId itemid = GetFirstChild(root,cookie);

	while (!(GetItemText(itemid).IsEmpty())) {
		
		if (GetType(itemid)==host) {
			value.Append(hostdata(itemid));
		}
		if (GetType(itemid)==process) {
			value.Append(processdata(itemid));
		}
		if (GetType(itemid)==home) {
			value.Append(homedata(itemid));
		}
	   
	   itemid=GetNextChild(root,cookie);
	   if (!itemid.IsOk())
	   {
		   break;
	   }
	}

	

	return value;
}
示例#2
0
unsigned int AsyncDNS::parse_question(char *response_data, DNS_QD *question)
{
    int offset = 0;
    unsigned int len = 0;
    while( *(response_data + offset) != '\0' )
    {
        offset += 1;
    }

    QByteArray hostdata(0);
    // why +1 ?
    // because actual host data has an additional '\0' represents for the end of string.
    QString unpack_fmt = QString("[%1]HH").arg(offset + 1);

    len = Utils::unpack(unpack_fmt.toStdString().c_str(), response_data,
                        &hostdata,
                        &(question->qtype),
                        &(question->qclass));

    question->host = build_address(QString::fromStdString(hostdata.toStdString()), FROM_QS);

    return len;
}