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

Load an int_list of PODs/objects from a config file. More...

#include <mbl/mbl_exception.h>
#include <vcl_istream.h>
#include <vcl_cctype.h>

Go to the source code of this file.

Functions

template<class ITER , class T >
void mbl_parse_int_list (vcl_istream &afs, ITER insert_iter, T)
 Read a list of integers from a stream.

Detailed Description

Load an int_list of PODs/objects from a config file.

Author:
Ian Scott
Date:
7-Aug-2007

Definition in file mbl_parse_int_list.h.


Function Documentation

template<class ITER , class T >
void mbl_parse_int_list ( vcl_istream &  afs,
ITER  insert_iter,
 
) [inline]

Read a list of integers from a stream.

This integer list should be space-separated. Lists of the form "{ 1 2 5 : 10 }" a la matlab are accepted. Note that "a : b" will include b rather than following normal C++ convention. Failed parsing will cause an exception to be thrown, and the stream's fail bit to be set

Exceptions:
mbl_exception_parse_errorif unrecoverable parse error.
   Example:
   vcl_vector<unsigned> v;
   mbl_parse_int_list(vcl_cin, vcl_back_inserter(v), unsigned());
   

Definition at line 28 of file mbl_parse_int_list.h.