|
Boost Users : |
Subject: [Boost-users] using my sink to write to the file.
From: Patel, Anand (Anand.Patel_at_[hidden])
Date: 2009-09-17 13:07:27
Hello All,
I have been trying to implement Sink device that I would like to use
with boost::iostreams.
I have used Sink class example and now I am trying to use that as my
sink device for the stream object.
char* file_name = "c:/devel/output/file_one.txt";
typedef container_sink <std::iostream> some_sink;
stream<some_sink, std::char_traits<char>> my_file_stream;
last line I get many errors as following:
1>c:\documents and settings\user\my documents\visual studio
2008\projects\filereaderwriter\sink.h(11) : error C2039: 'value_type' :
is not a member of 'std::basic_iostream<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> c:\program
files\boost\boost_1_39\boost\iostreams\traits.hpp(176) : see reference
to class template instantiation 'foobar::container_sink<Container>'
being compiled
1> with
1> [
1> Container=std::iostream
1> ]
1> c:\program
files\boost\boost_1_39\boost\iostreams\traits.hpp(188) : see reference
to class template instantiation
'boost::iostreams::detail::member_char_type<T>' being compiled
1> with
1> [
1> T=foobar::container_sink<std::iostream>
1> ]
1> c:\program
files\boost\boost_1_39\boost\iostreams\stream.hpp(108) : see reference
to class template instantiation 'boost::iostreams::char_type_of<T>'
being compiled
1> with
1> [
1> T=some_sink
1> ]
1>c:\documents and settings\user\my documents\visual studio
2008\projects\filereaderwriter\sink.h(11) : error C2146: syntax error :
missing ';' before identifier 'char_type'
1>c:\documents and settings\user\my documents\visual studio
2008\projects\filereaderwriter\sink.h(11) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\user\my documents\visual studio
2008\projects\filereaderwriter\sink.h(11) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\user\my documents\visual studio
2008\projects\filereaderwriter\sink.h(23) : error C2061: syntax error :
identifier 'char_type'
1>c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) :
error C2039: 'char_type' : is not a member of
'foobar::container_sink<Container>'
1> with
1> [
1> Container=std::iostream
1> ]
1>c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) :
error C2146: syntax error : missing ';' before identifier 'type'
1>c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) :
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
1>c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) :
error C2208: 'boost::type' : no members defined using this type
1>c:\program files\boost\boost_1_39\boost\iostreams\traits.hpp(176) :
fatal error C1903: unable to recover from previous error(s); stopping
compilation
Thanks,
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net