Exemplo n.º 1
0
// ------------------------------------------------------------------------------------------------
void COBImporter::UnsupportedChunk_Ascii(LineSplitter& splitter, const ChunkInfo& nfo, const char* name)
{
    const std::string error = format("Encountered unsupported chunk: ") <<  name <<
        " [version: "<<nfo.version<<", size: "<<nfo.size<<"]";

    // we can recover if the chunk size was specified.
    if(nfo.size != static_cast<unsigned int>(-1)) {
        DefaultLogger::get()->error(error);

        // (HACK) - our current position in the stream is the beginning of the
        // head line of the next chunk. That's fine, but the caller is going
        // to call ++ on `splitter`, which we need to swallow to avoid
        // missing the next line.
        splitter.get_stream().IncPtr(nfo.size);
        splitter.swallow_next_increment();
    }
    else ThrowException(error);
}