1234567891011121314151617181920212223242526272829303132333435363738 |
- #pragma once
- #include <iostream>
- #include "Counter.h"
- class Counter;
- class MyString
- {
- Counter* m_pCounter;
- public:
- explicit MyString(const char* Str = " ");// êîíñòðóêòîð, explicit çàïðåùàåò êîìïèëÿòîðó ïðèâîäèòü òèï íåÿâíî
- MyString(const MyString&); //êîíñòðóêòîð êîïèðîâàíèÿ
- MyString(MyString&&); //ïåðåìåùàþùèé êîíñòðóêòîð êîïèðîâàíèÿ
- ~MyString();//äåñòðóêòîð
-
- MyString& operator= (const MyString&);//îïåðàòîð ïðèñâàèâàíèÿ ïðèíèìàþùèé êëàññ
- MyString& operator= (MyString&&);//ïåðåìåùàþùèé îïåðàòîð ïðèñâàèâàíèÿ
- const char* GetString() const; //ìåòîä, êîòîðûé îáåñïå÷èò äîñòóï ê õðàíÿùåéñÿ ñòðîêå
- void SetNewString(const char*); //ìåòîä, êîòîðûé áóäåò çàìåíÿòü ñòðîêó íà íîâóþ
- //ðàñïå÷àòàòü âñå ñòðîêè
- static void PrintAllStrings();
- //âî âñåõ îáúåêòàõ MyString èçìåíèòü ðåãèñòð
- static void ChangeRegister();
- //âûâåñòè ñòðîêè ïî àëôàâèòó
- static void PrintSortedStrings();
-
- friend std::ostream& operator<<(std::ostream& , const MyString&);
- };
- std::ostream& operator<<(std::ostream&, const MyString&);
|