1. Trang chủ
  2. » Công Nghệ Thông Tin

HandBooks Professional Java-C-Scrip-SQL part 34 pps

5 101 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Nội dung

String and Text Processing Boost.Regex Regular expressions are essential for solving a great number of pattern-matching problems. They are often used to process large strings, find inexact substrings, tokenize a string depending on some format, or modify a string based on certain criteria. The lack of regular expressions support in C++ has sometimes forced users to look at other languages known for their powerful regular expression support, such as Perl, awk, and sed. Regex provides efficient and powerful regular expression support, designed on the same premises as the Standard Template Library (STL), which makes it intuitive to use. Regex has been accepted for the upcoming Library Technical Report. For more information, see "Library 5: Regex." The author of Regex is Dr. John Maddock. Boost.Spirit The Spirit library is a functional, recursive-decent parser generator framework. With it, you can create command-line parsers, even a language preprocessor. [1] It allows the programmer to specify the grammar rules directly in C++ code, using (an approximation of) EBNF syntax. Parsers are typically hard to write properly, and when targeted at a specific problem, they quickly become hard to maintain and understand. Spirit avoids these problems, while giving the same or nearly the same performance as a hand-tuned parser. [1] The Wave library illustrates this point by using Spirit to implement a highly conformant C++ preprocessor. The author of Spirit is Joel de Guzman, together with a team of skilled programmers. Boost.S tring_algo This is a collection of string-related algorithms. There are a number of useful algorithms for converting case, trimming strings, splitting strings, finding/replacing, and so forth. This collection of algorithms is an extension to those in the C++ Standard Library. The author of String_algo is Pavol Droba. Boost.Tokenizer This library offers ways of separating character sequences into tokens. Common parsing tasks include finding the data in delimited text streams. It is beneficial to be able to treat such a sequence as a container of elements, where the elements are delimited according to user-defined criteria. Parsing is a separate task from operating on the elements, and it is exactly this abstraction that is offered by Tokenizer. The user determines how the character sequence is delimited, and the library finds the tokens as the user requests new elements. The author of Tokenizer is John Bandela. Data Structures, Containers, Iterators, and Algorithms Boost.Any The Any library supports typesafe storage and retrieval of values of any type. When the need for a variant type arises, there are three possible solutions:  Indiscriminate types, such as void*. This solution can almost never be made typesafe; avoid it like the plague.  Variant typesthat is, types that support the storage and retrieval of a set of types.  Types that support conversions, such as between string types and integral types. Any implements the second solutiona value- based variant type, with an unbounded set of possible types. The library is often used for storing heterogeneous types in Standard Library containers. Read more in "Library 6: Any." The author of Any is Kevlin Henney. Boost.Array This library is a wrapper around ordinary C- style arrays, augmenting them with the functions and typedefs from the Standard Library containers. In effect, this makes it possible to treat ordinary arrays as Standard Library containers. This is useful because it adds safety without impeding efficiency and it enables uniform syntax for Standard Library containers and ordinary arrays. The latter means that it enables the use of ordinary arrays with most functions that require a container type to operate on. Array is typically used when performance issues mandate that ordinary arrays be used rather than std::vector. The author of Array is Nicolai Josuttis, who built the library upon ideas brought forth by Matt Austern and Bjarne Stroustrup. Boost.Compressed_pair This library consists of a single parameterized type, compressed_pair, which is very similar to the Standard Library's std::pair. The difference from std::pair is that boost::compressed_pair evaluates the template arguments to see if one of them is empty and, if so, uses the empty base optimization to compress the size of the pair. Boost.Compressed_pair is used for storing a pair, where one or both of the types is possibly empty. The authors of Compressed_pair are Steve Cleary, Beman Dawes, Howard Hinnant, and John Maddock. Boost.Dynamic_bitset The Dynamic_bitset library very closely resembles std::bitset, except that whereas std::bitset is parameterized on the number of bits (that is, the size of the container), boost::dynamic_bitset supports runtime size configuration. Although dynamic_bitset supports the same interface as std::bitset, it adds functions that support runtime-specific functionality and some that aren't available in std::bitset. The library is typically used instead of std::bitset , in scenarios where the size of the bitset isn't necessarily known at compile time, or may change during program execution. The authors of Dynamic_bitset are Jeremy Siek and Chuck Allison. Boost.Graph Graph is a library for processing graph structures, using a design heavily influenced by the STL. It is generic and highly configurable, and includes different data structures: adjacency lists, adjacency matrices, and edge lists. Graph also provides a large number of graph algorithms, such as Dijsktra's shortest path, Kruskal's minimum spanning tree, topological sort, and many more. The authors of Graph are Jeremy Siek, Lie-Quan Lee, and Andrew Lumsdaine. Boost.Iterator This library provides a framework for creating new itera tor types, and it also offers a number of useful iterator adaptors beyond those defined by the C++ Standard. Creating new iterator types that conform to the standard is a difficult and tedious task. Iterator simplifies that task by automating most of the details, such as providing the required typedefs. Iterator also makes it possible to adapt an existing iterator type to give it new behavior. For example, the indirect iterator adaptor applies an extra dereferencing operation, making it possible to treat a container of pointers (or smart pointers) to a type as if it contained objects of that type. The authors of Iterator are Jeremy Siek, David Abrahams, and Thomas Witt. Boost.MultiArray MultiArray provides a multidimensional container that closely resembles the Standard Library containers and is more effective, efficient, and straightforward than vectors of vectors. The dimensions of the container are set at declaration time, but there is support for slicing and projecting different views, and also runtime resizing of the dimensions. The author of MultiArray is Ronald Garcia. Boost.Multi -index Multi- index offers multiple indices into an underlying container. This means that it is possible to have different sorting orders and different access semantics for one underlying container. Boost.Multi-index is used when std::set and std::map isn't enough, often due to the need of maintaining multiple indices for efficient element retrieval. The author of Multi-index is Joaquín M López Muñoz. Boost.Range This library is a collection of concepts and utilities for ranges. Rather than having algorithms be specified in terms of pairs of iterators for denoting ranges, using ranges greatly simplifies the use of algorithms and raises the abstraction level of user code. The author of Range is Thorsten Ottosen. Boost.Tuple Pairs are available in Standard C++ (from the class template std::pair), but there is currently no support for n-tuples. Enter Tuple. Unlike when using structs or classes for defining n-tuples, the class template tuple supports direct declaration and use as function return type or argument, and provides a generic way of accessing the tuple's elements. See "Library 8: Tuple 8" for the details of this great library. Tuple has been accepted for the upcoming Library Technical Report. The author of Tuple is Jaakko Järvi. Boost.Variant The Variant library contains a generic discriminated union class for storing and manipulating an object from a set of heterogeneous types. A unique feature of the library is the support for type- safe visitation, which alleviates the common problem of type-switching code for variant data types. The authors of Variant are Eric Friedman and Itay Maman.

Ngày đăng: 06/07/2014, 03:20