idaeim studio
 Strings

The idaeim Strings Library

The Strings group of utilities includes general purpose classes to aid in the manipulation of character strings.

String is a subclass of the STL string (basic_string<char>) class. It contains miscellaneous convenience methods; i.e. it is the repository for string operations and manipulation capabilities that typically accumulate during most programming projects.

Sliding_String is a subclass of String. It presents a virtual String backed by an istream (it also provides a copy constructor from an existing String/string for consistency of use). While characters in a String are at an Index that is relative to the beginning of the String and ends at the end of the String, characters in a Sliding_String are at a Location that is relative to the first character placed in the Sliding_String from its character source and ends at the last character available from the source. A Sliding_String is typically constructed from an istream source (a string may be used to construct a Sliding_String, but this is little more than a String). Characters are only read from the istream source into the Sliding_String as needed. A set of methods to search for character patterns from, or just obtain characters at, Locations will extended the Sliding_String contents to include the character Locations by reading characters from the istream into the Sliding_String (in user defined increments). In addition, when some leading portion of a Sliding_String has been processed (e.g. by a parser) and is no longer needed, the head of the Sliding_String may be moved forward to some Location and the characters before this Location will be removed from the Sliding_String. Thus the user works with a virtual String that slides forward at the end, by automatically reading characters as needed, and slides forward at the head, by dropping characters that are no longer needed. The end of the character source may be the end of the istream, but it may also be a user defined limit or conditional on encountering a sequence (of user defined length) of non-text data bytes in the istream (as would occur after a text label of a binary image data file). Filters implementing the String_Filter interface may be registered with the Sliding_String so that every time it slides forward the new data will be passed through them. String_Filters are provided for recognizing and rectifying VMS binary-sized record files and tracking the Location of all line breaks.


Copyright (C) 2002 - 2010 Bradford Castalia

The idaeim libraries are free software; you can redistribute them and/or modify them under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The idaeim libraries are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Contact

Bradford Castalia
Systems Analyst
idaeim
712 N. Seventh Ave.
Tucson, Arizona 85705
Castalia@idaeim.com

"Build an image in your mind, fit yourself into it."