From: David C. <unc...@un...> - 2005-04-28 22:15:20
|
I made this change in express_viewer.cpp (starting at line 131): static std::ifstream editor_stream_s(editor_eve.c_str()); static adobe::auto_ptr<eve_client::eve_client_holder> editor_view_s( eve_client::make_view( editor_eve.c_str(), editor_stream_s,//std::ifstream(editor_eve.c_str()), editor_sheet_s, [snip] to fix this: /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/test/visual/ sources/express_viewer.cpp:141: error: could not convert `ifstream((&editor_eve)->std::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](), (std::_Ios_Openmode)8)' to `std::istream&' ...but that gets me an infinite recursion situation in Begin that has been difficult to track down. But maybe I won't have to if there's a different fix for the above error :) -- David Catmull unc...@un... http://www.uncommonplace.com/ |
From: Ralph T. <ra...@gm...> - 2005-04-28 23:30:06
|
Hmm... that's odd. It compiled okay on MSVC (with the #ifdef ADOBE_PLATFORM_MAC stuff commented out). I was planning on changing that line anyway (to create a window_server instead), but I'm more curious about the infinite recursion error -- I've been able to use window_server_t (which uses make_view) with both files and streams without troubles, although I haven't been using Begin... can you give any more information on the recursion problem? I'll look at replacing that line, too. Thanks, Ralph On 4/28/05, David Catmull <unc...@un...> wrote: > I made this change in express_viewer.cpp (starting at line 131): >=20 > static std::ifstream editor_stream_s(editor_eve.c_str()); > static adobe::auto_ptr<eve_client::eve_client_holder> editor_view= _s( > eve_client::make_view( editor_eve.c_str(), > editor_stream_s,//std::ifstream(editor_eve.c_str(= )), > editor_sheet_s, > [snip] >=20 > to fix this: >=20 > /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/test/visual/ > sources/express_viewer.cpp:141: error: could not convert > `ifstream((&editor_eve)->std::basic_string<_CharT, _Traits, > _Alloc>::c_str() const [with _CharT =3D char, _Traits =3D > std::char_traits<char>, _Alloc =3D std::allocator<char>](), > (std::_Ios_Openmode)8)' to `std::istream&' >=20 > ...but that gets me an infinite recursion situation in Begin that has > been difficult to track down. But maybe I won't have to if there's a > different fix for the above error :) >=20 > -- > David Catmull > unc...@un... > http://www.uncommonplace.com/ >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=3D105hix > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel > |
From: Foster T. B. <fbr...@ad...> - 2005-04-29 18:15:41
|
The line wouldn't compile on Metrowerks, either. I put in a similar fix to David's (except I didn't have my stream as static) and everything is working fine for me. I've checked it in to the repository. The compiler error has to do with the fact that the std::istream& parameter isn't const. It's eluding me at the moment, but the problem deals with something like C++ compilers shouldn't allow the manipulation of temporary variables. In the case below the name of the file (const char* from c_str) was being used to construct a temporary std::ifstream, whose reference was then being passed to make_view, and I don't think compiler should like this. If the std::ifstream parameter was a const std::ifstream& the compiler would allow it, but then you wouldn't be able to manipulate the stream. David's fix (without the static keyword) is, I believe, the correct one. Blessings, Foster On Apr 28, 2005, at 03:15p, David Catmull wrote: > I made this change in express_viewer.cpp (starting at line 131): > > static std::ifstream editor_stream_s(editor_eve.c_str()); > static adobe::auto_ptr<eve_client::eve_client_holder> editor_view_s( > eve_client::make_view( editor_eve.c_str(), > editor_stream_s,//std::ifstream(editor_eve.c_str()), > editor_sheet_s, > [snip] > > to fix this: > > /Users/uncommon/Developer/ASL/sandbox/adobe-source/adobe/test/visual/ > sources/express_viewer.cpp:141: error: could not convert > `ifstream((&editor_eve)->std::basic_string<_CharT, _Traits, > _Alloc>::c_str() const [with _CharT = char, _Traits = > std::char_traits<char>, _Alloc = std::allocator<char>](), > (std::_Ios_Openmode)8)' to `std::istream&' > > ...but that gets me an infinite recursion situation in Begin that has > been difficult to track down. But maybe I won't have to if there's a > different fix for the above error :) > > -- > David Catmull > unc...@un... > http://www.uncommonplace.com/ > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel > > -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "What 99 percent of programmers need to know is not how to build components but how to use them." -- Alexander Stepanov |
From: Foster T. B. <fbr...@ad...> - 2005-04-29 18:29:24
|
This function should only be called once, as it's an initialization routine. The reason the view is static is so the assemblage stays around for the lifetime of the application (and hence the editor dialog stays around that long, too). We can dispose of the stream as soon as the dialog has been created, so it need not be static. Another problem with the stream being static is that eve definition is "open" as long as the application is running, which isn't the behavior you want. Blessings, Foster On Apr 29, 2005, at 11:24a, David Catmull wrote: > On Apr 29, 2005, at 11:15 AM, Foster T. Brereton wrote: >> The line wouldn't compile on Metrowerks, either. I put in a similar >> fix to David's (except I didn't have my stream as static) and >> everything is working fine for me. I've checked it in to the >> repository. > > I was thinking that if it's being used to initialize a static > variable, then it ought to be static too. I suppose it's a trade-off > between having it never get disposed vs being unnecessarily > constructed on subsequent calls. > > -- > David Catmull > unc...@un... > http://www.uncommonplace.com/ > > -- Foster T. Brereton <}}}>< Romans 3:21-26 A d o b e S o f t w a r e T e c h n o l o g y L a b "What 99 percent of programmers need to know is not how to build components but how to use them." -- Alexander Stepanov |