File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,9 @@ class EXIV2API FileIo : public BasicIo {
310
310
Nonzero if failure.
311
311
*/
312
312
int open (const std::string& mode);
313
+ #ifdef _WIN32
314
+ int open (const std::wstring& mode);
315
+ #endif
313
316
/* !
314
317
@brief Open the file using the default access mode of "rb".
315
318
This method can also be used to "reopen" a file which will flush
Original file line number Diff line number Diff line change @@ -481,7 +481,11 @@ size_t FileIo::size() const {
481
481
482
482
int FileIo::open () {
483
483
// Default open is in read-only binary mode
484
+ #ifdef _WIN32
485
+ return open (L" rb" );
486
+ #else
484
487
return open (" rb" );
488
+ #endif
485
489
}
486
490
487
491
int FileIo::open (const std::string& mode) {
@@ -501,6 +505,16 @@ int FileIo::open(const std::string& mode) {
501
505
return 0 ;
502
506
}
503
507
508
+ #ifdef _WIN32
509
+ int FileIo::open (const std::wstring& mode) {
510
+ close ();
511
+ p_->opMode_ = Impl::opSeek;
512
+ if (_wfopen_s (&p_->fp_ , p_->wpath_ .c_str (), mode.c_str ()))
513
+ return 1 ;
514
+ return 0 ;
515
+ }
516
+ #endif
517
+
504
518
bool FileIo::isopen () const {
505
519
return p_->fp_ != nullptr ;
506
520
}
You can’t perform that action at this time.
0 commit comments