|
|
/*============================================================================= Copyright (C) 2000 Silicon Tao Technology Systems E-mail: SupportWeb: www.silicontao.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =============================================================================*/ /*============================================================================= File Name: STStringsEx.h Object Name: STStringsEx Programmer Name: Roy Souther By Command of: Silicon Tao Technology Systems License: GNU general public license. See GNU. Day Zero: 02152000, Feburary 15, 2000 Target Platform: Linux Registors Used: Compiler Used: GNU g++ Compiled Settings: Resources Used: Libraries Used: alloc.h, string.h Ports Used: None Title of program: Object library Discription: Advanced string functionality. Soon to add Hex2Dec Hex2Bin Dex2Hex Dex2Bin Bin2Hex Bin2Dec LastPos ParseBlock ParseLargeBlock WildCardSearch ... Note: No e-mails about ANSI C++ string support please. When I needed these functions a long time ago there was no such thing as a string type. Thanks. =============================================================================*/ #ifndef STStringsEx_included #define STStringsEx_included #include #include #include // Needed for power function #include #include /** * Things you need to do to a string. * * @short Command string mangeling functions. */ class STStringsEx { public: // Global string for returns QString ReturnString; /** * This function returns the last position of a sub string in a string. * * I found that QString::find(QChar ,int ,bool) when the QChar is "/" and * int is a negitive like -1, it errors. I feel this is a bug in QString::find * but I decided to fix it this way. */ int LastPos(QString &SubString, QString &TheFullString); int LastPos(const char *SubString, QString &TheFullString); int LastPos(const char SubString, QString &TheFullString); QString stripChars(QString &TheString,char TheChar); /** * Removes any chars that are not alpha-numeric from the front and end * of the given string. */ QString stripClean(QString &TheString); /** * Converts a string of binary as text to a string of decimal as text. */ void Bin2Dec(QString &SourceString, QString &DestinationString); /** * Converts a string of decimal as text to a string of hex as text. */ void Dec2Hex(QString &SourceString, QString &DestinationString); /** * Converts a string of hex as text to a string of decimal as text. */ void Hex2Dec(QString &SourceString, QString &DestinationString); /** * */ void HexStr2Ascii(QString &SourceString, QString &DestinationString, bool MaskLow,bool MaskHi, char MaskChar); /** * */ int InsertCrLf(QString *InsertingToString, int SpaceNear, char CrLfChar); /** * */ void ParseIdentifier(QString &TheString, int IdentifierIndex); }; #endif // STStringsEx_included
Generated by: root on UtopiaPlanitia.Ept on Mon Dec 10 22:55:12 2001, using kdoc 2.0a53. |