Esempio n. 1
0
bool KCalls::SetLine(int Line, const CALL *Info)
{
	int i = 0;


	changeItemPart(statetoa(Info->stat), Line, i++);
	changeItemPart(directiontoa(Info->dialin), Line, i++);
	changeItemPart(emptytoa(Info->num[_ME(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->alias[_ME(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->num[_OTHER(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->vorwahl[_OTHER(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->rufnummer[_OTHER(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->alias[_OTHER(Info)]), Line, i++);
	changeItemPart(emptytoa(Info->area[_OTHER(Info)]), Line, i++);
	changeItemPart(timetoa(Info->connect), Line, i++);
	changeItemPart(durationtoa(Info->t_duration), Line, i++);
	changeItemPart(MsgHdl::ltoa(Info->aoce), Line, i++);
	changeItemPart(Info->money, Line, i++);
	changeItemPart(Info->currency, Line, i++);
	changeItemPart(Byte2Str((double) Info->ibytes, NO_DIR), Line, i++);
	changeItemPart(Byte2Str((double) Info->obytes, NO_DIR), Line, i++);
	changeItemPart(Byte2Str(Info->ibps, GET_BPS|NO_DIR), Line, i++);
	changeItemPart(Byte2Str(Info->obps, GET_BPS|NO_DIR), Line, i++);
	changeItemPart(Info->msg, Line, i++);

	return TRUE;
}
Esempio n. 2
0
bool PSCommentLexer::parse(QIODevice& fin)
{
    char c;

    m_buffer.clear();
    m_curState = State_Start;

    parsingStarted();

    while (!fin.atEnd()) {
        fin.getChar(&c);

//    qDebug ("got %c", c);

        State newState;
        Action action;

        nextStep(c, &newState, &action);

        switch (action) {
        case Action_Copy :
            m_buffer.append(c);
            break;
        case Action_CopyOutput :
            m_buffer.append(c);
            doOutput();
            break;
        case Action_Output :
            doOutput();
            break;
        case Action_OutputUnget :
            doOutput();
            fin.ungetChar(c);
            break;
        case Action_Ignore :
            /* ignore */
            break;
        case Action_Abort :
            qWarning("state %s / %s char %c (%d)" , statetoa(m_curState), statetoa(newState), c, c);
            parsingAborted();
            return false;
            break;
        case Action_InitTemp :
            m_temp.clear();
            break;
        case Action_CopyTemp :
            m_temp.append(c);
            break;
        case Action_DecodeUnget :
            m_buffer.append(decode());
            fin.ungetChar(c);
            break;
        default :
            qWarning("unknown action: %d ", action);
        }

        m_curState = newState;
    }

    parsingFinished();
    return true;
}