Group File Format Tokenization
Helper code for tokenization when reading from RecordReader.

Grouped Function Overview

Grouped Functions Detail

int readAlphaNums(buffer, reader);

Defined in
<seqan/tokenize.h>
Read from a RecordReader as long as the characters are alphanumeric (in alnum class).

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readDigits(buffer, reader);

Defined in
<seqan/tokenize.h>
Read from a RecordReader as long as the characters are digits (in digit class).

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readDna5IgnoringWhitespaces(buffer, reader);

Defined in
<seqan/stream.h>
Read characters from stream as long as they are DNA5 characters, skipping whitespaces.

Parameters

buffer The String to append the read data to.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the first non-matching character, whitespaces such as newlines are discarded.

int readFloat(buffer, reader);

Defined in
<seqan/tokenize.h>
Read characters from RecordReader as long as the string is a valid floating point numbers.

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readGraphs(buffer, reader);

Defined in
<seqan/tokenize.h>
Read from a RecordReader as long as the characters are printable (in graph class).

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readIdentifier(buffer, reader);

Defined in
<seqan/tokenize.h>
Read from a RecordReader as long as the characters form an identifier (alnum, '-', '_').

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readLetters(buffer, reader);

Defined in
<seqan/tokenize.h>
Read from a RecordReader as long as the characters are letters (in alpha class).

Parameters

buffer The String to read the data into.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The function will stop after the last read character.

Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readLine(buffer, reader);

Defined in
<seqan/stream.h>
Read a line from a RecordReader into a buffer.

Parameters

buffer The String to append the read data to.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the beginning of the next line (if there is any). End of line characters are not written to buffer. Works on ANSI, Mac, and Unix EOL.

int readLineStripTrailingBlanks(buffer, reader);

Defined in
<seqan/stream.h>
Read a line from a RecordReader into a buffer and remove trailing blanks.

Parameters

buffer The String to append the read data to.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the beginning of the next line (if there is any). End of line characters and all trailing whitespaces are not written to buffer. Works on ANSI, Mac, and Unix EOL.

int readUntilChar(buffer, reader, n);

Defined in
<seqan/stream.h>
Read fixed number of characters from stream into buffer until a given character is read.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.
n The number of characters to read. Type: unsigned.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops after n read characters. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readUntilChar(buffer, reader, n);

Defined in
<seqan/stream.h>
Read fixed number of non-whitespace characters.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.
n The number of non-whitespace characters to read. Type: unsigned.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

Whitespace is more than ' ' and '\t', see isspace.

This function stops after n read non-whitespace characters. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readUntilBlank(buffer, reader);

Defined in
<seqan/stream.h>
Read characters from stream into buffer until a blank is encountered.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the found character and the character itself is not written to the buffer. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readUntilChar(buffer, reader, c);

Defined in
<seqan/stream.h>
Read characters from stream into buffer until a given character is read.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.
c The char to look for.

Returns

int 0 if there was no error and non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the found character and the character itself is not written to the buffer. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readUntilOneOf(buffer, reader, c1[, c2[, c3[, c4[, c5]]]]);

Defined in
<seqan/stream.h>
Read characters from RecordReader into buffer until one of the given character is encountered.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.
c1 One of the characters to look for. Type: char.
c2 One of the characters to look for. Type: char.
c3 One of the characters to look for. Type: char.
c4 One of the characters to look for. Type: char.
c5 One of the characters to look for. Type: char.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the found character and the character itself is not written to the buffer. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int readUntilBlank(buffer, reader);

Defined in
<seqan/stream.h>
Read characters from stream into buffer until a whitespace is encountered.

Parameters

buffer The buffer to write to. Type: SequenceConcept.
reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

Whitespace is more than ' ' and '\t', see isspace. Consider using readUntilBlank for reading until space or tab.

This function stops on the found character and the character itself is not written to the buffer. Note that even when an error occurs, buffer will contain the characters read until the error (or EOF) occured.

int skipBlanks(reader);

Defined in
<seqan/stream.h>
Advance RecordReader until a blank occurs.

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops after the last skipped.

int skipChar(reader, c);

Defined in
<seqan/stream.h>
Skip one character that must be equal to a given one for this function to succeed.

Parameters

reader The RecordReader to read from.
c The char to skip.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

int skipLine(reader);

Defined in
<seqan/stream.h>
Skip a line in stream and go to beginning of next

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the beginning of the next line, if there is a next line

Works on ANSI EOL and on Unix EOL.

int skipNChars(reader, n);

Defined in
<seqan/stream.h>
Skip a fixed number of characters.

Parameters

reader The RecordReader to read from.
n The number of characters to read. Type: unsinged.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

int skipNChars(reader, n);

Defined in
<seqan/stream.h>
Skip a fixed number of non-whitespace characters.

Parameters

reader The RecordReader to read from.
n The number of characters to read. Type: unsinged.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

Whitespace is more than ' ' and '\t', see isspace.

int skipTabOrLineBreak(reader);

Defined in
<seqan/stream.h>
Skip over tab or line break characters ('\r' or '\n').

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The reader will stop behind the (possibly empty) sequence of tab or line break characters (regex: [\r\n\t]).

int skipUntilBlank(reader);

Defined in
<seqan/stream.h>
Skip until the first blank character is encountered.

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The reader will stop on the first blank character.

int skipUntilChar(reader, c);

Defined in
<seqan/stream.h>
Skip until the a given character is found.

Parameters

reader The RecordReader to read from.
c The char to search for.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The reader will stop on the first found location of c.

int skipUntilGraph(reader);

Defined in
<seqan/stream.h>
Skip until the first printable character is encountered.

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The reader will stop on the first printable character.

See Also

int skipUntilLineBeginsWithChar(reader, c);

Defined in
<seqan/stream.h>
Skip input until the first graphical (see isgraph) character of a line is equal to c.

Parameters

reader The RecordReader to read from.
c The char to look for.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the first occurence of c at the beginning of a line (ignoring leading whitespace).

int skipUntilLineBeginsWithOneCharOfStr(reader, str);

Defined in
<seqan/stream.h>
Skip input until a line begins with one of the character in str.

Parameters

reader The RecordReader to read from.
str The SequenceConcept with the characters to look for.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops on the first found occurence. All characters in str must be printable (see isgraph).

int skipUntilLineBeginsWithChar(reader, str);

Defined in
<seqan/stream.h>
Skip input until a line begins with str (str itself must begin with a printable character).

Parameters

reader The RecordReader to read from.
c The SequenceConcept to look for.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

This function stops behind the first occurence of str at the beginning of a line. The function skips over leading whitespace.

int skipUntilString(reader, str);

Defined in
<seqan/stream.h>
Skip until the a given string is found.

Parameters

reader The RecordReader to read from.
str The SequenceConcept to find.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

The reader will stop behind the location of str.

int skipUntilWhitespace(reader);

Defined in
<seqan/stream.h>
Skip until the first whitespace character is encountered.

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

Whitespace is more than ' ' and '\t', see isspace. Consider using skipUntilBlank for skipping until space or tab.

The reader will stop on the first whitespace character.

int skipWhitespaces(reader);

Defined in
<seqan/stream.h>
Advance RecordReader until a whitespace occurs.

Parameters

reader The RecordReader to read from.

Returns

int 0 if there was no error on reading or non-0 if there were errors. A special value is EOF_BEFORE_SUCCESS.

Remarks

Whitespace is more than ' ' and '\t', see isspace. Consider using skipBlanks for skipping blanks.

This function stops after the last skipped.