Commit 407b0766b882de046b224bef717200ec6a6be8a1

Authored by m-holger
1 parent a9c0b026

Inline QPDFObjectHandle::getObjGen etc

Also, make QPDFObjectHandle::isIndirect const.
include/qpdf/QPDFObjectHandle.hh
@@ -319,7 +319,7 @@ class QPDFObjectHandle @@ -319,7 +319,7 @@ class QPDFObjectHandle
319 QPDF_DLL 319 QPDF_DLL
320 QPDFObjectHandle& operator=(QPDFObjectHandle const&) = default; 320 QPDFObjectHandle& operator=(QPDFObjectHandle const&) = default;
321 QPDF_DLL 321 QPDF_DLL
322 - bool isInitialized() const; 322 + inline bool isInitialized() const;
323 323
324 // Return type code and type name of underlying object. These are 324 // Return type code and type name of underlying object. These are
325 // useful for doing rapid type tests (like switch statements) or 325 // useful for doing rapid type tests (like switch statements) or
@@ -367,7 +367,7 @@ class QPDFObjectHandle @@ -367,7 +367,7 @@ class QPDFObjectHandle
367 // This returns true in addition to the query for the specific 367 // This returns true in addition to the query for the specific
368 // type for indirect objects. 368 // type for indirect objects.
369 QPDF_DLL 369 QPDF_DLL
370 - bool isIndirect(); 370 + inline bool isIndirect() const;
371 371
372 // True for everything except array, dictionary, stream, word, and 372 // True for everything except array, dictionary, stream, word, and
373 // inline image. 373 // inline image.
@@ -1300,11 +1300,11 @@ class QPDFObjectHandle @@ -1300,11 +1300,11 @@ class QPDFObjectHandle
1300 // QPDFObjGen instead. 1300 // QPDFObjGen instead.
1301 1301
1302 QPDF_DLL 1302 QPDF_DLL
1303 - QPDFObjGen getObjGen() const; 1303 + inline QPDFObjGen getObjGen() const;
1304 QPDF_DLL 1304 QPDF_DLL
1305 - int getObjectID() const; 1305 + inline int getObjectID() const;
1306 QPDF_DLL 1306 QPDF_DLL
1307 - int getGeneration() const; 1307 + inline int getGeneration() const;
1308 1308
1309 QPDF_DLL 1309 QPDF_DLL
1310 std::string unparse(); 1310 std::string unparse();
@@ -1846,4 +1846,34 @@ class QPDFObjectHandle::QPDFArrayItems @@ -1846,4 +1846,34 @@ class QPDFObjectHandle::QPDFArrayItems
1846 QPDFObjectHandle oh; 1846 QPDFObjectHandle oh;
1847 }; 1847 };
1848 1848
  1849 +inline QPDFObjGen
  1850 +QPDFObjectHandle::getObjGen() const
  1851 +{
  1852 + return og;
  1853 +}
  1854 +
  1855 +inline int
  1856 +QPDFObjectHandle::getObjectID() const
  1857 +{
  1858 + return og.getObj();
  1859 +}
  1860 +
  1861 +inline int
  1862 +QPDFObjectHandle::getGeneration() const
  1863 +{
  1864 + return og.getGen();
  1865 +}
  1866 +
  1867 +inline bool
  1868 +QPDFObjectHandle::isIndirect() const
  1869 +{
  1870 + return initialized && (getObjectID() != 0);
  1871 +}
  1872 +
  1873 +inline bool
  1874 +QPDFObjectHandle::isInitialized() const
  1875 +{
  1876 + return initialized;
  1877 +}
  1878 +
1849 #endif // QPDFOBJECTHANDLE_HH 1879 #endif // QPDFOBJECTHANDLE_HH
libqpdf/QPDFObjectHandle.cc
@@ -286,12 +286,6 @@ QPDFObjectHandle::setObjectDescriptionFromInput( @@ -286,12 +286,6 @@ QPDFObjectHandle::setObjectDescriptionFromInput(
286 QUtil::int_to_string(offset))); 286 QUtil::int_to_string(offset)));
287 } 287 }
288 288
289 -bool  
290 -QPDFObjectHandle::isInitialized() const  
291 -{  
292 - return this->initialized;  
293 -}  
294 -  
295 QPDFObject::object_type_e 289 QPDFObject::object_type_e
296 QPDFObjectHandle::getTypeCode() 290 QPDFObjectHandle::getTypeCode()
297 { 291 {
@@ -435,12 +429,6 @@ QPDFObjectHandle::isReserved() @@ -435,12 +429,6 @@ QPDFObjectHandle::isReserved()
435 } 429 }
436 430
437 bool 431 bool
438 -QPDFObjectHandle::isIndirect()  
439 -{  
440 - return this->initialized && (getObjectID() != 0);  
441 -}  
442 -  
443 -bool  
444 QPDFObjectHandle::isScalar() 432 QPDFObjectHandle::isScalar()
445 { 433 {
446 return ( 434 return (
@@ -1499,24 +1487,6 @@ QPDFObjectHandle::replaceStreamData( @@ -1499,24 +1487,6 @@ QPDFObjectHandle::replaceStreamData(
1499 sdp, filter, decode_parms); 1487 sdp, filter, decode_parms);
1500 } 1488 }
1501 1489
1502 -QPDFObjGen  
1503 -QPDFObjectHandle::getObjGen() const  
1504 -{  
1505 - return og;  
1506 -}  
1507 -  
1508 -int  
1509 -QPDFObjectHandle::getObjectID() const  
1510 -{  
1511 - return og.getObj();  
1512 -}  
1513 -  
1514 -int  
1515 -QPDFObjectHandle::getGeneration() const  
1516 -{  
1517 - return og.getGen();  
1518 -}  
1519 -  
1520 std::map<std::string, QPDFObjectHandle> 1490 std::map<std::string, QPDFObjectHandle>
1521 QPDFObjectHandle::getPageImages() 1491 QPDFObjectHandle::getPageImages()
1522 { 1492 {