DeprecatedCString.h [plain text]
#ifndef DEPRECATEDCSTRING_H_
#define DEPRECATEDCSTRING_H_
#include "DeprecatedArray.h"
#include <string.h>
namespace WebCore {
class DeprecatedCString : public DeprecatedByteArray {
public:
DeprecatedCString();
DeprecatedCString(int);
DeprecatedCString(const char *);
DeprecatedCString(const char *, unsigned);
DeprecatedCString &operator=(const char *);
bool isEmpty() const;
bool isNull() const { return data() == 0; }
int find(const char *, int index=0, bool cs=true) const;
int contains(char, bool cs=true) const;
unsigned length() const;
bool truncate(unsigned);
DeprecatedCString lower() const;
DeprecatedCString upper() const;
DeprecatedCString left(unsigned) const;
DeprecatedCString right(unsigned) const;
DeprecatedCString mid(unsigned, unsigned len=0xffffffff) const;
DeprecatedCString &append(char);
DeprecatedCString &append(const char *);
DeprecatedCString &replace(char, char);
operator const char *() const { return data(); }
DeprecatedCString &operator+=(const char *s) { return append(s); }
DeprecatedCString &operator+=(char c) { return append(c); }
private:
bool resize(unsigned);
};
bool operator==(const DeprecatedCString &s1, const char *s2);
inline bool operator==(const char *s1, const DeprecatedCString &s2) { return s2 == s1; }
inline bool operator!=(const DeprecatedCString &s1, const char *s2) { return !(s1 == s2); }
inline bool operator!=(const char *s1, const DeprecatedCString &s2) { return !(s1 == s2); }
}
#endif