00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00043
00044
00045
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 string_c format (char *, ... );
00137
00138 void setcase (bool );
00139 void uppercase ( );
00140 void lowercase ( );
00141 };
00142
00143 #endif