Esempio n. 1
0
wxFileOffset wxWrapperInputStream::OnSysTell() const
{
    wxCHECK_MSG(m_parent_i_stream, false, "Stream not valid");

    wxON_BLOCK_EXIT_THIS0(wxWrapperInputStream::SynchronizeLastError);
    return m_parent_i_stream->TellI();
}
Esempio n. 2
0
wxFileOffset wxWrapperInputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
{
    wxCHECK_MSG(IsSeekable(), false, "Stream not seekable");

    wxON_BLOCK_EXIT_THIS0(wxWrapperInputStream::SynchronizeLastError);
    return m_parent_i_stream->SeekI (pos, mode);
}
Esempio n. 3
0
wxFileOffset wxWrapperInputStream::GetLength() const
{
    wxCHECK_MSG(m_parent_i_stream, wxInvalidOffset, "Stream not valid");

    wxON_BLOCK_EXIT_THIS0(wxWrapperInputStream::SynchronizeLastError);
    return m_parent_i_stream->GetLength();
}
Esempio n. 4
0
size_t wxWrapperInputStream::OnSysRead(void *buffer, size_t size)
{
    wxCHECK_MSG(m_parent_i_stream, false, "Stream not valid");

    wxON_BLOCK_EXIT_THIS0(wxWrapperInputStream::SynchronizeLastError);

    m_parent_i_stream->Read(buffer, size);
    return m_parent_i_stream->LastRead();
}
Esempio n. 5
0
void ScopeGuardTestCase::BlockExitThis()
{
    m_count = 1;

    {
        wxON_BLOCK_EXIT_THIS0(ScopeGuardTestCase::Zero);

        CPPUNIT_ASSERT_EQUAL( 1, m_count );
    }
    CPPUNIT_ASSERT_EQUAL( 0, m_count );

    {
        wxON_BLOCK_EXIT_THIS1(ScopeGuardTestCase::Set, 17);

        CPPUNIT_ASSERT_EQUAL( 0, m_count );
    }
    CPPUNIT_ASSERT_EQUAL( 17, m_count );

    {
        wxON_BLOCK_EXIT_THIS2(ScopeGuardTestCase::Sum, 2, 3);
        CPPUNIT_ASSERT_EQUAL( 17, m_count );
    }
    CPPUNIT_ASSERT_EQUAL( 5, m_count );
}