Infernale

NCTU LAB 17/10 NUM 3 [MyString.h]

Oct 17th, 2019
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. #ifndef MYSTRING_H
  2. #define MYSTRING_H
  3.  
  4. #include <string>
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. enum StringType{
  9.   palindrome,
  10.   mirrored_string,
  11.   mirrored_palindrome,
  12.   none
  13. };
  14.  
  15. class MyString{
  16.   public:
  17.     MyString();
  18.     MyString(string s);
  19.     void setS(string);
  20.     string getS();
  21.     MyString removePunctuation();
  22.     MyString toUpper();
  23.     MyString reverse();
  24.     MyString toMirror();
  25.     void showMyStringType();
  26.     MyString longestPeekPalindrome();
  27.     void checkStringType();
  28.   private:
  29.     string s;
  30.     StringType type;
  31.     string normal = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
  32.     string mirror = "A   3  HIL JM O   2TUVWXY51SE Z  8 ";
  33. };
  34. #endif
Add Comment
Please, Sign In to add comment