-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocument.h
66 lines (45 loc) · 1.27 KB
/
document.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef DOCUMENT_H_
#define DOCUMENT_H_
#include <string>
using namespace std;
class document{
private:
//! @brief A private string: the document's file name.
string filename;
//! @brief A private string: the document's content.
string filecontent;
//! @brief a private size_t: the document's size.
size_t filesize;
public:
//! @brief A default contructor.
document();
~document();
//! @brief Another constructor.
/*! @param filename: filname of the document to be constructed.
*/
document(string filename);
//! @brief An accessor for the document's name.
/*!
* @return A string: name of the document.
*/
string name() const;
//! @brief An accessor for the document's size.
/*!
* @return A size_t: the size of the document.
*/
size_t size() const;
//! @brief An accessor for the document's content.
/*!
* @return A string: the content of the document.
*/
string content() const;
//! @brief A friend operator<< overload.
/*!
* Puts document's information into an ostream
* @param os: the ostream into which we put document information
* @param d: the document which's information we print out
* @return an ostream: the contents of document
*/
friend ostream & operator<<(ostream & os,document & d);
};
#endif /* DOCUMENT_H_ */