librostlab-blast  1.0.1
Public Types | Public Member Functions | Friends | List of all members
rostlab::blast::parser_driver Class Reference

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

#include <blast-parser-driver.h>

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. More...
 
bool trace_scanning ()
 Get tracing of scanning. More...
 
void trace_scanning (bool __b)
 Set tracing of scanning. More...
 
void error (const rostlab::blast::location &__loc, const std::string __msg)
 Print error message for given location. More...
 
void error (const std::string __msg)
 Print error message. More...
 
const result_typeresult () const
 Read-only access to results. More...
 

Friends

class rostlab::blast::parser
 

Detailed Description

Blast (default, -m 0) output parser.

Example:

#include <iostream>
using namespace rostlab;
int main()
{
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 ( )
inlinevirtual

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.

const result_type& rostlab::blast::parser_driver::result ( ) const
inline

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.

bool rostlab::blast::parser_driver::trace_scanning ( )

Get tracing of scanning.

void rostlab::blast::parser_driver::trace_scanning ( bool  __b)

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: