librostlab-blast  1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Friends
rostlab::blast::parser_driver Class Reference

Blast (default, -m 0) output parser. More...

#include <blast-parser-driver.h>

List of all members.

Public Types

typedef rostlab::blast::result result_type

Public Member Functions

 parser_driver (FILE *__istream=stdin, const std::string &__istream_name="stdin")
virtual ~parser_driver ()
const result_typeparse (bool __trace_parsing=false, bool __trace_scanning=false) throw (rostlab::blast::parser_error)
 Parse one result from the input stream.
bool trace_scanning ()
 Get tracing of scanning.
void trace_scanning (bool __b)
 Set tracing of scanning.
void error (const rostlab::blast::location &__loc, const std::string __msg)
 Print error message for given location.
void error (const std::string __msg)
 Print error message.
const result_typeresult () const
 Read-only access to results.

Friends

class rostlab::blast::parser

Detailed Description

Blast (default, -m 0) output parser.

Example:

#include <iostream>
#include <rostlab/blast-parser-driver.h>

using namespace rostlab;

int main()
{
        rostlab::blast::parser_driver p(stdin);

        while( const rostlab::blast::result& res = p.parse() )
                std::cout << res;

        return 0;
}

// Compile with:
// g++ -Wall -lrostlab-blast parseblast.cpp -o parseblast -L../lib/.libs

Definition at line 59 of file blast-parser-driver.h.


Member Typedef Documentation

Definition at line 63 of file blast-parser-driver.h.


Constructor & Destructor Documentation

rostlab::blast::parser_driver::parser_driver ( FILE *  __istream = stdin,
const std::string &  __istream_name = "stdin" 
) [inline]

Definition at line 79 of file blast-parser-driver.h.

virtual rostlab::blast::parser_driver::~parser_driver ( ) [inline, virtual]

Definition at line 83 of file blast-parser-driver.h.


Member Function Documentation

void rostlab::blast::parser_driver::error ( const rostlab::blast::location __loc,
const std::string  __msg 
) [inline]

Print error message for given location.

Definition at line 99 of file blast-parser-driver.h.

void rostlab::blast::parser_driver::error ( const std::string  __msg) [inline]

Print error message.

Definition at line 105 of file blast-parser-driver.h.

const result_type& rostlab::blast::parser_driver::parse ( bool  __trace_parsing = false,
bool  __trace_scanning = false 
) throw (rostlab::blast::parser_error)

Parse one result from the input stream.

Each call returns a reference to the filled result structure. The structure may be empty in case there are no more results in the stream.

Read-only access to results.

This method provides access to the last parsed results or an empty result structure if parse() was not yet called.

Definition at line 113 of file blast-parser-driver.h.

Get tracing of scanning.

Set tracing of scanning.


Friends And Related Function Documentation

friend class rostlab::blast::parser [friend]

Definition at line 60 of file blast-parser-driver.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines