Esempio n. 1
0
void ReaderMgr::skipPastSpaces()
{
    // we are not using it, so we don't care to initialize it
    bool tmpFlag;
    //
    //  Skip all the spaces in the current reader. If it returned because
    //  it hit a non-space, break out. Else we have to pop another entity
    //  and keep going.
    //
    while (!fCurReader->skipSpaces(tmpFlag, false))
    {
        // Try to pop another entity. If we can't then we are done
        if (!popReader())
            break;
    }
}
Esempio n. 2
0
void ReaderMgr::skipPastSpaces(bool& skippedSomething, bool inDecl /* = false */)
{
    // we rely on the fact that fCurReader->skipSpaces will NOT reset the flag to false, but only
    // set it to true if a space is found
    skippedSomething = false;
    //
    //  Skip all the spaces in the current reader. If it returned because
    //  it hit a non-space, break out. Else we have to pop another entity
    //  and keep going.
    //
    while (!fCurReader->skipSpaces(skippedSomething, inDecl))
    {
        // Try to pop another entity. If we can't then we are done
        if (!popReader())
            break;
    }
}
Esempio n. 3
0
void ReaderMgr::getSpaces(XMLBuffer& toFill)
{
    // Reset the buffer before we start
    toFill.reset();

    //
    //  Get all the spaces from the current reader. If it returns true,
    //  it hit a non-space and we are done. Else we have to pop a reader
    //  and keep going.
    //
    while (!fCurReader->getSpaces(toFill))
    {
        // We wore that one out, so lets pop a reader and try again
        if (!popReader())
            break;
    }
}
Esempio n. 4
0
XMLCh ReaderMgr::peekNextChar()
{
    XMLCh chRet;
    if (fCurReader->peekNextChar(chRet))
        return chRet;

    //
    //  Didn't get anything back so this reader is hosed. So lets move to
    //  the next reader on the stack. If this fails, it will be because
    //  its the end of the original file, and we just return zero.
    //
    if (!popReader())
        return XMLCh(0);

    // Else peek again and return the character
    fCurReader->peekNextChar(chRet);
    return chRet;
}
Esempio n. 5
0
void ReaderMgr::getUpToCharOrWS(XMLBuffer& toFill, const XMLCh toCheck)
{
    // Reset the target buffer before we start
    toFill.reset();

    //
    //  Ok, enter a loop where we ask the current reader to get chars until
    //  it meets the criteria. It returns false if it came back due to eating
    //  up all of its data. Else it returned because something matched, and
    //  we are done.
    //
    while (!fCurReader->getUpToCharOrWS(toFill, toCheck))
    {
        // We ate that one up, lets try to pop another. If not, break out
        if (!popReader())
            break;
    }
}
Esempio n. 6
0
bool ReaderMgr::skipIfQuote(XMLCh& chGotten)
{
    while (true)
    {
        // If we get it, then just return true now
        if (fCurReader->skipIfQuote(chGotten))
            return true;

        //
        //  Check to see if we hit end of input on this reader. If so, then
        //  lets pop and try again. Else, we failed. If we cannot pop another
        //  then we failed.
        //
        if (!fCurReader->getNoMoreFlag())
            break;

        if (!popReader())
            break;
    }
    return false;
}
Esempio n. 7
0
// ---------------------------------------------------------------------------
//  ReaderMgr: Scanning APIs
// ---------------------------------------------------------------------------
XMLCh ReaderMgr::getNextChar()
{
    XMLCh chRet;
    if (fCurReader->getNextChar(chRet))
        return chRet;

    //
    //  Didn't get anything back so this reader is hosed. So lets move to
    //  the next reader on the stack. If this fails, it will be because
    //  its the end of the original file, and we just return zero.
    //
    //  If its the end of an entity and fThrowEOE is set, it will throw out
    //  of here. Otherwise, it will take us down to the next reader and
    //  we'll have more chars.
    //
    if (!popReader())
        return XMLCh(0);

    // Else try again and return the new character
    fCurReader->getNextChar(chRet);
    return chRet;
}
Esempio n. 8
0
bool ReaderMgr::skipPastSpaces()
{
    bool skippedSomething = false;
    bool tmpFlag;
    while (true)
    {
        //
        //  Skip all the spaces in the current reader. If it returned because
        //  it hit a non-space, break out. Else we have to pop another entity
        //  and keep going.
        //
        if (fCurReader->skipSpaces(tmpFlag))
            break;

        if (tmpFlag)
            skippedSomething = true;

        // Try to pop another enitity. If we can't then we are done
        if (!popReader())
            break;
    }
    return (tmpFlag || skippedSomething);
}