Skip to content

Commit

Permalink
merge #236
Browse files Browse the repository at this point in the history
  • Loading branch information
magichan authored and pezy committed May 26, 2015
1 parent 05ef39b commit ea99cab
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ch16/ex16.14.15/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ class Screen {
Screen& operator<< (const char &c);
Screen& operator>> (char &c);

friend std::ostream & operator<< ( std::ostream &os , const Screen<H,W> & c )
{
unsigned int i,j;
for( i=0 ;i<c.height; i++ )
{
os<<c.contents.substr(0,W)<<std::endl;
}
return os;
}

friend std::istream & operator>> ( std::istream &is , Screen & c )
{
char a;
is>>a;
std::string temp(H*W,a);
c.contents = temp;
return is;
}

private:
pos cursor = 0;
pos height = H, width = W;
Expand Down

0 comments on commit ea99cab

Please sign in to comment.