Bug #1270 » cpp11-uniqueptr.diff
exiv2-0.26-svn-1/include/exiv2/basicio.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
67 | 67 |
class EXIV2API BasicIo { |
68 | 68 |
public: |
69 | 69 |
//! BasicIo auto_ptr type |
70 |
#ifdef EXV_USING_CPP_ELEVEN |
|
71 |
typedef std::unique_ptr<BasicIo> AutoPtr; |
|
72 |
#else |
|
70 | 73 |
typedef std::auto_ptr<BasicIo> AutoPtr; |
71 | ||
74 |
#endif |
|
72 | 75 |
//! Seek starting positions |
73 | 76 |
enum Position { beg, cur, end }; |
74 | 77 |
exiv2-0.26-svn-1/include/exiv2/datasets.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
280 | 280 |
class EXIV2API IptcKey : public Key { |
281 | 281 |
public: |
282 | 282 |
//! Shortcut for an %IptcKey auto pointer. |
283 |
#ifdef EXV_USING_CPP_ELEVEN |
|
284 |
typedef std::unique_ptr<IptcKey> AutoPtr; |
|
285 |
#else |
|
283 | 286 |
typedef std::auto_ptr<IptcKey> AutoPtr; |
287 |
#endif |
|
284 | 288 | |
285 | 289 |
//! @name Creators |
286 | 290 |
//@{ |
exiv2-0.26-svn-1/include/exiv2/metadatum.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
60 | 60 |
class EXIV2API Key { |
61 | 61 |
public: |
62 | 62 |
//! Shortcut for a %Key auto pointer. |
63 |
#ifdef EXV_USING_CPP_ELEVEN |
|
64 |
typedef std::unique_ptr<Key> AutoPtr; |
|
65 |
#else |
|
63 | 66 |
typedef std::auto_ptr<Key> AutoPtr; |
67 |
#endif |
|
64 | 68 | |
65 | 69 |
//! @name Creators |
66 | 70 |
//@{ |
exiv2-0.26-svn-1/include/exiv2/properties.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
247 | 253 |
class EXIV2API XmpKey : public Key { |
248 | 254 |
public: |
249 | 255 |
//! Shortcut for an %XmpKey auto pointer. |
256 |
#ifdef EXV_USING_CPP_ELEVEN |
|
257 |
typedef std::unique_ptr<XmpKey> AutoPtr; |
|
258 |
#else |
|
250 | 259 |
typedef std::auto_ptr<XmpKey> AutoPtr; |
260 |
#endif |
|
251 | 261 | |
252 | 262 |
//! @name Creators |
253 | 263 |
//@{ |
exiv2-0.26-svn-1/include/exiv2/tags.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
150 | 150 |
class EXIV2API ExifKey : public Key { |
151 | 151 |
public: |
152 | 152 |
//! Shortcut for an %ExifKey auto pointer. |
153 |
#ifdef EXV_USING_CPP_ELEVEN |
|
154 |
typedef std::unique_ptr<ExifKey> AutoPtr; |
|
155 |
#else |
|
153 | 156 |
typedef std::auto_ptr<ExifKey> AutoPtr; |
157 |
#endif |
|
154 | 158 | |
155 | 159 |
//! @name Creators |
156 | 160 |
//@{ |
exiv2-0.26-svn-1/include/exiv2/value.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
63 | 63 |
class EXIV2API Value { |
64 | 64 |
public: |
65 | 65 |
//! Shortcut for a %Value auto pointer. |
66 |
#ifdef EXV_USING_CPP_ELEVEN |
|
67 |
typedef std::unique_ptr<Value> AutoPtr; |
|
68 |
#else |
|
66 | 69 |
typedef std::auto_ptr<Value> AutoPtr; |
70 |
#endif |
|
67 | 71 | |
68 | 72 |
//! @name Creators |
69 | 73 |
//@{ |
... | ... | |
265 | 269 |
class EXIV2API DataValue : public Value { |
266 | 270 |
public: |
267 | 271 |
//! Shortcut for a %DataValue auto pointer. |
272 |
#ifdef EXV_USING_CPP_ELEVEN |
|
273 |
typedef std::unique_ptr<DataValue> AutoPtr; |
|
274 |
#else |
|
268 | 275 |
typedef std::auto_ptr<DataValue> AutoPtr; |
276 |
#endif |
|
269 | 277 | |
270 | 278 |
//! @name Creators |
271 | 279 |
//@{ |
... | ... | |
352 | 360 |
class EXIV2API StringValueBase : public Value { |
353 | 361 |
public: |
354 | 362 |
//! Shortcut for a %StringValueBase auto pointer. |
363 |
#ifdef EXV_USING_CPP_ELEVEN |
|
364 |
typedef std::unique_ptr<StringValueBase> AutoPtr; |
|
365 |
#else |
|
355 | 366 |
typedef std::auto_ptr<StringValueBase> AutoPtr; |
367 |
#endif |
|
356 | 368 | |
357 | 369 |
//! @name Creators |
358 | 370 |
//@{ |
... | ... | |
434 | 446 |
class EXIV2API StringValue : public StringValueBase { |
435 | 447 |
public: |
436 | 448 |
//! Shortcut for a %StringValue auto pointer. |
449 |
#ifdef EXV_USING_CPP_ELEVEN |
|
450 |
typedef std::unique_ptr<StringValue> AutoPtr; |
|
451 |
#else |
|
437 | 452 |
typedef std::auto_ptr<StringValue> AutoPtr; |
453 |
#endif |
|
438 | 454 | |
439 | 455 |
//! @name Creators |
440 | 456 |
//@{ |
... | ... | |
466 | 482 |
class EXIV2API AsciiValue : public StringValueBase { |
467 | 483 |
public: |
468 | 484 |
//! Shortcut for a %AsciiValue auto pointer. |
485 |
#ifdef EXV_USING_CPP_ELEVEN |
|
486 |
typedef std::unique_ptr<AsciiValue> AutoPtr; |
|
487 |
#else |
|
469 | 488 |
typedef std::auto_ptr<AsciiValue> AutoPtr; |
489 |
#endif |
|
470 | 490 | |
471 | 491 |
//! @name Creators |
472 | 492 |
//@{ |
... | ... | |
553 | 573 |
}; // class CharsetInfo |
554 | 574 | |
555 | 575 |
//! Shortcut for a %CommentValue auto pointer. |
576 |
#ifdef EXV_USING_CPP_ELEVEN |
|
577 |
typedef std::unique_ptr<CommentValue> AutoPtr; |
|
578 |
#else |
|
556 | 579 |
typedef std::auto_ptr<CommentValue> AutoPtr; |
580 |
#endif |
|
557 | 581 | |
558 | 582 |
//! @name Creators |
559 | 583 |
//@{ |
... | ... | |
640 | 664 |
class EXIV2API XmpValue : public Value { |
641 | 665 |
public: |
642 | 666 |
//! Shortcut for a %XmpValue auto pointer. |
667 |
#ifdef EXV_USING_CPP_ELEVEN |
|
668 |
typedef std::unique_ptr<XmpValue> AutoPtr; |
|
669 |
#else |
|
643 | 670 |
typedef std::auto_ptr<XmpValue> AutoPtr; |
671 |
#endif |
|
644 | 672 | |
645 | 673 |
//! XMP array types. |
646 | 674 |
enum XmpArrayType { xaNone, xaAlt, xaBag, xaSeq }; |
... | ... | |
731 | 759 |
class EXIV2API XmpTextValue : public XmpValue { |
732 | 760 |
public: |
733 | 761 |
//! Shortcut for a %XmpTextValue auto pointer. |
762 |
#ifdef EXV_USING_CPP_ELEVEN |
|
763 |
typedef std::unique_ptr<XmpTextValue> AutoPtr; |
|
764 |
#else |
|
734 | 765 |
typedef std::auto_ptr<XmpTextValue> AutoPtr; |
766 |
#endif |
|
735 | 767 | |
736 | 768 |
//! @name Creators |
737 | 769 |
//@{ |
... | ... | |
813 | 845 |
class EXIV2API XmpArrayValue : public XmpValue { |
814 | 846 |
public: |
815 | 847 |
//! Shortcut for a %XmpArrayValue auto pointer. |
848 |
#ifdef EXV_USING_CPP_ELEVEN |
|
849 |
typedef std::unique_ptr<XmpArrayValue> AutoPtr; |
|
850 |
#else |
|
816 | 851 |
typedef std::auto_ptr<XmpArrayValue> AutoPtr; |
852 |
#endif |
|
817 | 853 | |
818 | 854 |
//! @name Creators |
819 | 855 |
//@{ |
... | ... | |
909 | 945 |
class EXIV2API LangAltValue : public XmpValue { |
910 | 946 |
public: |
911 | 947 |
//! Shortcut for a %LangAltValue auto pointer. |
948 |
#ifdef EXV_USING_CPP_ELEVEN |
|
949 |
typedef std::unique_ptr<LangAltValue> AutoPtr; |
|
950 |
#else |
|
912 | 951 |
typedef std::auto_ptr<LangAltValue> AutoPtr; |
952 |
#endif |
|
913 | 953 | |
914 | 954 |
//! @name Creators |
915 | 955 |
//@{ |
... | ... | |
997 | 1037 |
class EXIV2API DateValue : public Value { |
998 | 1038 |
public: |
999 | 1039 |
//! Shortcut for a %DateValue auto pointer. |
1040 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1041 |
typedef std::unique_ptr<DateValue> AutoPtr; |
|
1042 |
#else |
|
1000 | 1043 |
typedef std::auto_ptr<DateValue> AutoPtr; |
1044 |
#endif |
|
1001 | 1045 | |
1002 | 1046 |
//! @name Creators |
1003 | 1047 |
//@{ |
... | ... | |
1098 | 1142 |
class EXIV2API TimeValue : public Value { |
1099 | 1143 |
public: |
1100 | 1144 |
//! Shortcut for a %TimeValue auto pointer. |
1145 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1146 |
typedef std::unique_ptr<TimeValue> AutoPtr; |
|
1147 |
#else |
|
1101 | 1148 |
typedef std::auto_ptr<TimeValue> AutoPtr; |
1149 |
#endif |
|
1102 | 1150 | |
1103 | 1151 |
//! @name Creators |
1104 | 1152 |
//@{ |
... | ... | |
1254 | 1302 |
class ValueType : public Value { |
1255 | 1303 |
public: |
1256 | 1304 |
//! Shortcut for a %ValueType\<T\> auto pointer. |
1305 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1306 |
typedef std::unique_ptr<ValueType<T> > AutoPtr; |
|
1307 |
#else |
|
1257 | 1308 |
typedef std::auto_ptr<ValueType<T> > AutoPtr; |
1309 |
#endif |
|
1258 | 1310 | |
1259 | 1311 |
//! @name Creators |
1260 | 1312 |
//@{ |
exiv2-0.26-svn-1/samples/metacopy.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
58 | 58 |
Exiv2::BasicIo::AutoPtr memIo(new Exiv2::MemIo); |
59 | 59 |
memIo->transfer(*fileIo); |
60 | 60 | |
61 |
#ifdef EXV_USING_CPP_ELEVEN |
|
62 |
Exiv2::Image::AutoPtr readImg = Exiv2::ImageFactory::open(std::move(memIo)); |
|
63 |
#else |
|
61 | 64 |
Exiv2::Image::AutoPtr readImg = Exiv2::ImageFactory::open(memIo); |
65 |
#endif |
|
62 | 66 |
assert(readImg.get() != 0); |
63 | 67 |
readImg->readMetadata(); |
64 | 68 |
exiv2-0.26-svn-1/src/actions.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
228 | 228 |
Task* t = i->second; |
229 | 229 |
return t->clone(); |
230 | 230 |
} |
231 |
#ifdef EXV_USING_CPP_ELEVEN |
|
232 |
return Task::AutoPtr(nullptr); |
|
233 |
#else |
|
231 | 234 |
return Task::AutoPtr(0); |
235 |
#endif |
|
232 | 236 |
} // TaskFactory::create |
233 | 237 | |
234 | 238 |
Print::~Print() |
... | ... | |
284 | 288 |
<< _("Failed to open the file\n"); |
285 | 289 |
return -1; |
286 | 290 |
} |
287 |
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_);
|
|
291 |
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(std::move(path_));
|
|
288 | 292 |
assert(image.get() != 0); |
289 | 293 |
image->readMetadata(); |
290 | 294 |
Exiv2::ExifData& exifData = image->exifData(); |
... | ... | |
2063 | 2067 |
if ( bStdin ) Params::instance().getStdin(stdIn); |
2064 | 2068 |
Exiv2::BasicIo::AutoPtr ioStdin = Exiv2::BasicIo::AutoPtr(new Exiv2::MemIo(stdIn.pData_,stdIn.size_)); |
2065 | 2069 | |
2070 |
#ifdef EXV_USING_CPP_ELEVEN |
|
2071 |
Exiv2::Image::AutoPtr sourceImage = bStdin ? Exiv2::ImageFactory::open(std::move(ioStdin)) : Exiv2::ImageFactory::open(std::move(source)); |
|
2072 |
#else |
|
2066 | 2073 |
Exiv2::Image::AutoPtr sourceImage = bStdin ? Exiv2::ImageFactory::open(ioStdin) : Exiv2::ImageFactory::open(source); |
2074 |
#endif |
|
2067 | 2075 |
assert(sourceImage.get() != 0); |
2068 | 2076 |
sourceImage->readMetadata(); |
2069 | 2077 |
exiv2-0.26-svn-1/src/actions.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
75 | 75 |
class Task { |
76 | 76 |
public: |
77 | 77 |
//! Shortcut for an auto pointer. |
78 |
#ifdef EXV_USING_CPP_ELEVEN |
|
79 |
typedef std::unique_ptr<Task> AutoPtr; |
|
80 |
#else |
|
78 | 81 |
typedef std::auto_ptr<Task> AutoPtr; |
82 |
#endif |
|
79 | 83 |
//! Virtual destructor. |
80 | 84 |
virtual ~Task(); |
81 | 85 |
//! Virtual copy construction. |
... | ... | |
159 | 163 |
public: |
160 | 164 |
virtual ~Print(); |
161 | 165 |
virtual int run(const std::string& path); |
166 |
#ifdef EXV_USING_CPP_ELEVEN |
|
167 |
typedef std::unique_ptr<Print> AutoPtr; |
|
168 |
#else |
|
162 | 169 |
typedef std::auto_ptr<Print> AutoPtr; |
170 |
#endif |
|
163 | 171 |
AutoPtr clone() const; |
164 | 172 | |
165 | 173 |
//! Print the Jpeg comment |
... | ... | |
216 | 224 |
public: |
217 | 225 |
virtual ~Rename(); |
218 | 226 |
virtual int run(const std::string& path); |
227 |
#ifdef EXV_USING_CPP_ELEVEN |
|
228 |
typedef std::unique_ptr<Rename> AutoPtr; |
|
229 |
#else |
|
219 | 230 |
typedef std::auto_ptr<Rename> AutoPtr; |
231 |
#endif |
|
220 | 232 |
AutoPtr clone() const; |
221 | 233 | |
222 | 234 |
private: |
... | ... | |
228 | 240 |
public: |
229 | 241 |
virtual ~Adjust(); |
230 | 242 |
virtual int run(const std::string& path); |
243 |
#ifdef EXV_USING_CPP_ELEVEN |
|
244 |
typedef std::unique_ptr<Adjust> AutoPtr; |
|
245 |
#else |
|
231 | 246 |
typedef std::auto_ptr<Adjust> AutoPtr; |
247 |
#endif |
|
232 | 248 |
AutoPtr clone() const; |
233 | 249 | |
234 | 250 |
private: |
... | ... | |
251 | 267 |
public: |
252 | 268 |
virtual ~Erase(); |
253 | 269 |
virtual int run(const std::string& path); |
270 |
#ifdef EXV_USING_CPP_ELEVEN |
|
271 |
typedef std::unique_ptr<Erase> AutoPtr; |
|
272 |
#else |
|
254 | 273 |
typedef std::auto_ptr<Erase> AutoPtr; |
274 |
#endif |
|
255 | 275 |
AutoPtr clone() const; |
256 | 276 | |
257 | 277 |
/*! |
... | ... | |
297 | 317 |
public: |
298 | 318 |
virtual ~Extract(); |
299 | 319 |
virtual int run(const std::string& path); |
320 |
#ifdef EXV_USING_CPP_ELEVEN |
|
321 |
typedef std::unique_ptr<Extract> AutoPtr; |
|
322 |
#else |
|
300 | 323 |
typedef std::auto_ptr<Extract> AutoPtr; |
324 |
#endif |
|
301 | 325 |
AutoPtr clone() const; |
302 | 326 | |
303 | 327 |
/*! |
... | ... | |
336 | 360 |
public: |
337 | 361 |
virtual ~Insert(); |
338 | 362 |
virtual int run(const std::string& path); |
363 |
#ifdef EXV_USING_CPP_ELEVEN |
|
364 |
typedef std::unique_ptr<Insert> AutoPtr; |
|
365 |
#else |
|
339 | 366 |
typedef std::auto_ptr<Insert> AutoPtr; |
367 |
#endif |
|
340 | 368 |
AutoPtr clone() const; |
341 | 369 | |
342 | 370 |
/*! |
... | ... | |
377 | 405 |
public: |
378 | 406 |
virtual ~Modify(); |
379 | 407 |
virtual int run(const std::string& path); |
408 |
#ifdef EXV_USING_CPP_ELEVEN |
|
409 |
typedef std::unique_ptr<Modify> AutoPtr; |
|
410 |
#else |
|
380 | 411 |
typedef std::auto_ptr<Modify> AutoPtr; |
412 |
#endif |
|
381 | 413 |
AutoPtr clone() const; |
382 | 414 |
Modify() {} |
383 | 415 |
//! Apply modification commands to the \em pImage, return 0 if successful. |
... | ... | |
410 | 442 |
public: |
411 | 443 |
virtual ~FixIso(); |
412 | 444 |
virtual int run(const std::string& path); |
445 |
#ifdef EXV_USING_CPP_ELEVEN |
|
446 |
typedef std::unique_ptr<FixIso> AutoPtr; |
|
447 |
#else |
|
413 | 448 |
typedef std::auto_ptr<FixIso> AutoPtr; |
449 |
#endif |
|
414 | 450 |
AutoPtr clone() const; |
415 | 451 | |
416 | 452 |
private: |
... | ... | |
428 | 464 |
public: |
429 | 465 |
virtual ~FixCom(); |
430 | 466 |
virtual int run(const std::string& path); |
467 |
#ifdef EXV_USING_CPP_ELEVEN |
|
468 |
typedef std::unique_ptr<FixCom> AutoPtr; |
|
469 |
#else |
|
431 | 470 |
typedef std::auto_ptr<FixCom> AutoPtr; |
471 |
#endif |
|
432 | 472 |
AutoPtr clone() const; |
433 | 473 | |
434 | 474 |
private: |
exiv2-0.26-svn-1/src/asfvideo.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
296 | 296 | |
297 | 297 |
using namespace Exiv2::Internal; |
298 | 298 | |
299 |
#ifdef EXV_USING_CPP_ELEVEN |
|
300 |
AsfVideo::AsfVideo(BasicIo::AutoPtr io) |
|
301 |
: Image(ImageType::asf, mdNone, std::move(io)) |
|
302 |
{ |
|
303 |
} // AsfVideo::AsfVideo |
|
304 |
#else |
|
299 | 305 |
AsfVideo::AsfVideo(BasicIo::AutoPtr io) |
300 | 306 |
: Image(ImageType::asf, mdNone, io) |
301 | 307 |
{ |
302 | 308 |
} // AsfVideo::AsfVideo |
309 |
#endif |
|
303 | 310 | |
304 | 311 |
std::string AsfVideo::mimeType() const |
305 | 312 |
{ |
... | ... | |
792 | 799 | |
793 | 800 |
Image::AutoPtr newAsfInstance(BasicIo::AutoPtr io, bool /*create*/) |
794 | 801 |
{ |
802 |
#ifdef EXV_USING_CPP_ELEVEN |
|
803 |
Image::AutoPtr image(new AsfVideo(std::move(io))); |
|
804 |
#else |
|
795 | 805 |
Image::AutoPtr image(new AsfVideo(io)); |
806 |
#endif |
|
796 | 807 |
if (!image->good()) { |
797 | 808 |
image.reset(); |
798 | 809 |
} |
exiv2-0.26-svn-1/src/basicio.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
583 | 583 |
// buffer, which is a workaround to ensure that the links don't get broken. |
584 | 584 |
if (ret != 0 || (buf.st_size > 1048576 && nlink == 1)) { |
585 | 585 |
pid_t pid = ::getpid(); |
586 |
#ifdef EXV_USING_CPP_ELEVEN |
|
587 |
std::unique_ptr<FileIo> fileIo; |
|
588 |
#else |
|
586 | 589 |
std::auto_ptr<FileIo> fileIo; |
590 |
#endif |
|
587 | 591 |
#ifdef EXV_UNICODE_PATH |
588 | 592 |
if (p_->wpMode_ == Impl::wpUnicode) { |
589 | 593 |
std::wstring tmpname = wpath() + s2ws(toString(pid)); |
594 |
#ifdef EXV_USING_CPP_ELEVEN |
|
595 |
fileIo = std::unique_ptr<FileIo>(new FileIo(tmpname)); |
|
596 |
#else |
|
590 | 597 |
fileIo = std::auto_ptr<FileIo>(new FileIo(tmpname)); |
598 |
#endif |
|
591 | 599 |
} |
592 | 600 |
else |
593 | 601 |
#endif |
594 | 602 |
{ |
595 | 603 |
std::string tmpname = path() + toString(pid); |
604 |
#ifdef EXV_USING_CPP_ELEVEN |
|
605 |
fileIo = std::unique_ptr<FileIo>(new FileIo(tmpname)); |
|
606 |
#else |
|
596 | 607 |
fileIo = std::auto_ptr<FileIo>(new FileIo(tmpname)); |
608 |
#endif |
|
597 | 609 |
} |
598 | 610 |
if (fileIo->open("w+b") != 0) { |
599 | 611 |
#ifdef EXV_UNICODE_PATH |
... | ... | |
607 | 619 |
} |
608 | 620 |
} |
609 | 621 |
fileIo->p_->copyXattrFrom(*this); |
622 |
#ifdef EXV_USING_CPP_ELEVEN |
|
623 |
basicIo = std::move(fileIo); |
|
624 |
#else |
|
610 | 625 |
basicIo = fileIo; |
626 |
#endif |
|
611 | 627 |
} |
612 | 628 |
else { |
613 | 629 |
basicIo.reset(new MemIo); |
exiv2-0.26-svn-1/src/bmpimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
46 | 46 |
// class member definitions |
47 | 47 |
namespace Exiv2 { |
48 | 48 | |
49 |
#ifdef EXV_USING_CPP_ELEVEN |
|
50 |
BmpImage::BmpImage(BasicIo::AutoPtr io) |
|
51 |
: Image(ImageType::bmp, mdNone, std::move(io)) |
|
52 |
{ |
|
53 |
} // BmpImage::BmpImage |
|
54 |
#else |
|
49 | 55 |
BmpImage::BmpImage(BasicIo::AutoPtr io) |
50 | 56 |
: Image(ImageType::bmp, mdNone, io) |
51 | 57 |
{ |
52 | 58 |
} // BmpImage::BmpImage |
59 |
#endif |
|
53 | 60 | |
54 | 61 |
std::string BmpImage::mimeType() const |
55 | 62 |
{ |
... | ... | |
131 | 138 |
// free functions |
132 | 139 |
Image::AutoPtr newBmpInstance(BasicIo::AutoPtr io, bool /*create*/) |
133 | 140 |
{ |
141 |
#ifdef EXV_USING_CPP_ELEVEN |
|
142 |
Image::AutoPtr image(new BmpImage(std::move(io))); |
|
143 |
#else |
|
134 | 144 |
Image::AutoPtr image(new BmpImage(io)); |
145 |
#endif |
|
135 | 146 |
if (!image->good()) |
136 | 147 |
{ |
137 | 148 |
image.reset(); |
exiv2-0.26-svn-1/src/cr2image.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
51 | 51 | |
52 | 52 |
using namespace Internal; |
53 | 53 | |
54 |
#ifdef EXV_USING_CPP_ELEVEN |
|
55 |
Cr2Image::Cr2Image(BasicIo::AutoPtr io, bool /*create*/) |
|
56 |
: Image(ImageType::cr2, mdExif | mdIptc | mdXmp, std::move(io)) |
|
57 |
#else |
|
54 | 58 |
Cr2Image::Cr2Image(BasicIo::AutoPtr io, bool /*create*/) |
55 | 59 |
: Image(ImageType::cr2, mdExif | mdIptc | mdXmp, io) |
60 |
#endif |
|
56 | 61 |
{ |
57 | 62 |
} // Cr2Image::Cr2Image |
58 | 63 | |
... | ... | |
188 | 193 |
ed.end()); |
189 | 194 |
} |
190 | 195 | |
196 |
#ifdef EXV_USING_CPP_ELEVEN |
|
197 |
std::unique_ptr<TiffHeaderBase> header(new Cr2Header(byteOrder)); |
|
198 |
#else |
|
191 | 199 |
std::auto_ptr<TiffHeaderBase> header(new Cr2Header(byteOrder)); |
200 |
#endif |
|
192 | 201 |
OffsetWriter offsetWriter; |
193 | 202 |
offsetWriter.setOrigin(OffsetWriter::cr2RawIfdOffset, Cr2Header::offset2addr(), byteOrder); |
194 | 203 |
return TiffParserWorker::encode(io, |
... | ... | |
207 | 216 |
// free functions |
208 | 217 |
Image::AutoPtr newCr2Instance(BasicIo::AutoPtr io, bool create) |
209 | 218 |
{ |
219 |
#ifdef EXV_USING_CPP_ELEVEN |
|
220 |
Image::AutoPtr image(new Cr2Image(std::move(io), create)); |
|
221 |
#else |
|
210 | 222 |
Image::AutoPtr image(new Cr2Image(io, create)); |
223 |
#endif |
|
211 | 224 |
if (!image->good()) { |
212 | 225 |
image.reset(); |
213 | 226 |
} |
exiv2-0.26-svn-1/src/crwimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
82 | 82 | |
83 | 83 |
using namespace Internal; |
84 | 84 | |
85 |
#ifdef EXV_USING_CPP_ELEVEN |
|
86 |
CrwImage::CrwImage(BasicIo::AutoPtr io, bool /*create*/) |
|
87 |
: Image(ImageType::crw, mdExif | mdComment, std::move(io)) |
|
88 |
#else |
|
85 | 89 |
CrwImage::CrwImage(BasicIo::AutoPtr io, bool /*create*/) |
86 | 90 |
: Image(ImageType::crw, mdExif | mdComment, io) |
91 |
#endif |
|
87 | 92 |
{ |
88 | 93 |
} // CrwImage::CrwImage |
89 | 94 | |
... | ... | |
222 | 227 |
// free functions |
223 | 228 |
Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create) |
224 | 229 |
{ |
230 |
#ifdef EXV_USING_CPP_ELEVEN |
|
231 |
Image::AutoPtr image(new CrwImage(std::move(io), create)); |
|
232 |
#else |
|
225 | 233 |
Image::AutoPtr image(new CrwImage(io, create)); |
234 |
#endif |
|
226 | 235 |
if (!image->good()) { |
227 | 236 |
image.reset(); |
228 | 237 |
} |
... | ... | |
360 | 369 | |
361 | 370 |
void CiffComponent::add(AutoPtr component) |
362 | 371 |
{ |
372 |
#ifdef EXV_USING_CPP_ELEVEN |
|
373 |
doAdd(std::move(component)); |
|
374 |
#else |
|
363 | 375 |
doAdd(component); |
376 |
#endif |
|
364 | 377 |
} |
365 | 378 | |
366 | 379 |
void CiffEntry::doAdd(AutoPtr /*component*/) |
... | ... | |
476 | 489 |
} |
477 | 490 |
m->setDir(this->tag()); |
478 | 491 |
m->read(pData, size, o, byteOrder); |
492 |
#ifdef EXV_USING_CPP_ELEVEN |
|
493 |
add(std::move(m)); |
|
494 |
#else |
|
479 | 495 |
add(m); |
496 |
#endif |
|
480 | 497 |
o += 10; |
481 | 498 |
} |
482 | 499 |
} // CiffDirectory::readDirectory |
... | ... | |
848 | 865 |
// Directory doesn't exist yet, add it |
849 | 866 |
m_ = AutoPtr(new CiffDirectory(csd.crwDir_, csd.parent_)); |
850 | 867 |
cc_ = m_.get(); |
868 |
#ifdef EXV_USING_CPP_ELEVEN |
|
869 |
add(std::move(m_)); |
|
870 |
#else |
|
851 | 871 |
add(m_); |
872 |
#endif |
|
852 | 873 |
} |
853 | 874 |
// Recursive call to next lower level directory |
854 | 875 |
cc_ = cc_->add(crwDirs, crwTagId); |
... | ... | |
865 | 886 |
// Tag doesn't exist yet, add it |
866 | 887 |
m_ = AutoPtr(new CiffEntry(crwTagId, tag())); |
867 | 888 |
cc_ = m_.get(); |
889 |
#ifdef EXV_USING_CPP_ELEVEN |
|
890 |
add(std::move(m_)); |
|
891 |
#else |
|
868 | 892 |
add(m_); |
893 |
#endif |
|
869 | 894 |
} |
870 | 895 |
} |
871 | 896 |
return cc_; |
exiv2-0.26-svn-1/src/crwimage_int.hpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
96 | 96 |
class CiffComponent { |
97 | 97 |
public: |
98 | 98 |
//! CiffComponent auto_ptr type |
99 |
#ifdef EXV_USING_CPP_ELEVEN |
|
100 |
typedef std::unique_ptr<CiffComponent> AutoPtr; |
|
101 |
#else |
|
99 | 102 |
typedef std::auto_ptr<CiffComponent> AutoPtr; |
103 |
#endif |
|
100 | 104 |
//! Container type to hold all metadata |
101 | 105 |
typedef std::vector<CiffComponent*> Components; |
102 | 106 | |
... | ... | |
440 | 444 |
class CiffHeader { |
441 | 445 |
public: |
442 | 446 |
//! CiffHeader auto_ptr type |
447 |
#ifdef EXV_USING_CPP_ELEVEN |
|
448 |
typedef std::unique_ptr<CiffHeader> AutoPtr; |
|
449 |
#else |
|
443 | 450 |
typedef std::auto_ptr<CiffHeader> AutoPtr; |
451 |
#endif |
|
444 | 452 | |
445 | 453 |
//! @name Creators |
446 | 454 |
//@{ |
exiv2-0.26-svn-1/src/epsimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
1079 | 1079 |
namespace Exiv2 |
1080 | 1080 |
{ |
1081 | 1081 | |
1082 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1083 |
EpsImage::EpsImage(BasicIo::AutoPtr io, bool create) |
|
1084 |
: Image(ImageType::eps, mdXmp, std::move(io)) |
|
1085 |
#else |
|
1082 | 1086 |
EpsImage::EpsImage(BasicIo::AutoPtr io, bool create) |
1083 | 1087 |
: Image(ImageType::eps, mdXmp, io) |
1088 |
#endif |
|
1084 | 1089 |
{ |
1085 | 1090 |
//LogMsg::setLevel(LogMsg::debug); |
1086 | 1091 |
if (create) { |
... | ... | |
1157 | 1162 |
// free functions |
1158 | 1163 |
Image::AutoPtr newEpsInstance(BasicIo::AutoPtr io, bool create) |
1159 | 1164 |
{ |
1165 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1166 |
Image::AutoPtr image(new EpsImage(std::move(io), create)); |
|
1167 |
#else |
|
1160 | 1168 |
Image::AutoPtr image(new EpsImage(io, create)); |
1169 |
#endif |
|
1161 | 1170 |
if (!image->good()) { |
1162 | 1171 |
image.reset(); |
1163 | 1172 |
} |
exiv2-0.26-svn-1/src/exif.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
85 | 85 |
class Thumbnail { |
86 | 86 |
public: |
87 | 87 |
//! Shortcut for a %Thumbnail auto pointer. |
88 |
#ifdef EXV_USING_CPP_ELEVEN |
|
89 |
typedef std::unique_ptr<Thumbnail> AutoPtr; |
|
90 |
#else |
|
88 | 91 |
typedef std::auto_ptr<Thumbnail> AutoPtr; |
92 |
#endif |
|
89 | 93 | |
90 | 94 |
//! @name Creators |
91 | 95 |
//@{ |
... | ... | |
128 | 132 |
class TiffThumbnail : public Thumbnail { |
129 | 133 |
public: |
130 | 134 |
//! Shortcut for a %TiffThumbnail auto pointer. |
135 |
#ifdef EXV_USING_CPP_ELEVEN |
|
136 |
typedef std::unique_ptr<TiffThumbnail> AutoPtr; |
|
137 |
#else |
|
131 | 138 |
typedef std::auto_ptr<TiffThumbnail> AutoPtr; |
139 |
#endif |
|
132 | 140 | |
133 | 141 |
//! @name Manipulators |
134 | 142 |
//@{ |
... | ... | |
152 | 160 |
class JpegThumbnail : public Thumbnail { |
153 | 161 |
public: |
154 | 162 |
//! Shortcut for a %JpegThumbnail auto pointer. |
163 |
#ifdef EXV_USING_CPP_ELEVEN |
|
164 |
typedef std::unique_ptr<JpegThumbnail> AutoPtr; |
|
165 |
#else |
|
155 | 166 |
typedef std::auto_ptr<JpegThumbnail> AutoPtr; |
167 |
#endif |
|
156 | 168 | |
157 | 169 |
//! @name Manipulators |
158 | 170 |
//@{ |
... | ... | |
197 | 209 |
template<typename T> |
198 | 210 |
Exiv2::Exifdatum& setValue(Exiv2::Exifdatum& exifDatum, const T& value) |
199 | 211 |
{ |
212 |
#ifdef EXV_USING_CPP_ELEVEN |
|
213 |
std::unique_ptr<Exiv2::ValueType<T> > v |
|
214 |
= std::unique_ptr<Exiv2::ValueType<T> >(new Exiv2::ValueType<T>); |
|
215 |
#else |
|
200 | 216 |
std::auto_ptr<Exiv2::ValueType<T> > v |
201 | 217 |
= std::auto_ptr<Exiv2::ValueType<T> >(new Exiv2::ValueType<T>); |
218 |
#endif |
|
202 | 219 |
v->value_.push_back(value); |
220 |
#ifdef EXV_USING_CPP_ELEVEN |
|
221 |
exifDatum.value_ = std::move(v); |
|
222 |
#else |
|
203 | 223 |
exifDatum.value_ = v; |
224 |
#endif |
|
204 | 225 |
return exifDatum; |
205 | 226 |
} |
206 | 227 | |
... | ... | |
414 | 435 | |
415 | 436 |
Value::AutoPtr Exifdatum::getValue() const |
416 | 437 |
{ |
438 |
#ifdef EXV_USING_CPP_ELEVEN |
|
439 |
return value_.get() == 0 ? Value::AutoPtr(nullptr) : value_->clone(); |
|
440 |
#else |
|
417 | 441 |
return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone(); |
442 |
#endif |
|
418 | 443 |
} |
419 | 444 | |
420 | 445 |
long Exifdatum::sizeDataArea() const |
... | ... | |
706 | 731 | |
707 | 732 |
// Encode and check if the result fits into a JPEG Exif APP1 segment |
708 | 733 |
MemIo mio1; |
734 |
#ifdef EXV_USING_CPP_ELEVEN |
|
735 |
std::unique_ptr<TiffHeaderBase> header(new TiffHeader(byteOrder, 0x00000008, false)); |
|
736 |
#else |
|
709 | 737 |
std::auto_ptr<TiffHeaderBase> header(new TiffHeader(byteOrder, 0x00000008, false)); |
738 |
#endif |
|
710 | 739 |
WriteMethod wm = TiffParserWorker::encode(mio1, |
711 | 740 |
pData, |
712 | 741 |
size, |
exiv2-0.26-svn-1/src/gifimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
47 | 47 |
// class member definitions |
48 | 48 |
namespace Exiv2 { |
49 | 49 | |
50 |
#ifdef EXV_USING_CPP_ELEVEN |
|
51 |
GifImage::GifImage(BasicIo::AutoPtr io) |
|
52 |
: Image(ImageType::gif, mdNone, std::move(io)) |
|
53 |
#else |
|
50 | 54 |
GifImage::GifImage(BasicIo::AutoPtr io) |
51 | 55 |
: Image(ImageType::gif, mdNone, io) |
56 |
#endif |
|
52 | 57 |
{ |
53 | 58 |
} // GifImage::GifImage |
54 | 59 | |
... | ... | |
111 | 116 |
// free functions |
112 | 117 |
Image::AutoPtr newGifInstance(BasicIo::AutoPtr io, bool /*create*/) |
113 | 118 |
{ |
119 |
#ifdef EXV_USING_CPP_ELEVEN |
|
120 |
Image::AutoPtr image(new GifImage(std::move(io))); |
|
121 |
#else |
|
114 | 122 |
Image::AutoPtr image(new GifImage(io)); |
123 |
#endif |
|
115 | 124 |
if (!image->good()) |
116 | 125 |
{ |
117 | 126 |
image.reset(); |
exiv2-0.26-svn-1/src/image.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
152 | 155 |
Image::Image(int imageType, |
153 | 156 |
uint16_t supportedMetadata, |
154 | 157 |
BasicIo::AutoPtr io) |
158 |
#ifdef EXV_USING_CPP_ELEVEN |
|
159 |
: io_(std::move(io)), |
|
160 |
#else |
|
155 | 161 |
: io_(io), |
162 |
#endif |
|
156 | 163 |
pixelWidth_(0), |
157 | 164 |
pixelHeight_(0), |
158 | 165 |
imageType_(imageType), |
... | ... | |
847 | 865 |
Image::AutoPtr ImageFactory::open(const byte* data, long size) |
848 | 866 |
{ |
849 | 867 |
BasicIo::AutoPtr io(new MemIo(data, size)); |
868 |
#ifdef EXV_USING_CPP_ELEVEN |
|
869 |
Image::AutoPtr image = open(std::move(io)); // may throw |
|
870 |
#else |
|
850 | 871 |
Image::AutoPtr image = open(io); // may throw |
872 |
#endif |
|
851 | 873 |
if (image.get() == 0) throw Error(12); |
852 | 874 |
return image; |
853 | 875 |
} |
... | ... | |
859 | 881 |
} |
860 | 882 |
for (unsigned int i = 0; registry[i].imageType_ != ImageType::none; ++i) { |
861 | 883 |
if (registry[i].isThisType_(*io, false)) { |
884 |
#ifdef EXV_USING_CPP_ELEVEN |
|
885 |
return registry[i].newInstance_(std::move(io), false); |
|
886 |
#else |
|
862 | 887 |
return registry[i].newInstance_(io, false); |
888 |
#endif |
|
863 | 889 |
} |
864 | 890 |
} |
865 | 891 |
return Image::AutoPtr(); |
... | ... | |
868 | 894 |
Image::AutoPtr ImageFactory::create(int type, |
869 | 895 |
const std::string& path) |
870 | 896 |
{ |
897 |
#ifdef EXV_USING_CPP_ELEVEN |
|
898 |
std::unique_ptr<FileIo> fileIo(new FileIo(path)); |
|
899 |
#else |
|
871 | 900 |
std::auto_ptr<FileIo> fileIo(new FileIo(path)); |
901 |
#endif |
|
872 | 902 |
// Create or overwrite the file, then close it |
873 | 903 |
if (fileIo->open("w+b") != 0) { |
874 | 904 |
throw Error(10, path, "w+b", strError()); |
875 | 905 |
} |
876 | 906 |
fileIo->close(); |
907 |
#ifdef EXV_USING_CPP_ELEVEN |
|
908 |
BasicIo::AutoPtr io(std::move(fileIo)); |
|
909 |
Image::AutoPtr image = create(type, std::move(io)); |
|
910 |
#else |
|
877 | 911 |
BasicIo::AutoPtr io(fileIo); |
878 | 912 |
Image::AutoPtr image = create(type, io); |
913 |
#endif |
|
879 | 914 |
if (image.get() == 0) throw Error(13, type); |
880 | 915 |
return image; |
881 | 916 |
} |
... | ... | |
884 | 919 |
Image::AutoPtr ImageFactory::create(int type, |
885 | 920 |
const std::wstring& wpath) |
886 | 921 |
{ |
922 |
#ifdef EXV_USING_CPP_ELEVEN |
|
923 |
std::unique_ptr<FileIo> fileIo(new FileIo(wpath)); |
|
924 |
#else |
|
887 | 925 |
std::auto_ptr<FileIo> fileIo(new FileIo(wpath)); |
926 |
#endif |
|
888 | 927 |
// Create or overwrite the file, then close it |
889 | 928 |
if (fileIo->open("w+b") != 0) { |
890 | 929 |
throw WError(10, wpath, "w+b", strError().c_str()); |
... | ... | |
900 | 939 |
Image::AutoPtr ImageFactory::create(int type) |
901 | 940 |
{ |
902 | 941 |
BasicIo::AutoPtr io(new MemIo); |
942 |
#ifdef EXV_USING_CPP_ELEVEN |
|
943 |
Image::AutoPtr image = create(type, std::move(io)); |
|
944 |
#else |
|
903 | 945 |
Image::AutoPtr image = create(type, io); |
946 |
#endif |
|
904 | 947 |
if (image.get() == 0) throw Error(13, type); |
905 | 948 |
return image; |
906 | 949 |
} |
... | ... | |
911 | 954 |
// BasicIo instance does not need to be open |
912 | 955 |
const Registry* r = find(registry, type); |
913 | 956 |
if (0 != r) { |
957 |
#ifdef EXV_USING_CPP_ELEVEN |
|
958 |
return r->newInstance_(std::move(io), true); |
|
959 |
#else |
|
914 | 960 |
return r->newInstance_(io, true); |
961 |
#endif |
|
915 | 962 |
} |
916 | 963 |
return Image::AutoPtr(); |
917 | 964 |
} // ImageFactory::create |
exiv2-0.26-svn-1/src/iptc.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
210 | 210 | |
211 | 211 |
Value::AutoPtr Iptcdatum::getValue() const |
212 | 212 |
{ |
213 |
#ifdef EXV_USING_CPP_ELEVEN |
|
214 |
return value_.get() == 0 ? Value::AutoPtr(nullptr) : value_->clone(); |
|
215 |
#else |
|
213 | 216 |
return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone(); |
217 |
#endif |
|
214 | 218 |
} |
215 | 219 | |
216 | 220 |
const Value& Iptcdatum::value() const |
... | ... | |
237 | 241 |
{ |
238 | 242 |
UShortValue::AutoPtr v(new UShortValue); |
239 | 243 |
v->value_.push_back(value); |
244 |
#ifdef EXV_USING_CPP_ELEVEN |
|
245 |
value_ = std::move(v); |
|
246 |
#else |
|
240 | 247 |
value_ = v; |
248 |
#endif |
|
241 | 249 |
return *this; |
242 | 250 |
} |
243 | 251 |
exiv2-0.26-svn-1/src/jp2image.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
141 | 141 |
namespace Exiv2 |
142 | 142 |
{ |
143 | 143 | |
144 |
#ifdef EXV_USING_CPP_ELEVEN |
|
145 |
Jp2Image::Jp2Image(BasicIo::AutoPtr io, bool create) |
|
146 |
: Image(ImageType::jp2, mdExif | mdIptc | mdXmp, std::move(io)) |
|
147 |
#else |
|
144 | 148 |
Jp2Image::Jp2Image(BasicIo::AutoPtr io, bool create) |
145 | 149 |
: Image(ImageType::jp2, mdExif | mdIptc | mdXmp, io) |
150 |
#endif |
|
146 | 151 |
{ |
147 | 152 |
if (create) |
148 | 153 |
{ |
... | ... | |
911 | 916 |
// free functions |
912 | 917 |
Image::AutoPtr newJp2Instance(BasicIo::AutoPtr io, bool create) |
913 | 918 |
{ |
919 |
#ifdef EXV_USING_CPP_ELEVEN |
|
920 |
Image::AutoPtr image(new Jp2Image(std::move(io), create)); |
|
921 |
#else |
|
914 | 922 |
Image::AutoPtr image(new Jp2Image(io, create)); |
923 |
#endif |
|
915 | 924 |
if (!image->good()) |
916 | 925 |
{ |
917 | 926 |
image.reset(); |
exiv2-0.26-svn-1/src/jpgimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
302 | 302 | |
303 | 303 |
} // Photoshop::setIptcIrb |
304 | 304 | |
305 |
#ifdef EXV_USING_CPP_ELEVEN |
|
306 |
JpegBase::JpegBase(int type, BasicIo::AutoPtr io, bool create, |
|
307 |
const byte initData[], long dataSize) |
|
308 |
: Image(type, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) |
|
309 |
#else |
|
305 | 310 |
JpegBase::JpegBase(int type, BasicIo::AutoPtr io, bool create, |
306 | 311 |
const byte initData[], long dataSize) |
307 | 312 |
: Image(type, mdExif | mdIptc | mdXmp | mdComment, io) |
313 |
#endif |
|
308 | 314 |
{ |
309 | 315 |
if (create) { |
310 | 316 |
initImage(initData, dataSize); |
... | ... | |
1244 | 1250 |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xDA,0x00,0x0C,0x03,0x01,0x00,0x02, |
1245 | 1251 |
0x11,0x03,0x11,0x00,0x3F,0x00,0xA0,0x00,0x0F,0xFF,0xD9 }; |
1246 | 1252 | |
1253 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1254 |
JpegImage::JpegImage(BasicIo::AutoPtr io, bool create) |
|
1255 |
: JpegBase(ImageType::jpeg, std::move(io), create, blank_, sizeof(blank_)) |
|
1256 |
#else |
|
1247 | 1257 |
JpegImage::JpegImage(BasicIo::AutoPtr io, bool create) |
1248 | 1258 |
: JpegBase(ImageType::jpeg, io, create, blank_, sizeof(blank_)) |
1259 |
#endif |
|
1249 | 1260 |
{ |
1250 | 1261 |
} |
1251 | 1262 | |
... | ... | |
1272 | 1283 | |
1273 | 1284 |
Image::AutoPtr newJpegInstance(BasicIo::AutoPtr io, bool create) |
1274 | 1285 |
{ |
1286 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1287 |
Image::AutoPtr image(new JpegImage(std::move(io), create)); |
|
1288 |
#else |
|
1275 | 1289 |
Image::AutoPtr image(new JpegImage(io, create)); |
1290 |
#endif |
|
1276 | 1291 |
if (!image->good()) { |
1277 | 1292 |
image.reset(); |
1278 | 1293 |
} |
... | ... | |
1296 | 1311 |
const char ExvImage::exiv2Id_[] = "Exiv2"; |
1297 | 1312 |
const byte ExvImage::blank_[] = { 0xff,0x01,'E','x','i','v','2',0xff,0xd9 }; |
1298 | 1313 | |
1314 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1315 |
ExvImage::ExvImage(BasicIo::AutoPtr io, bool create) |
|
1316 |
: JpegBase(ImageType::exv, std::move(io), create, blank_, sizeof(blank_)) |
|
1317 |
#else |
|
1299 | 1318 |
ExvImage::ExvImage(BasicIo::AutoPtr io, bool create) |
1300 | 1319 |
: JpegBase(ImageType::exv, io, create, blank_, sizeof(blank_)) |
1320 |
#endif |
|
1301 | 1321 |
{ |
1302 | 1322 |
} |
1303 | 1323 | |
... | ... | |
1326 | 1346 |
Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create) |
1327 | 1347 |
{ |
1328 | 1348 |
Image::AutoPtr image; |
1349 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1350 |
image = Image::AutoPtr(new ExvImage(std::move(io), create)); |
|
1351 |
#else |
|
1329 | 1352 |
image = Image::AutoPtr(new ExvImage(io, create)); |
1353 |
#endif |
|
1330 | 1354 |
if (!image->good()) image.reset(); |
1331 | 1355 |
return image; |
1332 | 1356 |
} |
exiv2-0.26-svn-1/src/matroskavideo.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
482 | 482 | |
483 | 483 |
using namespace Exiv2::Internal; |
484 | 484 | |
485 |
#ifdef EXV_USING_CPP_ELEVEN |
|
486 |
MatroskaVideo::MatroskaVideo(BasicIo::AutoPtr io) |
|
487 |
: Image(ImageType::mkv, mdNone, std::move(io)) |
|
488 |
#else |
|
485 | 489 |
MatroskaVideo::MatroskaVideo(BasicIo::AutoPtr io) |
486 | 490 |
: Image(ImageType::mkv, mdNone, io) |
491 |
#endif |
|
487 | 492 |
{ |
488 | 493 |
} // MatroskaVideo::MatroskaVideo |
489 | 494 | |
... | ... | |
743 | 748 | |
744 | 749 |
Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool /*create*/) |
745 | 750 |
{ |
751 |
#ifdef EXV_USING_CPP_ELEVEN |
|
752 |
Image::AutoPtr image(new MatroskaVideo(std::move(io))); |
|
753 |
#else |
|
746 | 754 |
Image::AutoPtr image(new MatroskaVideo(io)); |
755 |
#endif |
|
747 | 756 |
if (!image->good()) { |
748 | 757 |
image.reset(); |
749 | 758 |
} |
exiv2-0.26-svn-1/src/mrwimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
49 | 49 |
// class member definitions |
50 | 50 |
namespace Exiv2 { |
51 | 51 | |
52 |
#ifdef EXV_USING_CPP_ELEVEN |
|
53 |
MrwImage::MrwImage(BasicIo::AutoPtr io, bool /*create*/) |
|
54 |
: Image(ImageType::mrw, mdExif | mdIptc | mdXmp, std::move(io)) |
|
55 |
#else |
|
52 | 56 |
MrwImage::MrwImage(BasicIo::AutoPtr io, bool /*create*/) |
53 | 57 |
: Image(ImageType::mrw, mdExif | mdIptc | mdXmp, io) |
58 |
#endif |
|
54 | 59 |
{ |
55 | 60 |
} // MrwImage::MrwImage |
56 | 61 | |
... | ... | |
158 | 163 |
// free functions |
159 | 164 |
Image::AutoPtr newMrwInstance(BasicIo::AutoPtr io, bool create) |
160 | 165 |
{ |
166 |
#ifdef EXV_USING_CPP_ELEVEN |
|
167 |
Image::AutoPtr image(new MrwImage(std::move(io), create)); |
|
168 |
#else |
|
161 | 169 |
Image::AutoPtr image(new MrwImage(io, create)); |
170 |
#endif |
|
162 | 171 |
if (!image->good()) { |
163 | 172 |
image.reset(); |
164 | 173 |
} |
exiv2-0.26-svn-1/src/orfimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
54 | 54 | |
55 | 55 |
using namespace Internal; |
56 | 56 | |
57 |
#ifdef EXV_USING_CPP_ELEVEN |
|
58 |
OrfImage::OrfImage(BasicIo::AutoPtr io, bool create) |
|
59 |
: TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ std::move(io),create) |
|
60 |
#else |
|
57 | 61 |
OrfImage::OrfImage(BasicIo::AutoPtr io, bool create) |
58 | 62 |
: TiffImage(/*ImageType::orf, mdExif | mdIptc | mdXmp,*/ io,create) |
63 |
#endif |
|
59 | 64 |
{ |
60 | 65 |
setTypeSupported(ImageType::orf, mdExif | mdIptc | mdXmp); |
61 | 66 |
} // OrfImage::OrfImage |
... | ... | |
185 | 190 |
ed.end()); |
186 | 191 |
} |
187 | 192 | |
193 |
#ifdef EXV_USING_CPP_ELEVEN |
|
194 |
std::unique_ptr<TiffHeaderBase> header(new OrfHeader(byteOrder)); |
|
195 |
#else |
|
188 | 196 |
std::auto_ptr<TiffHeaderBase> header(new OrfHeader(byteOrder)); |
197 |
#endif |
|
189 | 198 |
return TiffParserWorker::encode(io, |
190 | 199 |
pData, |
191 | 200 |
size, |
... | ... | |
202 | 211 |
// free functions |
203 | 212 |
Image::AutoPtr newOrfInstance(BasicIo::AutoPtr io, bool create) |
204 | 213 |
{ |
214 |
#ifdef EXV_USING_CPP_ELEVEN |
|
215 |
Image::AutoPtr image(new OrfImage(std::move(io), create)); |
|
216 |
#else |
|
205 | 217 |
Image::AutoPtr image(new OrfImage(io, create)); |
218 |
#endif |
|
206 | 219 |
if (!image->good()) { |
207 | 220 |
image.reset(); |
208 | 221 |
} |
exiv2-0.26-svn-1/src/pgfimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
86 | 86 |
return result; |
87 | 87 |
} |
88 | 88 | |
89 |
#ifdef EXV_USING_CPP_ELEVEN |
|
90 |
PgfImage::PgfImage(BasicIo::AutoPtr io, bool create) |
|
91 |
: Image(ImageType::pgf, mdExif | mdIptc| mdXmp | mdComment, std::move(io)) |
|
92 |
, bSwap_(isBigEndianPlatform()) |
|
93 |
#else |
|
89 | 94 |
PgfImage::PgfImage(BasicIo::AutoPtr io, bool create) |
90 | 95 |
: Image(ImageType::pgf, mdExif | mdIptc| mdXmp | mdComment, io) |
91 | 96 |
, bSwap_(isBigEndianPlatform()) |
97 |
#endif |
|
92 | 98 |
{ |
93 | 99 |
if (create) |
94 | 100 |
{ |
... | ... | |
321 | 327 |
// free functions |
322 | 328 |
Image::AutoPtr newPgfInstance(BasicIo::AutoPtr io, bool create) |
323 | 329 |
{ |
330 |
#ifdef EXV_USING_CPP_ELEVEN |
|
331 |
Image::AutoPtr image(new PgfImage(std::move(io), create)); |
|
332 |
#else |
|
324 | 333 |
Image::AutoPtr image(new PgfImage(io, create)); |
334 |
#endif |
|
325 | 335 |
if (!image->good()) |
326 | 336 |
{ |
327 | 337 |
image.reset(); |
exiv2-0.26-svn-1/src/pngimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
69 | 69 | |
70 | 70 |
using namespace Internal; |
71 | 71 | |
72 |
#ifdef EXV_USING_CPP_ELEVEN |
|
73 |
PngImage::PngImage(BasicIo::AutoPtr io, bool create) |
|
74 |
: Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, std::move(io)) |
|
75 |
#else |
|
72 | 76 |
PngImage::PngImage(BasicIo::AutoPtr io, bool create) |
73 | 77 |
: Image(ImageType::png, mdExif | mdIptc | mdXmp | mdComment, io) |
78 |
#endif |
|
74 | 79 |
{ |
75 | 80 |
if (create) |
76 | 81 |
{ |
... | ... | |
707 | 712 |
// free functions |
708 | 713 |
Image::AutoPtr newPngInstance(BasicIo::AutoPtr io, bool create) |
709 | 714 |
{ |
715 |
#ifdef EXV_USING_CPP_ELEVEN |
|
716 |
Image::AutoPtr image(new PngImage(std::move(io), create)); |
|
717 |
#else |
|
710 | 718 |
Image::AutoPtr image(new PngImage(io, create)); |
719 |
#endif |
|
711 | 720 |
if (!image->good()) |
712 | 721 |
{ |
713 | 722 |
image.reset(); |
exiv2-0.26-svn-1/src/preview.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
95 | 95 |
virtual ~Loader() {} |
96 | 96 | |
97 | 97 |
//! Loader auto pointer |
98 |
#ifdef EXV_USING_CPP_ELEVEN |
|
99 |
typedef std::unique_ptr<Loader> AutoPtr; |
|
100 |
#else |
|
98 | 101 |
typedef std::auto_ptr<Loader> AutoPtr; |
102 |
#endif |
|
99 | 103 | |
100 | 104 |
//! Create a Loader subclass for requested id |
101 | 105 |
static AutoPtr create(PreviewId id, const Image &image); |
exiv2-0.26-svn-1/src/psdimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
125 | 125 |
// class member definitions |
126 | 126 |
namespace Exiv2 { |
127 | 127 | |
128 |
#ifdef EXV_USING_CPP_ELEVEN |
|
129 |
PsdImage::PsdImage(BasicIo::AutoPtr io) |
|
130 |
: Image(ImageType::psd, mdExif | mdIptc | mdXmp, std::move(io)) |
|
131 |
#else |
|
128 | 132 |
PsdImage::PsdImage(BasicIo::AutoPtr io) |
129 | 133 |
: Image(ImageType::psd, mdExif | mdIptc | mdXmp, io) |
134 |
#endif |
|
130 | 135 |
{ |
131 | 136 |
} // PsdImage::PsdImage |
132 | 137 | |
... | ... | |
683 | 688 |
// free functions |
684 | 689 |
Image::AutoPtr newPsdInstance(BasicIo::AutoPtr io, bool /*create*/) |
685 | 690 |
{ |
691 |
#ifdef EXV_USING_CPP_ELEVEN |
|
692 |
Image::AutoPtr image(new PsdImage(std::move(io))); |
|
693 |
#else |
|
686 | 694 |
Image::AutoPtr image(new PsdImage(io)); |
695 |
#endif |
|
687 | 696 |
if (!image->good()) |
688 | 697 |
{ |
689 | 698 |
image.reset(); |
exiv2-0.26-svn-1/src/quicktimevideo.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
611 | 611 | |
612 | 612 |
using namespace Exiv2::Internal; |
613 | 613 | |
614 |
#ifdef EXV_USING_CPP_ELEVEN |
|
615 |
QuickTimeVideo::QuickTimeVideo(BasicIo::AutoPtr io) |
|
616 |
: Image(ImageType::qtime, mdNone, std::move(io)) |
|
617 |
, timeScale_(1) |
|
618 |
#else |
|
614 | 619 |
QuickTimeVideo::QuickTimeVideo(BasicIo::AutoPtr io) |
615 | 620 |
: Image(ImageType::qtime, mdNone, io) |
616 | 621 |
, timeScale_(1) |
622 |
#endif |
|
617 | 623 |
{ |
618 | 624 |
} // QuickTimeVideo::QuickTimeVideo |
619 | 625 | |
... | ... | |
1632 | 1638 | |
1633 | 1639 | |
1634 | 1640 |
Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool /*create*/) { |
1641 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1642 |
Image::AutoPtr image(new QuickTimeVideo(std::move(io))); |
|
1643 |
#else |
|
1635 | 1644 |
Image::AutoPtr image(new QuickTimeVideo(io)); |
1645 |
#endif |
|
1636 | 1646 |
if (!image->good()) { |
1637 | 1647 |
image.reset(); |
1638 | 1648 |
} |
exiv2-0.26-svn-1/src/rafimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
49 | 49 |
// class member definitions |
50 | 50 |
namespace Exiv2 { |
51 | 51 | |
52 |
#ifdef EXV_USING_CPP_ELEVEN |
|
53 |
RafImage::RafImage(BasicIo::AutoPtr io, bool /*create*/) |
|
54 |
: Image(ImageType::raf, mdExif | mdIptc | mdXmp, std::move(io)) |
|
55 |
#else |
|
52 | 56 |
RafImage::RafImage(BasicIo::AutoPtr io, bool /*create*/) |
53 | 57 |
: Image(ImageType::raf, mdExif | mdIptc | mdXmp, io) |
58 |
#endif |
|
54 | 59 |
{ |
55 | 60 |
} // RafImage::RafImage |
56 | 61 | |
... | ... | |
135 | 140 |
// free functions |
136 | 141 |
Image::AutoPtr newRafInstance(BasicIo::AutoPtr io, bool create) |
137 | 142 |
{ |
143 |
#ifdef EXV_USING_CPP_ELEVEN |
|
144 |
Image::AutoPtr image(new RafImage(std::move(io), create)); |
|
145 |
#else |
|
138 | 146 |
Image::AutoPtr image(new RafImage(io, create)); |
147 |
#endif |
|
139 | 148 |
if (!image->good()) { |
140 | 149 |
image.reset(); |
141 | 150 |
} |
exiv2-0.26-svn-1/src/riffvideo.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
506 | 506 |
namespace Exiv2 { |
507 | 507 |
using namespace Exiv2::Internal; |
508 | 508 | |
509 |
#ifdef EXV_USING_CPP_ELEVEN |
|
510 |
RiffVideo::RiffVideo(BasicIo::AutoPtr io) |
|
511 |
: Image(ImageType::riff, mdNone, std::move(io)) |
|
512 |
#else |
|
509 | 513 |
RiffVideo::RiffVideo(BasicIo::AutoPtr io) |
510 | 514 |
: Image(ImageType::riff, mdNone, io) |
515 |
#endif |
|
511 | 516 |
{ |
512 | 517 |
} // RiffVideo::RiffVideo |
513 | 518 | |
... | ... | |
1228 | 1233 | |
1229 | 1234 |
Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool /*create*/) |
1230 | 1235 |
{ |
1236 |
#ifdef EXV_USING_CPP_ELEVEN |
|
1237 |
Image::AutoPtr image(new RiffVideo(std::move(io))); |
|
1238 |
#else |
|
1231 | 1239 |
Image::AutoPtr image(new RiffVideo(io)); |
1240 |
#endif |
|
1232 | 1241 |
if (!image->good()) { |
1233 | 1242 |
image.reset(); |
1234 | 1243 |
} |
exiv2-0.26-svn-1/src/rw2image.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
52 | 52 | |
53 | 53 |
using namespace Internal; |
54 | 54 | |
55 |
#ifdef EXV_USING_CPP_ELEVEN |
|
56 |
Rw2Image::Rw2Image(BasicIo::AutoPtr io) |
|
57 |
: Image(ImageType::rw2, mdExif | mdIptc | mdXmp, std::move(io)) |
|
58 |
#else |
|
55 | 59 |
Rw2Image::Rw2Image(BasicIo::AutoPtr io) |
56 | 60 |
: Image(ImageType::rw2, mdExif | mdIptc | mdXmp, io) |
61 |
#endif |
|
57 | 62 |
{ |
58 | 63 |
} // Rw2Image::Rw2Image |
59 | 64 | |
... | ... | |
236 | 241 |
// free functions |
237 | 242 |
Image::AutoPtr newRw2Instance(BasicIo::AutoPtr io, bool /*create*/) |
238 | 243 |
{ |
244 |
#ifdef EXV_USING_CPP_ELEVEN |
|
245 |
Image::AutoPtr image(new Rw2Image(std::move(io))); |
|
246 |
#else |
|
239 | 247 |
Image::AutoPtr image(new Rw2Image(io)); |
248 |
#endif |
|
240 | 249 |
if (!image->good()) { |
241 | 250 |
image.reset(); |
242 | 251 |
} |
exiv2-0.26-svn-1/src/tgaimage.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
46 | 46 |
// class member definitions |
47 | 47 |
namespace Exiv2 { |
48 | 48 | |
49 |
#ifdef EXV_USING_CPP_ELEVEN |
|
50 |
TgaImage::TgaImage(BasicIo::AutoPtr io) |
|
51 |
: Image(ImageType::tga, mdNone, std::move(io)) |
|
52 |
#else |
|
49 | 53 |
TgaImage::TgaImage(BasicIo::AutoPtr io) |
50 | 54 |
: Image(ImageType::tga, mdNone, io) |
55 |
#endif |
|
51 | 56 |
{ |
52 | 57 |
} // TgaImage::TgaImage |
53 | 58 | |
... | ... | |
132 | 137 |
// free functions |
133 | 138 |
Image::AutoPtr newTgaInstance(BasicIo::AutoPtr io, bool /*create*/) |
134 | 139 |
{ |
140 |
#ifdef EXV_USING_CPP_ELEVEN |
|
141 |
Image::AutoPtr image(new TgaImage(std::move(io))); |
|
142 |
#else |
|
135 | 143 |
Image::AutoPtr image(new TgaImage(io)); |
144 |
#endif |
|
136 | 145 |
if (!image->good()) |
137 | 146 |
{ |
138 | 147 |
image.reset(); |
exiv2-0.26-svn-1/src/tiffcomposite.cpp 2017-01-13 12:42:37.000000000 -0500 | ||
---|---|---|
387 | 387 |
memset(pData_, 0x0, size_); |
388 | 388 |
size_ = value->copy(pData_, byteOrder); |
389 | 389 |
assert(size_ == newSize); |
390 |
#ifdef EXV_USING_CPP_ELEVEN |
|
391 |
setValue(std::move(value)); |
|
392 |
#else |
|
390 | 393 |
setValue(value); |
394 |
#endif |
|
391 | 395 |
} // TiffEntryBase::updateValue |
392 | 396 | |
393 | 397 |
void TiffEntryBase::setValue(Value::AutoPtr value) |
... | ... | |
626 | 630 |
tp->setData(const_cast<byte*>(pData() + idx), sz); |
627 | 631 |
tp->setElDef(def); |
628 | 632 |
tp->setElByteOrder(cfg()->byteOrder_); |
633 |
#ifdef EXV_USING_CPP_ELEVEN |
|
634 |
addChild(std::move(tc)); |
|
635 |
#else |
|
629 | 636 |
addChild(tc); |
637 |
#endif |
|
630 | 638 |
return sz; |
631 | 639 |
} // TiffBinaryArray::addElement |
632 | 640 | |
... | ... | |
635 | 643 |
TiffComponent* const pRoot, |
636 | 644 |
TiffComponent::AutoPtr object) |
637 | 645 |
{ |
646 |
#ifdef EXV_USING_CPP_ELEVEN |
|
647 |
return doAddPath(tag, tiffPath, pRoot, std::move(object)); |
|
648 |
#else |
|
638 | 649 |
return doAddPath(tag, tiffPath, pRoot, object); |
650 |
#endif |
|
639 | 651 |
} // TiffComponent::addPath |
640 | 652 | |
641 | 653 |
TiffComponent* TiffComponent::doAddPath(uint16_t /*tag*/, |
... | ... | |
677 | 689 |
if (tc == 0) { |
678 | 690 |
TiffComponent::AutoPtr atc; |
679 | 691 |
if (tiffPath.size() == 1 && object.get() != 0) { |
692 |
#ifdef EXV_USING_CPP_ELEVEN |
|
693 |
atc = std::move(object); |
|
694 |
#else |
|
680 | 695 |
atc = object; |
696 |
#endif |
|
681 | 697 |
} |
682 | 698 |
else { |
683 | 699 |
atc = TiffCreator::create(tpi.extendedTag(), tpi.group()); |
... | ... | |
689 | 705 |
if (tiffPath.size() == 1 && dynamic_cast<TiffSubIfd*>(atc.get()) != 0) return 0; |
690 | 706 | |
691 | 707 |
if (tpi.extendedTag() == Tag::next) { |
708 |
#ifdef EXV_USING_CPP_ELEVEN |
|
709 |
tc = this->addNext(std::move(atc)); |
|
710 |
#else |
|
692 | 711 |
tc = this->addNext(atc); |
712 |
#endif |
|
693 | 713 |
} |
694 | 714 |
else { |
715 |
#ifdef EXV_USING_CPP_ELEVEN |
|
716 |
tc = this->addChild(std::move(atc)); |
|
717 |
#else |
|
695 | 718 |
tc = this->addChild(atc); |
719 |
#endif |
|
696 | 720 |
} |
697 | 721 |
} |
722 |
#ifdef EXV_USING_CPP_ELEVEN |
|
723 |
return tc->addPath(tag, tiffPath, pRoot, std::move(object)); |
|
724 |
#else |
|
698 | 725 |
return tc->addPath(tag, tiffPath, pRoot, object); |
726 |
#endif |
|
699 | 727 |
} // TiffDirectory::doAddPath |
700 | 728 | |
701 | 729 |
TiffComponent* TiffSubIfd::doAddPath(uint16_t tag, |
... | ... | |
722 | 750 |
} |
723 | 751 |
if (tc == 0) { |
724 | 752 |
if (tiffPath.size() == 1 && object.get() != 0) { |
753 |
#ifdef EXV_USING_CPP_ELEVEN |
|
754 |
tc = addChild(std::move(object)); |
|
755 |
#else |
|
725 | 756 |
tc = addChild(object); |
757 |
#endif |
|
726 | 758 |
} |
727 | 759 |
else { |
728 | 760 |
TiffComponent::AutoPtr atc(new TiffDirectory(tpi1.tag(), tpi2.group())); |
761 |
#ifdef EXV_USING_CPP_ELEVEN |
|
762 |
tc = addChild(std::move(atc)); |
|
763 |
#else |
|
729 | 764 |
tc = addChild(atc); |
765 |
#endif |
|
730 | 766 |
} |
731 | 767 |
setCount(static_cast<uint32_t>(ifds_.size())); |
732 | 768 |
} |
769 |
#ifdef EXV_USING_CPP_ELEVEN |
|
770 |
return tc->addPath(tag, tiffPath, pRoot, std::move(object)); |
|
771 |
#else |
|
733 | 772 |
return tc->addPath(tag, tiffPath, pRoot, object); |
773 |
#endif |
|
734 | 774 |
} // TiffSubIfd::doAddPath |
735 | 775 | |
736 | 776 |
TiffComponent* TiffMnEntry::doAddPath(uint16_t tag, |
... | ... | |
752 | 792 |
mn_ = TiffMnCreator::create(tpi1.tag(), tpi1.group(), mnGroup_); |
753 | 793 |
assert(mn_); |