Boost.org tokenizer module
Go to file
Alexander Grund 90106f155b
Fix ccache saving on cache hit (#24)
See boostorg/boost-ci#166
2022-06-24 08:55:31 -07:00
.github/workflows Fix ccache saving on cache hit (#24) 2022-06-24 08:55:31 -07:00
doc Fix URL in documentation 2019-02-18 15:14:03 -05:00
example Add CI framework and move docs and examples into subdirectories 2018-05-28 21:50:14 -04:00
include/boost Cease dependence on MPL 2022-04-27 20:09:53 -04:00
meta [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. (#21) 2021-01-21 16:35:46 -05:00
test Switch from deprecated test to Lightweight Test 2021-06-07 21:58:05 -04:00
.appveyor.yml Align to Boost.CI 2022.04 2022-04-27 18:02:30 -04:00
.codecov.yml Align to Boost.CI 2022.04 2022-04-27 18:02:30 -04:00
.gitattributes
CMakeLists.txt Add CMakeLists.txt 2021-05-28 00:33:47 +03:00
Jamfile Add CI framework and move docs and examples into subdirectories 2018-05-28 21:50:14 -04:00
LICENSE Add CI framework and move docs and examples into subdirectories 2018-05-28 21:50:14 -04:00
README.md Align to Boost.CI 2022.04 2022-04-27 18:02:30 -04:00
index.html Add CI framework and move docs and examples into subdirectories 2018-05-28 21:50:14 -04:00

README.md

Boost.Tokenizer

Boost.Tokenizer is a part of Boost C++ Libraries. 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.

License

Distributed under the Boost Software License, Version 1.0.

Properties

  • C++03
  • Header-Only

Build Status

Branch GHA CI Appveyor Coverity Scan codecov.io Deps Docs Tests
master Build Status Build status Coverity Scan Build Status codecov Deps Documentation Enter the Matrix
develop Build Status Build status Coverity Scan Build Status codecov Deps Documentation Enter the Matrix

Overview

break up a phrase into words.

Try it online

#include <iostream>
#include <boost/tokenizer.hpp>
#include <string>

int main(){
    std::string s = "This is,  a test";
    typedef boost::tokenizer<> Tok;
    Tok tok(s);
    for (Tok::iterator beg = tok.begin(); beg != tok.end(); ++beg){
        std::cout << *beg << "\n";
    }
}

Using Range-based for loop (>c++11)

Try it online

#include <iostream>
#include <boost/tokenizer.hpp>
#include <string>

int main(){
    std::string s = "This is,  a test";
    boost::tokenizer<> tok(s);
    for (auto token: tok) {
        std::cout << token << "\n";
    }
}

Documentation

Documentation can be found at Boost.Tokenizer

Boost.Tokenizer Chapter 10 at theboostcpplibraries.com, contains several examples including escaped_list_separator.

##Contributing

This library is being maintained as a part of the Boost Library Official Maintainer Program

Open Issues on

##Acknowledgements

From the author:

I 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.

##License Distributed 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)