Functions
contrib/mul/mbl/mbl_parse_block.h File Reference

Load a block of text from a file. More...

#include <vcl_istream.h>
#include <vcl_string.h>

Go to the source code of this file.

Functions

vcl_string mbl_parse_block (vcl_istream &afs, bool open_already=false, const char *comment="//")
 Read a block of text from a stream.

Detailed Description

Load a block of text from a file.

Author:
Ian Scott
Date:
25-Feb-2003

Definition in file mbl_parse_block.h.


Function Documentation

vcl_string mbl_parse_block ( vcl_istream &  afs,
bool  open_already,
const char *  comment 
)

Read a block of text from a stream.

This function will read through a stream, and store the text found to a string. The function terminates when it finds the closing brace.

The stream's fail bit will be set on error. Comment lines beginning with // will be ignored.

Parameters:
open_alreadyshould be true if the client has already read the opening brace.
Returns:
the text. The first and last characters are guaranteed to be the opening and closing braces.

This function will read through a stream, and store the text found to a string. The function terminates when it finds the closing brace.

The stream's fail bit will be set on error. Comment lines beginning with // will be stripped.

Parameters:
open_alreadyshould be true if the client has already read the opening brace. If set to false and the first non-whitespace character is not an opening brace then that character will be left in the stream and "{} will be returned.
Returns:
the text including the opening and closing braces.
Parameters:
commentLines beginning with white space followed by this string will be ignored.
Exceptions:
mbl_exception_parse_block_parse_errorif unrecoverable parse error. Set to empty for no comment stripping.

The last character to be read from the stream.

Definition at line 28 of file mbl_parse_block.cxx.