Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RESOURCE_H_INCLUDED
- #define RESOURCE_H_INCLUDED
- #include <sstream>
- #include <iostream>
- #include <vector>
- #include <set>
- #include <map>
- #include "ResourceType.h"
- using SoftUni::ResourceType;
- using namespace std;
- namespace SoftUni
- {
- class Resource
- {
- private:
- int id = 0 ;
- //std::string type;
- ResourceType type;
- std::string link ;
- public:
- Resource(){}
- //std::string getType() ???
- enum ResourceType getType(std::ostream& type , enum ResourceType t) // ????
- const
- {
- std::ostringstream Type ;
- Type << t ;
- return Type ;
- return this -> type ;
- }
- std::string getLink()
- const
- {
- return this -> link ;
- }
- int getId()
- const
- {
- return this -> id ;
- }
- bool operator<( const Resource& resource )
- const
- {
- return ( this-> id ) < resource.id ;
- }
- friend std::istream& operator>> ( std::istream & in , Resource & r ) ;
- friend std::ostream& operator<< ( std::ostream & out, Resource & r ) ;
- };
- std::istream & operator>> ( std::istream &in , Resource &r )
- {
- std::stringstream ostr ;
- in >> r.id ;
- std::string word = "Demo";
- in >> word ;
- ostr<<word;
- in >> r.link ;
- //in >> r.id >> r.type >> r.link ;
- // return in ;
- }
- std::ostream& operator<< ( std::ostream &out, const Resource & r )
- {
- return out << r.getId() << " " << r.getType() << " " << r.getLink() ;
- }
- }
- #endif // RESOURCE_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement