@@ -10,13 +10,13 @@ namespace odr::internal::pdf {
1010
1111FileParser::FileParser (std::istream &in) : m_parser(in) {}
1212
13- std::istream &FileParser::in () const { return m_parser.in (); }
13+ std::istream &FileParser::in () { return m_parser.in (); }
1414
15- std::streambuf &FileParser::sb () const { return m_parser.sb (); }
15+ std::streambuf &FileParser::sb () { return m_parser.sb (); }
1616
17- const ObjectParser &FileParser::parser () const { return m_parser; }
17+ ObjectParser &FileParser::parser () { return m_parser; }
1818
19- IndirectObject FileParser::read_indirect_object () const {
19+ IndirectObject FileParser::read_indirect_object () {
2020 IndirectObject result;
2121
2222 result.reference .id = m_parser.read_unsigned_integer ();
@@ -47,7 +47,7 @@ IndirectObject FileParser::read_indirect_object() const {
4747 throw std::runtime_error (" expected stream" );
4848}
4949
50- Trailer FileParser::read_trailer () const {
50+ Trailer FileParser::read_trailer () {
5151 m_parser.expect_characters (" trailer" );
5252 m_parser.skip_whitespace ();
5353
@@ -62,7 +62,7 @@ Trailer FileParser::read_trailer() const {
6262 return result;
6363}
6464
65- Xref FileParser::read_xref () const {
65+ Xref FileParser::read_xref () {
6666 if (const std::string line = m_parser.read_line (); line != " xref" ) {
6767 throw std::runtime_error (" expected xref" );
6868 }
@@ -94,7 +94,7 @@ Xref FileParser::read_xref() const {
9494 }
9595}
9696
97- StartXref FileParser::read_start_xref () const {
97+ StartXref FileParser::read_start_xref () {
9898 if (const std::string line = m_parser.read_line (); line != " startxref" ) {
9999 throw std::runtime_error (" expected startxref" );
100100 }
@@ -108,7 +108,7 @@ StartXref FileParser::read_start_xref() const {
108108 return result;
109109}
110110
111- std::string FileParser::read_stream (const std::int32_t size) const {
111+ std::string FileParser::read_stream (const std::int32_t size) {
112112 std::string result;
113113
114114 if (size >= 0 ) {
@@ -140,7 +140,7 @@ std::string FileParser::read_stream(const std::int32_t size) const {
140140 return result;
141141}
142142
143- void FileParser::read_header () const {
143+ void FileParser::read_header () {
144144 const std::string header1 = m_parser.read_line ();
145145 const std::string header2 = m_parser.read_line ();
146146
@@ -151,7 +151,7 @@ void FileParser::read_header() const {
151151 m_parser.skip_whitespace ();
152152}
153153
154- Entry FileParser::read_entry () const {
154+ Entry FileParser::read_entry () {
155155 std::uint32_t position = in ().tellg ();
156156 const std::string entry_header = m_parser.read_line ();
157157 in ().seekg (position);
@@ -179,7 +179,7 @@ Entry FileParser::read_entry() const {
179179 throw std::runtime_error (" unknown entry" );
180180}
181181
182- void FileParser::seek_start_xref (const std::uint32_t margin) const {
182+ void FileParser::seek_start_xref (const std::uint32_t margin) {
183183 in ().seekg (0 , std::ios::end);
184184 const std::int64_t size = in ().tellg ();
185185 in ().seekg (std::max (static_cast <std::int64_t >(0 ), size - margin),
0 commit comments