Extended STL string
- Author:
- Keenan Tims - ktims@gotroot.ca
- Version:
- 0.2
- Date:
- 2005-04-17
ext_string aims to provide a portable, bug-free implementation of many useful extensions to the standard STL string class. These extensions are commonly available among higher-level languages such as Perl and Python, but C++ programmers are generally left on their own when it comes to basic string processing. By extending the STL's string, we can provide a drop-in replacement for STL strings with the greater functionality of higher-level languages.
The primary goal of this library is to make the STL string class more usable to programmers that are doing simple string manipulation on a small scale. Due to the usability goals of this class, many actions will be inefficiently implemented for the sake of ease of use. Some of this is mitigated somewhat by doing modification in-place, however many unnecessary copies of data are created by some methods, and the vector-returning methods are inefficient in that they copy the substrings into the vector, then return a copy of the vector. This would be much more efficient as an iterator model.
- Fully based on the STL, ext_string provides a superset of std::string methods
- String splitting (tokenizing), on a character, a string, or whitespace
- Replacement of substrings or characters with another string or character
- String case operations (check, adjust)
- Integer conversion
- Fully open-source under a BSD-like license for use in any product
Downloads are provided in tar.gz and zip formats containing this documentation, the header file, and the library's changelog. The latest version of ext_string is 0.2, released on April 17, 2005.
The changelog is viewable online here
- Copying all the substrings into a vector for the substring methods is pretty inefficient, both for space and time. It would be more prudent to model an iterator to split the string based on the specified parameters, but this is more difficult to implement and more cumbersome to use. Performance is not the main goal of this library, usability is, thus the tradeoff is deemed to be acceptable.
- References are not used too aptly in this class. Some performance tuning could be done to minimize unnecessary data copying.
- The basic methods of std::string aren't overridden by this class, thus assigning the return value of eg. string::insert() to an ext_string instance will make an unnecessary string object which is then copy-constructed to an ext_string (I believe, internal workings of inheritance and polymorphism in C++ are somewhat beyond my experience). These methods should be wrapped by ext_string to return the proper type.
Copyright (c) 2005, Keenan Tims All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the Extended STL String project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Generated on Sun Apr 17 05:08:48 2005 for Extended STL String by
1.4.1