Boost logo

Boost Users :

Subject: [Boost-users] Tokenizer design question
From: Polder, Matthew J (matthew.j.polder_at_[hidden])
Date: 2009-07-14 12:48:32


The Tokenizer library has a char_separator with the option to keep delimiters, drop delimiters, and keep or drop empty tokens. However, with escaped_list_separator, the only behavior is to keep empty tokens. While this is the obvious behavior for parsing csv and similar files, it would be nice to have the ability to also drop empty tokens when constructing an escaped_list_separator.

I have a command line parser that either reads its arguments from the command line itself or a text file supplied on the command line. In the file I'm passing in formats for the Date Time library I/O routines, and the formats have spaces that I'm escaping so the format will be a single token, which Tokenizer does find. But I sometimes use multiple tabs to separate my fields so it will look pretty in a text editor, and escaped_list_separator is keeping these. The solution for now is to have a switch in my command line parser for which separator I want to use.

thanks,
matthew



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net