#ifndef _LSTRING_H_
#define _LSTRING_H_
#include <stddef.h>
#include "system_specific.h"
class String;
class LStringInner
{
private:
LStringInner(const LStringInner&);
LStringInner &operator=(const LStringInner&);
public:
LStringInner(const char *str,int ord);
~LStringInner();
int len;
int ordinal;
char *pStr;
LStringInner *lower;
LStringInner *higher;
};
class LString {
LStringInner *m_p;
protected:
public:
LString(void);
LString(const char *pStr);
LString(const LString& lstring) : m_p(lstring.m_p) {}
LString(const String &x);
unsigned size() const {if (m_p) return m_p->len; else return 0;}
unsigned length() const {if (m_p) return m_p->len; else return 0;}
inline const char *c_str() const { if (m_p)return m_p->pStr;else return 0;}
inline operator const char*() const { if (m_p)return m_p->pStr;else return 0;}
String operator+(const LString& lstring2) const;
inline bool operator==(const LString &lstring) const { return (m_p == lstring.m_p);}
inline bool operator!=(const LString &lstring) const { return (m_p != lstring.m_p);}
LString& operator=(const LString &lstring) {m_p = lstring.m_p;return *this;}
bool operator <(const LString &lstring) const;
int get_ordinal() const {if (m_p)return m_p->ordinal;return 0;}
static bool exists(const char *str);
// Removed to reduce clutter when debugging - use the global
// static const LString emptyString;
};
size_t hash( const LString s );
#ifdef MSVC
#ifdef COMMON_EXPORTS
#define extern extern DLLEXPORT
#else
#define extern extern DLLIMPORT
#endif
#endif
extern const LString emptyLString;
#undef extern
#endif