summaryrefslogtreecommitdiffstats
path: root/lanbrowsing/lisa/mystring.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /lanbrowsing/lisa/mystring.h
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lanbrowsing/lisa/mystring.h')
-rw-r--r--lanbrowsing/lisa/mystring.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/lanbrowsing/lisa/mystring.h b/lanbrowsing/lisa/mystring.h
new file mode 100644
index 00000000..20d40e59
--- /dev/null
+++ b/lanbrowsing/lisa/mystring.h
@@ -0,0 +1,42 @@
+#ifndef MYSTRING_H
+#define MYSTRING_H
+
+#include <string>
+#include <string.h>
+#include <strings.h>
+#include <stdio.h>
+
+class MyString: public std::string
+{
+ public:
+ MyString(const char c) : std::string(1,c) {};
+ MyString(const char* c)
+ : std::string(c==0?"":c)
+ {};
+ MyString(const std::string& s) : std::string(s) {};
+ MyString() : std::string() {};
+
+ int isEmpty() const {return empty();};
+ MyString mid(int pos, int length=-1) const {return substr(pos,length);};
+ MyString left(int len) const {return substr(0,len);};
+ MyString right(int len) const
+ {
+ if (len<1) return "";
+ else if (len<int(size())) return substr(size()-len);
+ else return (*this);
+ };
+
+ int contains(char c);
+ //char & operator[] (unsigned int i) {return ((string)(*this))[i];}
+ //operator const char* () const {return c_str();}
+ const char* data() const {return c_str();}
+ /*void setNum(int value) {char c[15]; bzero(c,15); sprintf(c,"%d",value); (*this)=c;};
+ void setNum(double value) {char c[25]; bzero(c,25); sprintf(c,"%g",value); (*this)=c;};
+ void simplifyWhiteSpace();*/
+};
+
+//taken from Qt/QCString
+MyString stripWhiteSpace(MyString str);
+
+#endif
+