Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #ifndef BOOKINTHELIBRARY_H
- #define BOOKINTHELIBRARY_H
- #include <iostream>
- #include <fstream>
- #include "MyString.h"
- #include <string>
- using namespace std;
- class BookInTheLibrary
- {
- private:
- // поля
- string author_;
- string title_;
- unsigned int publishingYear_;
- string discipline_;
- unsigned int numberOfCopies_;
- public:
- // перегрузка оператора присваивания
- BookInTheLibrary& operator= (const BookInTheLibrary& ob);
- // перегрузка бинарных операторов
- BookInTheLibrary operator+ (unsigned int value);
- BookInTheLibrary operator- (unsigned int value);
- // перегрузка операторов отношения
- bool operator== (const BookInTheLibrary& ob) const;
- bool operator> (const BookInTheLibrary& ob) const;
- bool operator< (const BookInTheLibrary& ob) const;
- bool operator>= (const BookInTheLibrary& ob) const;
- bool operator<= (const BookInTheLibrary& ob) const;
- // перегрузка операторов инкремента/декремента
- BookInTheLibrary& operator++();
- BookInTheLibrary& operator--();
- // конструкторы/деструктор
- BookInTheLibrary();
- BookInTheLibrary(string author, string title, unsigned int publishingYear,
- string discipline, unsigned int numberOfCopies);
- BookInTheLibrary(unsigned int numberOfCopies);
- BookInTheLibrary(const BookInTheLibrary& ob);
- ~BookInTheLibrary();
- // перегрузка операторов ввода/вывода через дружественные функции
- friend ostream& operator<< (ostream& out, const BookInTheLibrary& ob);
- friend istream& operator>> (istream& in, BookInTheLibrary& ob);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement