X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FFileHandle.cci;h=70161317937fbe9c80a76626fa86eee3f59536db;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=a727beee0ac8b02957e5979afd192e0cead2fae9;hpb=85ab07d100a382467a42e19d741d403a7a96c951;p=senf.git diff --git a/Socket/FileHandle.cci b/Socket/FileHandle.cci index a727bee..7016131 100644 --- a/Socket/FileHandle.cci +++ b/Socket/FileHandle.cci @@ -171,7 +171,7 @@ prefix_ bool senf::FileHandle::eof() prefix_ bool senf::FileHandle::valid() const { - return body().valid(); + return body_ && body().valid(); } prefix_ bool senf::FileHandle::boolean_test() @@ -186,18 +186,24 @@ prefix_ int senf::FileHandle::fd() return body().fd(); } +prefix_ senf::FileHandle::FileHandle() + : body_(0) +{} + prefix_ senf::FileHandle::FileHandle(std::auto_ptr body) : body_(body.release()) {} prefix_ senf::FileBody & senf::FileHandle::body() { + BOOST_ASSERT(body_); return *body_; } prefix_ senf::FileBody const & senf::FileHandle::body() const { + BOOST_ASSERT(body_); return *body_; } @@ -244,4 +250,6 @@ prefix_ int senf::retrieve_filehandle(FileHandle handle) // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: