1 2 3 4# [Boost.Tokenizer](http://boost.org/libs/tokenizer) 5 6 7 8Boost.Tokenizer is a part of [Boost C++ Libraries](http://github.com/boostorg). The Boost.Tokenizer package provides a flexible and easy-to-use way to break a string or other character sequence into a series of tokens. 9 10## License 11 12Distributed under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt). 13 14## Properties 15 16* C++03 17* Header-Only 18 19## Build Status 20 21Branch | Travis | Appveyor | Coverity Scan | codecov.io | Deps | Docs | Tests | 22:-------------: | ------ | -------- | ------------- | ---------- | ---- | ---- | ----- | 23[`master`](https://github.com/boostorg/tokenizer/tree/master) | [![Build Status](https://travis-ci.org/boostorg/tokenizer.svg?branch=master)](https://travis-ci.org/boostorg/tokenizer) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME-vc81nhd5i2f6hi8y/branch/master?svg=true)](https://ci.appveyor.com/project/jeking3/tokenizer-c6pnd/branch/master) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/15854/badge.svg)](https://scan.coverity.com/projects/boostorg-tokenizer) | [![codecov](https://codecov.io/gh/boostorg/tokenizer/branch/master/graph/badge.svg)](https://codecov.io/gh/boostorg/tokenizer/branch/master)| [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/tokenizer.html) | [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](http://www.boost.org/doc/libs/master/doc/html/tokenizer.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](http://www.boost.org/development/tests/master/developer/tokenizer.html) 24[`develop`](https://github.com/boostorg/tokenizer/tree/develop) | [![Build Status](https://travis-ci.org/boostorg/tokenizer.svg?branch=develop)](https://travis-ci.org/boostorg/tokenizer) | [![Build status](https://ci.appveyor.com/api/projects/status/FIXME-vc81nhd5i2f6hi8y/branch/develop?svg=true)](https://ci.appveyor.com/project/jeking3/tokenizer-c6pnd/branch/develop) | [![Coverity Scan Build Status](https://scan.coverity.com/projects/15854/badge.svg)](https://scan.coverity.com/projects/boostorg-tokenizer) | [![codecov](https://codecov.io/gh/boostorg/tokenizer/branch/develop/graph/badge.svg)](https://codecov.io/gh/boostorg/tokenizer/branch/develop) | [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/tokenizer.html) | [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](http://www.boost.org/doc/libs/develop/doc/html/tokenizer.html) | [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](http://www.boost.org/development/tests/develop/developer/tokenizer.html) 25 26 27## Overview 28 29 30> break up a phrase into words. 31 32 <a target="_blank" href="http://melpon.org/wandbox/permlink/kZeKmQAtqDlpn8if">![Try it online][badge.wandbox]</a> 33 34```c++ 35#include <iostream> 36#include <boost/tokenizer.hpp> 37#include <string> 38 39int main(){ 40 std::string s = "This is, a test"; 41 typedef boost::tokenizer<> Tok; 42 Tok tok(s); 43 for (Tok::iterator beg = tok.begin(); beg != tok.end(); ++beg){ 44 std::cout << *beg << "\n"; 45 } 46} 47 48``` 49 50> Using Range-based for loop (>c++11) 51 52 <a target="_blank" href="http://melpon.org/wandbox/permlink/z94YLs8PdYSh7rXz">![Try it online][badge.wandbox]</a> 53```c++ 54#include <iostream> 55#include <boost/tokenizer.hpp> 56#include <string> 57 58int main(){ 59 std::string s = "This is, a test"; 60 boost::tokenizer<> tok(s); 61 for (auto token: tok) { 62 std::cout << token << "\n"; 63 } 64} 65``` 66 67## Documentation 68 69Documentation can be found at [Boost.Tokenizer](http://boost.org/libs/tokenizer) 70 71## Related Material 72[Boost.Tokenizer](http://theboostcpplibraries.com/boost.tokenizer) Chapter 10 at theboostcpplibraries.com, contains several examples including **escaped_list_separator**. 73 74##Contributing 75 76>This library is being maintained as a part of the [Boost Library Official Maintainer Program](http://beta.boost.org/community/official_library_maintainer_program.html) 77 78 79Open Issues on <a target="_blank" href="https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=tokenizer&col=id&col=summary&col=status&col=owner&col=type&col=milestone&order=priority">![][badge.trac]</a> 80 81 82 83##Acknowledgements 84>From the author: 85> 86I wish to thank the members of the boost mailing list, whose comments, compliments, and criticisms during both the development and formal review helped make the Tokenizer library what it is. I especially wish to thank Aleksey Gurtovoy for the idea of using a pair of iterators to specify the input, instead of a string. I also wish to thank Jeremy Siek for his idea of providing a container interface for the token iterators and for simplifying the template parameters for the TokenizerFunctions. He and Daryle Walker also emphasized the need to separate interface and implementation. Gary Powell sparked the idea of using the isspace and ispunct as the defaults for char_delimiters_separator. Jeff Garland provided ideas on how to change to order of the template parameters in order to make tokenizer easier to declare. Thanks to Douglas Gregor who served as review manager and provided many insights both on the boost list and in e-mail on how to polish up the implementation and presentation of Tokenizer. Finally, thanks to Beman Dawes who integrated the final version into the boost distribution. 87 88##License 89Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 90 91 92[badge.Wandbox]: https://img.shields.io/badge/try%20it-online-blue.svg 93[badge.Trac]:https://svn.boost.org/htdocs/common/trac_logo_mini.png 94 95