home *** CD-ROM | disk | FTP | other *** search
- // ------------------------------- //
- // -------- Start of File -------- //
- // ------------------------------- //
- // ----------------------------------------------------------- //
- // C++ Header File Name: strutil.h
- // Compiler Used: MSVC40, DJGPP 2.7.2.1, GCC 2.7.2.1, HP CPP 10.24
- // Produced By: Doug Gaer
- // File Creation Date: 12/16/1997
- // Date Last Modified: 03/30/1999
- // Copyright (c) 1997 Douglas M. Gaer
- // ----------------------------------------------------------- //
- // ---------- Include File Description and Details ---------- //
- // ----------------------------------------------------------- //
- /*
- The VBD C++ classes are copyright (c) 1997, by Douglas M. Gaer.
- All those who put this code or its derivatives in a commercial
- product MUST mention this copyright in their documentation for
- users of the products in which this code or its derivative
- classes are used. Otherwise, you have the freedom to redistribute
- verbatim copies of this source code, adapt it to your specific
- needs, or improve the code and release your improvements to the
- public provided that the modified files carry prominent notices
- stating that you changed the files and the date of any change.
-
- THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
- THE ENTIRE RISK OF THE QUALITY AND PERFORMANCE OF THIS SOFTWARE
- IS WITH YOU. SHOULD ANY ELEMENT OF THIS SOFTWARE PROVE DEFECTIVE,
- YOU WILL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
- CORRECTION.
-
- General string utility functions use to manipulate and parse
- null-terminated character strings.
-
- Changes:
- ================================================================
- 11/12/1998 - Added the FindMatch() string searching function to
- find matching patterns in strings.
-
- 11/12/1998: - Added the IFindMatch() string searching function to
- find matching patterns in strings without comparing the case.
- */
- // ----------------------------------------------------------- //
- #ifndef __STRUTIL_HPP
- #define __STRUTIL_HPP
-
- // Set this macro DOS and Windows applications
- // #ifndef __DOS__
- // #define __DOS__
- // #endif
-
- // Set this macro Generic Unix applications
- // #ifndef __UNIX__
- // #define __UNIX__
- // #endif
-
- // String concatenation routines
- char *StringCat(const char *s1=" ", const char *s2= " ", const char *s3=" ");
- char *StringCat(char *s1=" ", char *s2= " ", char *s3=" ");
-
- // General purpose string parser
- const int MAXWORDLENGTH = 255;
- const int MAXWORDS = 255;
-
- int parse(char *string, char words[MAXWORDS][MAXWORDLENGTH],
- int*numwords, char sepchar);
-
- // Case insensitive string compare that need to be ported from UNIX to DOS
- int CaseICmp(const char *s1, const char *s2);
- int CaseICmp(char *s1, char *s2);
-
- // String searching functions
- const int NOMATCH = -1;
- int FindMatch(const char *str, const char *p, unsigned offset = 0);
- int FindMatch(char *str, char *p, unsigned offset = 0);
- int IFindMatch(const char *str, const char *p, unsigned offset = 0);
- int IFindMatch(char *str, char *p, unsigned offset = 0);
-
- #endif // __MAIN_HPP //
- // ----------------------------------------------------------- //
- // ------------------------------- //
- // --------- End of File --------- //
- // ------------------------------- //
-