Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

oldstring.h

00001 // OMICRON ENGINE HEADER FILE
00002 //
00003 // --------------------------------------------------------------------------
00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de>
00005 //
00006 // This file is part of the Omicron Engine.
00007 //
00008 // The Omicron Engine is free software; you can redistribute it and/or modify
00009 // it under the terms of the  GNU General Public License  as published by the
00010 // Free Software Foundation;  either version  2  of the License,  or (at your
00011 // option) any later version.
00012 //
00013 // The Omicron Engine  is distributed in the hope that it will be useful, but
00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00015 // or  FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License
00016 // for more details.
00017 //
00018 // You should have  received a copy of the  GNU General Public License  along
00019 // with The Omicron Engine;  if not,  write to the  Free Software Foundation,
00020 // Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
00021 //
00022 // --------------------------------------------------------------------------
00023 // Last modified:       $Date: 2002/12/07 19:02:19 $
00024 // By           :       $Author: kolrabi $
00025 // $Id: oldstring.h,v 1.1.1.1 2002/12/07 19:02:19 kolrabi Exp $ 
00026 
00027 /*
00028 
00029   $Log: oldstring.h,v $
00030   Revision 1.1.1.1  2002/12/07 19:02:19  kolrabi
00031   initial release
00032 
00033 
00034 */
00035 
00043 /**************************************************************************** 
00044  **************************************************************************** 
00045  * TYPES ******************************************************************** 
00046  **************************************************************************** 
00047  ****************************************************************************/ 
00048 
00049 #include <stdarg.h>
00050  
00051 #ifndef             OMICRON_TYPES_STRING_DEFINED
00052 #define             OMICRON_TYPES_STRING_DEFINED
00053 
00054 typedef unsigned long ulong;
00055 typedef signed long slong;
00056 
00058 class string_c
00059 {
00060 private:
00061 
00062     char            *buf;               
00063     bool            casesensitive;      
00064 
00065 public:
00066 
00067     string_c();                         
00068     ~string_c();
00069 
00070     string_c(string_c &);               
00071     string_c(const char *);             
00072     string_c(long);                     
00073     string_c(float);                    
00074 
00075     operator char * ();                 
00076 
00078     string_c    operator    =   (const string_c &       );
00079     
00081     string_c    operator    =   (const char *           );
00082     
00084     string_c    operator    =   (long                   );
00085     
00087     string_c    operator    =   (float                  );
00088 
00089     string_c    operator    +=  (const string_c &       );
00090     string_c    operator    +=  (const char *           );
00091     string_c    operator    +=  (long                   );
00092     string_c    operator    +=  (float                  );
00093 
00095     string_c    operator    -=  (char                   );
00096 
00097     string_c    operator    +   (const string_c &       );
00098     string_c    operator    +   (const char *           );
00099     string_c    operator    +   (long                   );
00100     string_c    operator    +   (float                  );
00101 
00102     string_c    operator    -   (char                   );
00103 
00104     friend bool operator    ==  (string_c &, string_c & );
00105     friend bool operator    ==  (string_c &, char *     );
00106     friend bool operator    ==  (char *, string_c &     );
00107 
00108     slong       len             (                       );
00109     string_c    left            (slong                  );
00110     string_c    right           (slong                  );
00111     string_c    from            (slong                  );
00112     string_c    mid             (slong, slong           );
00113     void        insertbefore    (slong, char *          );
00114 
00115         void            trim                    (char *                                 );
00116         void            trimright               (char *                                 );
00117         void            trimleft                (char *                                 );
00118 
00119     slong       find            (char *                 );
00120     slong       findfrom        (slong, char *          );
00121     slong       findchar        (char                   );
00122     slong       findfromchar    (slong, char            );
00123 
00124     slong       rfindchar       (char                   );
00125 
00126     slong       findanyof       (char *                                 );
00127     slong       findanyoffrom   (slong, char *          );
00128 
00129     slong       findnoneof      (char *                                 );
00130     slong       findnoneoffrom  (slong, char *          );
00131 
00132     void        replace         (ulong, ulong, char *   );
00133     slong       compare         (char *                 );
00134     slong       comparei        (char *                 );
00135     void        formatv         (char *, va_list        );
00136     void        format          (char *, ...            );
00137 
00138         void            setcase                 (bool                                   );
00139         void            uppercase               (                                               );
00140         void            lowercase               (                                               );
00141 };
00142 
00143 #endif

Generated on Wed Dec 18 15:48:47 2002 for omicron engine by doxygen1.2.18