Advertisement
Guest User

String Header File

a guest
Aug 22nd, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #ifndef STRING_H
  2. #define STRING_H
  3.  
  4. #include <iostream>
  5. #include <cstring>
  6.  
  7. class String  
  8. {
  9.     public:
  10.         String ();
  11.            ~String ();
  12.         String (const String &);
  13.         String (String &&);
  14.         String (const char);
  15.         String (const char *);
  16.         String &operator= (const String &);
  17.         String &operator= (String &&);
  18.  
  19.         friend std::ostream &operator<< (std::ostream &, const String &);
  20.         friend std::istream &operator>> (std::istream &, String &);
  21.         friend String operator+ (const String &, const String &);
  22.  
  23.     private:
  24.         size_t str_ctored_size = 0;
  25.         size_t edge = 20;
  26.             char * str = nullptr;
  27.  
  28.         inline void free ();
  29.         inline void allocate (size_t);
  30.         inline void destruct ();
  31. };
  32.  
  33. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement