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 319 QPDF_DLL
320 320 QPDFObjectHandle& operator=(QPDFObjectHandle const&) = default;
321 321 QPDF_DLL
322   - bool isInitialized() const;
  322 + inline bool isInitialized() const;
323 323  
324 324 // Return type code and type name of underlying object. These are
325 325 // useful for doing rapid type tests (like switch statements) or
... ... @@ -367,7 +367,7 @@ class QPDFObjectHandle
367 367 // This returns true in addition to the query for the specific
368 368 // type for indirect objects.
369 369 QPDF_DLL
370   - bool isIndirect();
  370 + inline bool isIndirect() const;
371 371  
372 372 // True for everything except array, dictionary, stream, word, and
373 373 // inline image.
... ... @@ -1300,11 +1300,11 @@ class QPDFObjectHandle
1300 1300 // QPDFObjGen instead.
1301 1301  
1302 1302 QPDF_DLL
1303   - QPDFObjGen getObjGen() const;
  1303 + inline QPDFObjGen getObjGen() const;
1304 1304 QPDF_DLL
1305   - int getObjectID() const;
  1305 + inline int getObjectID() const;
1306 1306 QPDF_DLL
1307   - int getGeneration() const;
  1307 + inline int getGeneration() const;
1308 1308  
1309 1309 QPDF_DLL
1310 1310 std::string unparse();
... ... @@ -1846,4 +1846,34 @@ class QPDFObjectHandle::QPDFArrayItems
1846 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 1879 #endif // QPDFOBJECTHANDLE_HH
... ...
libqpdf/QPDFObjectHandle.cc
... ... @@ -286,12 +286,6 @@ QPDFObjectHandle::setObjectDescriptionFromInput(
286 286 QUtil::int_to_string(offset)));
287 287 }
288 288  
289   -bool
290   -QPDFObjectHandle::isInitialized() const
291   -{
292   - return this->initialized;
293   -}
294   -
295 289 QPDFObject::object_type_e
296 290 QPDFObjectHandle::getTypeCode()
297 291 {
... ... @@ -435,12 +429,6 @@ QPDFObjectHandle::isReserved()
435 429 }
436 430  
437 431 bool
438   -QPDFObjectHandle::isIndirect()
439   -{
440   - return this->initialized && (getObjectID() != 0);
441   -}
442   -
443   -bool
444 432 QPDFObjectHandle::isScalar()
445 433 {
446 434 return (
... ... @@ -1499,24 +1487,6 @@ QPDFObjectHandle::replaceStreamData(
1499 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 1490 std::map<std::string, QPDFObjectHandle>
1521 1491 QPDFObjectHandle::getPageImages()
1522 1492 {
... ...