#include <string.h>
// this is a simplified string class for older compilers
//  revised Feb, 22nd, 2001
#ifdef _STRING_
#define __CSTRING_H
#endif
#ifndef __CSTRING_H
#define __CSTRING_H
class string
{
    char thetext[256];
    public:
    string();
    string(char *);
    int operator==(string &);
    int operator==(char *);
    int operator<(string &);
    int operator>(string &);
    int operator<=(string &);
    int operator>=(string &);
    string operator+(string another);
    string operator+(char *);
    string operator=(string );
    string operator=(char *);
    const char * c_str();
    int len();
};
string::string()
{
   thetext[0]=0;
}
string::string(char *words)
{
   if(strlen(words)<256)
   {
      strcpy(thetext,words);
   }
   else
   {
      strcpy(thetext,"String is too long");
   }
}
int string::operator<(string &another)
{
   int result;
   result=strcmp(this->thetext,another.thetext);
   if(result==-1)return 1;
   return 0;
}
int string::operator==(string &another)
{
   if(strcmp(this->thetext,another.thetext)==0)return 1;
   return 0;
}
int string::operator==(char *theother)
{
   if(strcmp(this->thetext,theother)==0)return 1;
   return 0;
}
int string::operator>(string &another)
{
   int result;
   result=strcmp(this->thetext,another.thetext);
   if(result==1)return 1;
   return 0;
}
int string::operator<=(string &another)
{
    if(!(*this>another))return 1;
    return 0;
}
int string::operator>=(string &another)
{
    if(!(*this<another))return 1;
    return 0;
}
string string::operator=(string another)
{
    strcpy(thetext,another.thetext);
    return *this;
}
string string::operator=(char *theother)
{
    if(strlen(theother)<255)
    {
      strcpy(thetext,theother);
    }
    else
    {
      strcpy(thetext,"String is too long");
    }
    return *this;
}
const char * string::c_str()
{
    return thetext;
}
int string::len()
{
    return strlen(thetext);
}
string string::operator+(string another)
{
    if((strlen(thetext)+strlen(another.thetext))<255)
    {
      strcat(thetext,another.thetext);
    }
    else
    {
       strcpy(thetext,"String is too long");
    }
    return *this;
}
string string::operator+(char *theother)
{
    if((strlen(thetext)+strlen(theother))<255)
    strcat(thetext,theother);
    else
    strcpy(thetext,"String is too long");
    return *this;
}
#endif
