CPP   36

stdstuff.h

Guest on 5th August 2022 01:32:49 AM

  1. // we only want this stuff if stdstuff has not previously been included
  2. // (i.e. if "stdstuff_included" has not been defined)
  3. #ifndef stdstuff_included
  4. #define stdstuff_included
  5.  
  6. // Standard include file for BORLAND 5.0 environment.
  7.  
  8. #include <iostream.h>
  9. #include <fstream.h>
  10. #include <strstrea.h>
  11. #include <iomanip.h>
  12. #include <stdexcep.h>
  13. #include <limits.h>
  14. #include <string>
  15. #include <math.h>
  16.  
  17. #include <process.h>
  18. #include <ctype.h>
  19.  
  20. #include <conio.h>
  21.  
  22. using namespace std;
  23.  
  24. #define clearScreen() clrscr()
  25.  
  26. inline static void pause () {
  27.   cout << "Hit any key to continue...\n";
  28.   getch();
  29. }
  30.  
  31. class String2002 : public string {
  32. public:
  33.    String2002():string() {}  // These are needed for operator=, +
  34.    String2002(int i, char c):string(i,c) {} // constructor
  35.    String2002(const char c):string(1,c) {} // constructor
  36.    String2002(char bb[]):string(bb) {}  // These are needed for operator=, +
  37.    String2002(char bb[], int start, int slength):string(bb, start, slength) {}
  38.    String2002(const string &rhs):string(rhs) {}  // Copy Constructor needed by operator+
  39.  
  40.    bool isEqualCaseInsensitive(const String2002 &otherString) const {
  41.         string s1 = (string) *this;
  42.         string s2 = (string) otherString;
  43.         return (stricmp(s1.c_str(), s2.c_str())==0);
  44.    }
  45. };
  46.  
  47. inline static int quit(const String2002 &str) {
  48.   cout << str << endl;
  49.   pause();
  50.   abort();
  51. }
  52.  
  53. #endif

Raw Paste


Login or Register to edit or fork this paste. It's free.