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 #ifndef STRINGC_H
00027 #define STRINGC_H
00028
00029
00030 #include "kettec.h"
00031 #include <stdio.h>
00032 #include <stdlib.h>
00033
00034 #include "../oawconfig.h"
00035
00036 OAW_BEGIN_NAMESPACE
00037
00038 class StringC;
00039
00040
00041
00042 class OAW_DLLMAPPING StringC
00043 {
00044 public:
00045 StringC();
00046 StringC(long);
00047 StringC(const StringC& s);
00048 StringC(char ch);
00049 StringC(const char* s);
00050 StringC(const char* s,long);
00051 StringC(long,long);
00052 ~StringC();
00053 long size() const {return m_len;}
00054 void make_upr();
00055 void make_lwr();
00056 void format(const char *pFormat ...);
00057 long GetBlockLength() const {return m_blocklen;}
00058 long GetBufferLength() const {return m_buflen;}
00059 void SetBlockLength(long l){m_blocklen = l;}
00060 void SetBufferLength(long);
00061 void Empty(){m_len=0;m_str[0]='\0';}
00062 inline char& operator [](long i){return m_str[i];}
00063 StringC Right(long n) const;
00064 StringC Left(long n) const;
00065 StringC FromTo(long a,long e) const;
00066 StringC OnTheRightOfFirst(const StringC&) const;
00067 StringC OnTheRightOfFirst(StringC*,long,long& pos) const;
00068 StringC OnTheLeftOfFirst(StringC*,long,long& pos) const;
00069 StringC OnTheLeftOfFirst(const StringC&) const;
00070 StringC OnTheRightOfLast(const StringC&) const;
00071 StringC OnTheLeftOfLast(const StringC&) const;
00072 void Delete(const StringC&);
00073 void Replace(const StringC& s1, const StringC& s2);
00074 char GetAt(long i){return m_str[i];}
00075 const char* c_str() const{return m_str;}
00076
00077 StringC& operator = (const StringC&);
00078 StringC operator + (const StringC&);
00079 StringC operator + (const char&);
00080 StringC& operator += (const StringC&);
00081 StringC& operator += (const char&);
00082 int operator == (const StringC&) const;
00083 int operator != (const StringC&) const;
00084 int operator > (const StringC&) const;
00085 int operator < (const StringC&) const;
00086 int operator >= (const StringC&) const;
00087 int operator <= (const StringC&) const;
00088 void ConvertCGI();
00089 StringC InHTML();
00090 int ContainAnd(StringC*,long,short grkl = 1)const;
00091 int ContainOr(StringC*,long, short grkl = 1)const;
00092 int ContainAnd(KetteC<StringC*> kStr, short grkl = 1)const;
00093 int ContainOr(KetteC<StringC*> kStr, short grkl = 1)const;
00094 long Count(const StringC&)const;
00095 long Count(char) const;
00096 long ReadUntilFirst(StringC*,long, long& pos, StringC& sr)const;
00097 int ReadUntilFirst(const StringC& strI,long& pos,StringC& sr)const;
00098 long ReadUntilFirst(StringC*,long, long& pos)const;
00099 int ReadUntilFirst(const StringC& strI,long& pos)const;
00100 protected:
00101
00102 void Init(const char* s);
00103 protected:
00104 char *m_str;
00105 long m_len;
00106 long m_blocklen;
00107 long m_buflen;
00108 };
00109
00110
00111
00112
00113 OAW_DLLMAPPING StringC operator + (const StringC&, const StringC&);
00114
00115
00116 OAW_DLLMAPPING int CompareString( const void* elem1, const void* elem2 );
00117
00118 OAW_END_NAMESPACE
00120
00121
00122 #endif
00123
00124
00125
00126
00127
00128
00129
00130