-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodedata.h
More file actions
36 lines (29 loc) · 998 Bytes
/
nodedata.h
File metadata and controls
36 lines (29 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef NODEDATA_H
#define NODEDATA_H
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
// simple class containing one string to use for testing
// not necessary to comment further
class NodeData {
friend ostream & operator<<(ostream &, const NodeData &);
public:
NodeData(); // default constructor, data is set to an empty string
~NodeData();
NodeData(const string &); // data is set equal to parameter
NodeData(const NodeData &); // copy constructor
NodeData& operator=(const NodeData &);
// set class data from data file
// returns true if the data is set, false when bad data, i.e., is eof
bool setData(istream&);
bool operator==(const NodeData &) const;
bool operator!=(const NodeData &) const;
bool operator<(const NodeData &) const;
bool operator>(const NodeData &) const;
bool operator<=(const NodeData &) const;
bool operator>=(const NodeData &) const;
private:
string data;
};
#endif