#ifndef EXSTRING
#define EXSTRING

const int EXSTRINGSIZE=1500000;                 //permanent length of a string

class exstring                         //basically a ripoff of apstring with a
{                                      //handful of changes
   public:
      inline exstring() {mylength=0; mystring=new char[EXSTRINGSIZE]; mystring[mylength]='\0';};
         //default constructor
         //allocates memory and sets default string to ""

      inline ~exstring() {delete[] mystring;};
         //deconstructor

      void readfile(char* target);
         //reads in an entire file to string
         //is passed a c-style string, the name of the target file to open
         //fills this->mystring with data from file

      inline int length() {return mylength;};
         //returns length of USED data in mystring
         //does not include \0 at end

      void print();
         //prints mystring as a c-style array to COUT
         //pretty useless, since there is already a way to return c-style

      int conv_int();
         //converts numbers in string to an integer format
         //returns value gleaned from entire length of string
         //recognizes '-' in position [0] for negative values

      void substring(exstring &ret, int first, int length);
         //copies a substring out of mystring and places it into RET
         //including FIRST, substring will be LENGTH characters long, if LENGTH is positive.
         //if negative, RET will contain all characters starting with FIRST, to the end
         //of mystring, less {0-LENGTH} characters.

      void between(exstring &ret, char* beginmark, char* endmark);
         //copies a substring out of mystring and places it into RET.
         //string to copy must fall BETWEEN c-style strings BEGINMARK and ENDMARK
         //if either target string is not found, RET will receive an empty string

      int findme(char* target);
         //locates index of first instance of a substring
         //is mainly a helper function for between()
         //is passed a c-style string
         //success- returns index inside of mystring of beginning of target
         //failure- returns -1

      inline char* getmystring(){return this->mystring;};
         //mystring getter

      inline void operator=(exstring &rhs){rhs.substring(*this,0,0);};
         //ghetto copy constructor
         //cheats and uses substring function to copy entire length of string over

   private:
      int mylength;                    //length of character string
      char* mystring;                  //area containing actual string
};

#include "exstring.cpp"

#endif