Changeset a9caea1 in mainline
- Timestamp:
- 2018-07-05T21:41:18Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a3067af
- Parents:
- 51a3eef
- git-author:
- Jaroslav Jindrak <dzejrou@…> (2017-11-05 21:07:14)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/istream.hpp
r51a3eef ra9caea1 31 31 32 32 #include <iosfwd> 33 #include <utility> 33 34 34 35 namespace std … … 54 55 55 56 explicit basic_istream(basic_streambuf<Char, Traits>* sb) 56 { 57 // TODO: implement 57 : gcount_{0} 58 { 59 basic_ios::init(sb); 58 60 } 59 61 60 62 virtual ~basic_stream() 61 { 62 // TODO: implement 63 } 63 { /* DUMMY BODY */ } 64 64 65 65 /** … … 67 67 */ 68 68 69 class sentry; 69 class sentry 70 { 71 public: 72 explicit sentry(basic_istream<Char, Traits>& is, bool noskipws = false) 73 : ok_{false} 74 { 75 if (!is.good()) 76 is.setstate(ios_base::failbit); 77 else 78 { 79 if (is.tie()) 80 is.tie()->flush(); 81 82 if (!noskipws && ((is.flags() & ios_base::skipws) != 0)) 83 { 84 // TODO: implement when we have istream_iterator and locale, 85 // skip whitespace using is.locale() 86 } 87 } 88 } 89 90 ~sentry() = default; 91 92 explicit operator bool() const 93 { 94 return ok_; 95 } 96 97 sentry(const sentry&) = delete; 98 sentry& operator=(const sentry&) = delete; 99 100 private: 101 using traits_type = Traits; 102 bool ok_; 103 } 70 104 71 105 /** … … 170 204 streamsize gcount() const 171 205 { 172 // TODO: implement206 return gcount_; 173 207 } 174 208 … … 264 298 265 299 protected: 300 streamsize gcount_; 301 266 302 basic_istream(const basic_istream&) = delete; 267 303 268 304 basic_istream(basic_istream&& rhs) 269 305 { 270 // TODO: implement 306 gcount_ = rhs.gcout_; 307 308 basic_ios::move(rhs); 309 310 rhs.gcount_ = 0; 271 311 } 272 312 … … 279 319 basic_istream& operator=(basic_istream&& rhs) 280 320 { 281 // TODO: implement 321 swap(rhs); 322 323 return *this; 282 324 } 283 325 284 326 void swap(basic_stream& rhs) 285 327 { 286 // TODO: implement 328 basic_ios::swap(rhs); 329 swap(gcoung_, rhs.gcount_); 287 330 } 288 331 };
Note:
See TracChangeset
for help on using the changeset viewer.