25 #ifdef VIL_USE_FSTREAM64 26 vil_stream *is =
new vil_stream_fstream64(what, how);
27 #else //VIL_USE_FSTREAM64 29 #endif //VIL_USE_FSTREAM64 41 #ifdef VIL_USE_FSTREAM64 42 vil_stream *is =
new vil_stream_fstream64(what,
"r+");
43 #else //VIL_USE_FSTREAM64 45 #endif //VIL_USE_FSTREAM64 56 int l = (int)std::strlen(what);
57 if (l > 4 && std::strncmp(what,
"gen:", 4) == 0) {
58 if (std::strcmp(how,
"r") == 0) {
61 cis->write(what, l+1);
65 std::cerr << __FILE__
": cannot open gen:* for writing\n";
69 if (is && !is->
ok()) {
78 int l = (int)std::strlen(what);
79 if (l > 4 && std::strncmp(what,
"http://", 7) == 0) {
80 if (std::strcmp(how,
"r") == 0) {
84 std::cerr << __FILE__
": cannot open URL for writing (yet)\n";
87 if (is && !is->
ok()) {
97 #if defined(_WIN32) && VXL_USE_WIN_WCHAR_T 109 #ifdef VIL_USE_FSTREAM64 110 vil_stream *is =
new vil_stream_fstream64(what, how);
111 #else //VIL_USE_FSTREAM64 113 #endif //VIL_USE_FSTREAM64 122 #if 0 // TODO: add wchar_t support in vil_stream_core 125 int l = wcslen(what);
126 if (l > 4 && wcsncmp(what, L
"gen:", 4) == 0) {
127 if (std::strcmp(how,
"r") == 0) {
130 cis->
write(what, l+1);
134 std::cerr << __FILE__
": cannot open gen:* for writing\n";
138 if (is && !is->
ok()) {
146 #if 0 // TODO: add wchar_t support in vil_stream_url 149 int l = std::strlen(what);
150 if (l > 4 && std::strncmp(what,
"http://", 7) == 0) {
151 if (std::strcmp(how,
"r") == 0) {
155 std::cerr << __FILE__
": cannot open URL for writing (yet)\n";
158 if (is && !is->
ok()) {
169 #endif //defined(_WIN32) && VXL_USE_WIN_WCHAR_T vil_streampos write(void const *buf, vil_streampos n) override
Write n bytes from buf. Returns number of bytes written.
A vil_stream implementation using std::fstream.
Stream interface for VIL image loaders.
A vil_stream implementation using std::fstream.
void ref()
up/down the reference count.
An in-core vil_stream implementation.
virtual bool ok() const =0
Return false if the stream is broken.
make a vil_stream from a filename, an URL, etc.
vil_stream * vil_open(char const *what, char const *how="r")
make a vil_stream from a filename, an URL, etc.
An in-core vil_stream implementation.