Commit 2e6869483bba657515aad305a3aa7013e477c448
Committed by
Jay Berkenbilt
1 parent
da67a0aa
Replace calls to QUtil::int_to_string with std::to_string
Showing
40 changed files
with
215 additions
and
247 deletions
examples/pdf-bookmarks.cc
| @@ -110,7 +110,7 @@ show_bookmark_details(QPDFOutlineObjectHelper outline, std::vector<int> numbers) | @@ -110,7 +110,7 @@ show_bookmark_details(QPDFOutlineObjectHelper outline, std::vector<int> numbers) | ||
| 110 | QTC::TC("examples", "pdf-bookmarks dest"); | 110 | QTC::TC("examples", "pdf-bookmarks dest"); |
| 111 | QPDFObjGen og = dest_page.getObjGen(); | 111 | QPDFObjGen og = dest_page.getObjGen(); |
| 112 | if (page_map.count(og)) { | 112 | if (page_map.count(og)) { |
| 113 | - target = QUtil::int_to_string(page_map[og]); | 113 | + target = std::to_string(page_map[og]); |
| 114 | } | 114 | } |
| 115 | } | 115 | } |
| 116 | std::cout << "[ -> " << target << " ] "; | 116 | std::cout << "[ -> " << target << " ] "; |
examples/pdf-count-strings.cc
| @@ -59,7 +59,7 @@ StringCounter::handleEOF() | @@ -59,7 +59,7 @@ StringCounter::handleEOF() | ||
| 59 | // Write a comment at the end of the stream just to show how we | 59 | // Write a comment at the end of the stream just to show how we |
| 60 | // can enhance the output if we want. | 60 | // can enhance the output if we want. |
| 61 | write("\n% strings found: "); | 61 | write("\n% strings found: "); |
| 62 | - write(QUtil::int_to_string(this->count)); | 62 | + write(std::to_string(this->count)); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | int | 65 | int |
examples/pdf-name-number-tree.cc
| @@ -144,8 +144,7 @@ main(int argc, char* argv[]) | @@ -144,8 +144,7 @@ main(int argc, char* argv[]) | ||
| 144 | auto iter2 = number_tree.begin(); | 144 | auto iter2 = number_tree.begin(); |
| 145 | for (int i = 7; i <= 350; i += 7) { | 145 | for (int i = 7; i <= 350; i += 7) { |
| 146 | iter2.insertAfter( | 146 | iter2.insertAfter( |
| 147 | - i, | ||
| 148 | - QPDFObjectHandle::newString("-" + QUtil::int_to_string(i) + "-")); | 147 | + i, QPDFObjectHandle::newString("-" + std::to_string(i) + "-")); |
| 149 | } | 148 | } |
| 150 | std::cout << "Numbers:" << std::endl; | 149 | std::cout << "Numbers:" << std::endl; |
| 151 | int n = 1; | 150 | int n = 1; |
examples/pdf-split-pages.cc
| @@ -24,8 +24,7 @@ process(char const* whoami, char const* infile, std::string outprefix) | @@ -24,8 +24,7 @@ process(char const* whoami, char const* infile, std::string outprefix) | ||
| 24 | inpdf.processFile(infile); | 24 | inpdf.processFile(infile); |
| 25 | std::vector<QPDFPageObjectHelper> pages = | 25 | std::vector<QPDFPageObjectHelper> pages = |
| 26 | QPDFPageDocumentHelper(inpdf).getAllPages(); | 26 | QPDFPageDocumentHelper(inpdf).getAllPages(); |
| 27 | - int pageno_len = | ||
| 28 | - QIntC::to_int(QUtil::uint_to_string(pages.size()).length()); | 27 | + int pageno_len = QIntC::to_int(std::to_string(pages.size()).length()); |
| 29 | int pageno = 0; | 28 | int pageno = 0; |
| 30 | for (auto& page: pages) { | 29 | for (auto& page: pages) { |
| 31 | std::string outfile = | 30 | std::string outfile = |
include/qpdf/Pipeline.hh
| @@ -86,7 +86,6 @@ class QPDF_DLL_CLASS Pipeline | @@ -86,7 +86,6 @@ class QPDF_DLL_CLASS Pipeline | ||
| 86 | Pipeline& operator<<(char const* cstr); | 86 | Pipeline& operator<<(char const* cstr); |
| 87 | QPDF_DLL | 87 | QPDF_DLL |
| 88 | Pipeline& operator<<(std::string const&); | 88 | Pipeline& operator<<(std::string const&); |
| 89 | - // Calls QUtil::int_to_string | ||
| 90 | QPDF_DLL | 89 | QPDF_DLL |
| 91 | Pipeline& operator<<(short); | 90 | Pipeline& operator<<(short); |
| 92 | QPDF_DLL | 91 | QPDF_DLL |
| @@ -95,7 +94,6 @@ class QPDF_DLL_CLASS Pipeline | @@ -95,7 +94,6 @@ class QPDF_DLL_CLASS Pipeline | ||
| 95 | Pipeline& operator<<(long); | 94 | Pipeline& operator<<(long); |
| 96 | QPDF_DLL | 95 | QPDF_DLL |
| 97 | Pipeline& operator<<(long long); | 96 | Pipeline& operator<<(long long); |
| 98 | - // Calls QUtil::uint_to_string | ||
| 99 | QPDF_DLL | 97 | QPDF_DLL |
| 100 | Pipeline& operator<<(unsigned short); | 98 | Pipeline& operator<<(unsigned short); |
| 101 | QPDF_DLL | 99 | QPDF_DLL |
libqpdf/FileInputSource.cc
| @@ -105,8 +105,7 @@ FileInputSource::seek(qpdf_offset_t offset, int whence) | @@ -105,8 +105,7 @@ FileInputSource::seek(qpdf_offset_t offset, int whence) | ||
| 105 | if (QUtil::seek(this->file, offset, whence) == -1) { | 105 | if (QUtil::seek(this->file, offset, whence) == -1) { |
| 106 | QUtil::throw_system_error( | 106 | QUtil::throw_system_error( |
| 107 | std::string("seek to ") + this->filename + ", offset " + | 107 | std::string("seek to ") + this->filename + ", offset " + |
| 108 | - QUtil::int_to_string(offset) + " (" + QUtil::int_to_string(whence) + | ||
| 109 | - ")"); | 108 | + std::to_string(offset) + " (" + std::to_string(whence) + ")"); |
| 110 | } | 109 | } |
| 111 | } | 110 | } |
| 112 | 111 | ||
| @@ -128,8 +127,7 @@ FileInputSource::read(char* buffer, size_t length) | @@ -128,8 +127,7 @@ FileInputSource::read(char* buffer, size_t length) | ||
| 128 | this->filename, | 127 | this->filename, |
| 129 | "", | 128 | "", |
| 130 | this->last_offset, | 129 | this->last_offset, |
| 131 | - (std::string("read ") + QUtil::uint_to_string(length) + | ||
| 132 | - " bytes")); | 130 | + (std::string("read ") + std::to_string(length) + " bytes")); |
| 133 | } else if (length > 0) { | 131 | } else if (length > 0) { |
| 134 | this->seek(0, SEEK_END); | 132 | this->seek(0, SEEK_END); |
| 135 | this->last_offset = this->tell(); | 133 | this->last_offset = this->tell(); |
libqpdf/JSON.cc
| @@ -148,7 +148,7 @@ JSON::JSON_string::write(Pipeline* p, size_t) const | @@ -148,7 +148,7 @@ JSON::JSON_string::write(Pipeline* p, size_t) const | ||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | JSON::JSON_number::JSON_number(long long value) : | 150 | JSON::JSON_number::JSON_number(long long value) : |
| 151 | - encoded(QUtil::int_to_string(value)) | 151 | + encoded(std::to_string(value)) |
| 152 | { | 152 | { |
| 153 | } | 153 | } |
| 154 | 154 | ||
| @@ -554,7 +554,7 @@ JSON::checkSchemaInternal( | @@ -554,7 +554,7 @@ JSON::checkSchemaInternal( | ||
| 554 | sch_arr->elements.at(0).get(), | 554 | sch_arr->elements.at(0).get(), |
| 555 | flags, | 555 | flags, |
| 556 | errors, | 556 | errors, |
| 557 | - prefix + "." + QUtil::int_to_string(i)); | 557 | + prefix + "." + std::to_string(i)); |
| 558 | ++i; | 558 | ++i; |
| 559 | } | 559 | } |
| 560 | } else { | 560 | } else { |
| @@ -570,7 +570,7 @@ JSON::checkSchemaInternal( | @@ -570,7 +570,7 @@ JSON::checkSchemaInternal( | ||
| 570 | QTC::TC("libtests", "JSON schema array length mismatch"); | 570 | QTC::TC("libtests", "JSON schema array length mismatch"); |
| 571 | errors.push_back( | 571 | errors.push_back( |
| 572 | err_prefix + " is supposed to be an array of length " + | 572 | err_prefix + " is supposed to be an array of length " + |
| 573 | - QUtil::uint_to_string(n_elements)); | 573 | + std::to_string(n_elements)); |
| 574 | return false; | 574 | return false; |
| 575 | } else { | 575 | } else { |
| 576 | // A multi-element array in the schema must correspond to | 576 | // A multi-element array in the schema must correspond to |
| @@ -584,7 +584,7 @@ JSON::checkSchemaInternal( | @@ -584,7 +584,7 @@ JSON::checkSchemaInternal( | ||
| 584 | sch_arr->elements.at(i).get(), | 584 | sch_arr->elements.at(i).get(), |
| 585 | flags, | 585 | flags, |
| 586 | errors, | 586 | errors, |
| 587 | - prefix + "." + QUtil::uint_to_string(i)); | 587 | + prefix + "." + std::to_string(i)); |
| 588 | ++i; | 588 | ++i; |
| 589 | } | 589 | } |
| 590 | } | 590 | } |
| @@ -703,10 +703,10 @@ JSONParser::handle_u_code( | @@ -703,10 +703,10 @@ JSONParser::handle_u_code( | ||
| 703 | if (high_offset) { | 703 | if (high_offset) { |
| 704 | QTC::TC("libtests", "JSON 16 high high"); | 704 | QTC::TC("libtests", "JSON 16 high high"); |
| 705 | throw std::runtime_error( | 705 | throw std::runtime_error( |
| 706 | - "JSON: offset " + QUtil::int_to_string(new_high_offset) + | 706 | + "JSON: offset " + std::to_string(new_high_offset) + |
| 707 | ": UTF-16 high surrogate found after previous high surrogate" | 707 | ": UTF-16 high surrogate found after previous high surrogate" |
| 708 | " at offset " + | 708 | " at offset " + |
| 709 | - QUtil::int_to_string(high_offset)); | 709 | + std::to_string(high_offset)); |
| 710 | } | 710 | } |
| 711 | high_offset = new_high_offset; | 711 | high_offset = new_high_offset; |
| 712 | high_surrogate = codepoint; | 712 | high_surrogate = codepoint; |
| @@ -715,7 +715,7 @@ JSONParser::handle_u_code( | @@ -715,7 +715,7 @@ JSONParser::handle_u_code( | ||
| 715 | if (offset + i != (high_offset + 6)) { | 715 | if (offset + i != (high_offset + 6)) { |
| 716 | QTC::TC("libtests", "JSON 16 low not after high"); | 716 | QTC::TC("libtests", "JSON 16 low not after high"); |
| 717 | throw std::runtime_error( | 717 | throw std::runtime_error( |
| 718 | - "JSON: offset " + QUtil::int_to_string(offset + i) + | 718 | + "JSON: offset " + std::to_string(offset + i) + |
| 719 | ": UTF-16 low surrogate found not immediately after high" | 719 | ": UTF-16 low surrogate found not immediately after high" |
| 720 | " surrogate"); | 720 | " surrogate"); |
| 721 | } | 721 | } |
| @@ -797,7 +797,7 @@ JSONParser::decode_string(std::string const& str, qpdf_offset_t offset) | @@ -797,7 +797,7 @@ JSONParser::decode_string(std::string const& str, qpdf_offset_t offset) | ||
| 797 | if (high_offset) { | 797 | if (high_offset) { |
| 798 | QTC::TC("libtests", "JSON 16 dangling high"); | 798 | QTC::TC("libtests", "JSON 16 dangling high"); |
| 799 | throw std::runtime_error( | 799 | throw std::runtime_error( |
| 800 | - "JSON: offset " + QUtil::int_to_string(high_offset) + | 800 | + "JSON: offset " + std::to_string(high_offset) + |
| 801 | ": UTF-16 high surrogate not followed by low surrogate"); | 801 | ": UTF-16 high surrogate not followed by low surrogate"); |
| 802 | } | 802 | } |
| 803 | return result; | 803 | return result; |
| @@ -822,8 +822,7 @@ JSONParser::getToken() | @@ -822,8 +822,7 @@ JSONParser::getToken() | ||
| 822 | if (*p == 0) { | 822 | if (*p == 0) { |
| 823 | QTC::TC("libtests", "JSON parse null character"); | 823 | QTC::TC("libtests", "JSON parse null character"); |
| 824 | throw std::runtime_error( | 824 | throw std::runtime_error( |
| 825 | - "JSON: null character at offset " + | ||
| 826 | - QUtil::int_to_string(offset)); | 825 | + "JSON: null character at offset " + std::to_string(offset)); |
| 827 | } | 826 | } |
| 828 | action = append; | 827 | action = append; |
| 829 | switch (lex_state) { | 828 | switch (lex_state) { |
| @@ -860,7 +859,7 @@ JSONParser::getToken() | @@ -860,7 +859,7 @@ JSONParser::getToken() | ||
| 860 | } else { | 859 | } else { |
| 861 | QTC::TC("libtests", "JSON parse bad character"); | 860 | QTC::TC("libtests", "JSON parse bad character"); |
| 862 | throw std::runtime_error( | 861 | throw std::runtime_error( |
| 863 | - "JSON: offset " + QUtil::int_to_string(offset) + | 862 | + "JSON: offset " + std::to_string(offset) + |
| 864 | ": unexpected character " + std::string(p, 1)); | 863 | ": unexpected character " + std::string(p, 1)); |
| 865 | } | 864 | } |
| 866 | break; | 865 | break; |
| @@ -878,12 +877,12 @@ JSONParser::getToken() | @@ -878,12 +877,12 @@ JSONParser::getToken() | ||
| 878 | if (number_saw_e) { | 877 | if (number_saw_e) { |
| 879 | QTC::TC("libtests", "JSON parse point after e"); | 878 | QTC::TC("libtests", "JSON parse point after e"); |
| 880 | throw std::runtime_error( | 879 | throw std::runtime_error( |
| 881 | - "JSON: offset " + QUtil::int_to_string(offset) + | 880 | + "JSON: offset " + std::to_string(offset) + |
| 882 | ": numeric literal: decimal point after e"); | 881 | ": numeric literal: decimal point after e"); |
| 883 | } else if (number_saw_point) { | 882 | } else if (number_saw_point) { |
| 884 | QTC::TC("libtests", "JSON parse duplicate point"); | 883 | QTC::TC("libtests", "JSON parse duplicate point"); |
| 885 | throw std::runtime_error( | 884 | throw std::runtime_error( |
| 886 | - "JSON: offset " + QUtil::int_to_string(offset) + | 885 | + "JSON: offset " + std::to_string(offset) + |
| 887 | ": numeric literal: decimal point already seen"); | 886 | ": numeric literal: decimal point already seen"); |
| 888 | } else { | 887 | } else { |
| 889 | number_saw_point = true; | 888 | number_saw_point = true; |
| @@ -892,7 +891,7 @@ JSONParser::getToken() | @@ -892,7 +891,7 @@ JSONParser::getToken() | ||
| 892 | if (number_saw_e) { | 891 | if (number_saw_e) { |
| 893 | QTC::TC("libtests", "JSON parse duplicate e"); | 892 | QTC::TC("libtests", "JSON parse duplicate e"); |
| 894 | throw std::runtime_error( | 893 | throw std::runtime_error( |
| 895 | - "JSON: offset " + QUtil::int_to_string(offset) + | 894 | + "JSON: offset " + std::to_string(offset) + |
| 896 | ": numeric literal: e already seen"); | 895 | ": numeric literal: e already seen"); |
| 897 | } else { | 896 | } else { |
| 898 | number_saw_e = true; | 897 | number_saw_e = true; |
| @@ -903,7 +902,7 @@ JSONParser::getToken() | @@ -903,7 +902,7 @@ JSONParser::getToken() | ||
| 903 | } else { | 902 | } else { |
| 904 | QTC::TC("libtests", "JSON parse unexpected sign"); | 903 | QTC::TC("libtests", "JSON parse unexpected sign"); |
| 905 | throw std::runtime_error( | 904 | throw std::runtime_error( |
| 906 | - "JSON: offset " + QUtil::int_to_string(offset) + | 905 | + "JSON: offset " + std::to_string(offset) + |
| 907 | ": numeric literal: unexpected sign"); | 906 | ": numeric literal: unexpected sign"); |
| 908 | } | 907 | } |
| 909 | } else if (QUtil::is_space(*p)) { | 908 | } else if (QUtil::is_space(*p)) { |
| @@ -915,7 +914,7 @@ JSONParser::getToken() | @@ -915,7 +914,7 @@ JSONParser::getToken() | ||
| 915 | } else { | 914 | } else { |
| 916 | QTC::TC("libtests", "JSON parse numeric bad character"); | 915 | QTC::TC("libtests", "JSON parse numeric bad character"); |
| 917 | throw std::runtime_error( | 916 | throw std::runtime_error( |
| 918 | - "JSON: offset " + QUtil::int_to_string(offset) + | 917 | + "JSON: offset " + std::to_string(offset) + |
| 919 | ": numeric literal: unexpected character " + | 918 | ": numeric literal: unexpected character " + |
| 920 | std::string(p, 1)); | 919 | std::string(p, 1)); |
| 921 | } | 920 | } |
| @@ -933,7 +932,7 @@ JSONParser::getToken() | @@ -933,7 +932,7 @@ JSONParser::getToken() | ||
| 933 | } else { | 932 | } else { |
| 934 | QTC::TC("libtests", "JSON parse keyword bad character"); | 933 | QTC::TC("libtests", "JSON parse keyword bad character"); |
| 935 | throw std::runtime_error( | 934 | throw std::runtime_error( |
| 936 | - "JSON: offset " + QUtil::int_to_string(offset) + | 935 | + "JSON: offset " + std::to_string(offset) + |
| 937 | ": keyword: unexpected character " + std::string(p, 1)); | 936 | ": keyword: unexpected character " + std::string(p, 1)); |
| 938 | } | 937 | } |
| 939 | break; | 938 | break; |
| @@ -956,7 +955,7 @@ JSONParser::getToken() | @@ -956,7 +955,7 @@ JSONParser::getToken() | ||
| 956 | } else { | 955 | } else { |
| 957 | QTC::TC("libtests", "JSON parse backslash bad character"); | 956 | QTC::TC("libtests", "JSON parse backslash bad character"); |
| 958 | throw std::runtime_error( | 957 | throw std::runtime_error( |
| 959 | - "JSON: offset " + QUtil::int_to_string(offset) + | 958 | + "JSON: offset " + std::to_string(offset) + |
| 960 | ": invalid character after backslash: " + | 959 | ": invalid character after backslash: " + |
| 961 | std::string(p, 1)); | 960 | std::string(p, 1)); |
| 962 | } | 961 | } |
| @@ -966,8 +965,7 @@ JSONParser::getToken() | @@ -966,8 +965,7 @@ JSONParser::getToken() | ||
| 966 | if (!QUtil::is_hex_digit(*p)) { | 965 | if (!QUtil::is_hex_digit(*p)) { |
| 967 | QTC::TC("libtests", "JSON parse bad hex after u"); | 966 | QTC::TC("libtests", "JSON parse bad hex after u"); |
| 968 | throw std::runtime_error( | 967 | throw std::runtime_error( |
| 969 | - "JSON: offset " + | ||
| 970 | - QUtil::int_to_string(offset - u_count - 1) + | 968 | + "JSON: offset " + std::to_string(offset - u_count - 1) + |
| 971 | ": \\u must be followed by four hex digits"); | 969 | ": \\u must be followed by four hex digits"); |
| 972 | } | 970 | } |
| 973 | if (++u_count == 4) { | 971 | if (++u_count == 4) { |
| @@ -1006,15 +1004,14 @@ JSONParser::getToken() | @@ -1006,15 +1004,14 @@ JSONParser::getToken() | ||
| 1006 | case ls_u4: | 1004 | case ls_u4: |
| 1007 | QTC::TC("libtests", "JSON parse premature end of u"); | 1005 | QTC::TC("libtests", "JSON parse premature end of u"); |
| 1008 | throw std::runtime_error( | 1006 | throw std::runtime_error( |
| 1009 | - "JSON: offset " + | ||
| 1010 | - QUtil::int_to_string(offset - u_count - 1) + | 1007 | + "JSON: offset " + std::to_string(offset - u_count - 1) + |
| 1011 | ": \\u must be followed by four characters"); | 1008 | ": \\u must be followed by four characters"); |
| 1012 | 1009 | ||
| 1013 | case ls_string: | 1010 | case ls_string: |
| 1014 | case ls_backslash: | 1011 | case ls_backslash: |
| 1015 | QTC::TC("libtests", "JSON parse unterminated string"); | 1012 | QTC::TC("libtests", "JSON parse unterminated string"); |
| 1016 | throw std::runtime_error( | 1013 | throw std::runtime_error( |
| 1017 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1014 | + "JSON: offset " + std::to_string(offset) + |
| 1018 | ": unterminated string"); | 1015 | ": unterminated string"); |
| 1019 | break; | 1016 | break; |
| 1020 | } | 1017 | } |
| @@ -1032,7 +1029,7 @@ JSONParser::handleToken() | @@ -1032,7 +1029,7 @@ JSONParser::handleToken() | ||
| 1032 | if (parser_state == ps_done) { | 1029 | if (parser_state == ps_done) { |
| 1033 | QTC::TC("libtests", "JSON parse junk after object"); | 1030 | QTC::TC("libtests", "JSON parse junk after object"); |
| 1034 | throw std::runtime_error( | 1031 | throw std::runtime_error( |
| 1035 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1032 | + "JSON: offset " + std::to_string(offset) + |
| 1036 | ": material follows end of object: " + token); | 1033 | ": material follows end of object: " + token); |
| 1037 | } | 1034 | } |
| 1038 | 1035 | ||
| @@ -1076,7 +1073,7 @@ JSONParser::handleToken() | @@ -1076,7 +1073,7 @@ JSONParser::handleToken() | ||
| 1076 | if (number_saw_point && (number_after_point == 0)) { | 1073 | if (number_saw_point && (number_after_point == 0)) { |
| 1077 | QTC::TC("libtests", "JSON parse decimal with no digits"); | 1074 | QTC::TC("libtests", "JSON parse decimal with no digits"); |
| 1078 | throw std::runtime_error( | 1075 | throw std::runtime_error( |
| 1079 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1076 | + "JSON: offset " + std::to_string(offset) + |
| 1080 | ": decimal point with no digits"); | 1077 | ": decimal point with no digits"); |
| 1081 | } | 1078 | } |
| 1082 | if ((number_before_point > 1) && | 1079 | if ((number_before_point > 1) && |
| @@ -1084,13 +1081,13 @@ JSONParser::handleToken() | @@ -1084,13 +1081,13 @@ JSONParser::handleToken() | ||
| 1084 | ((first_char == '-') && (token.at(1) == '0')))) { | 1081 | ((first_char == '-') && (token.at(1) == '0')))) { |
| 1085 | QTC::TC("libtests", "JSON parse leading zero"); | 1082 | QTC::TC("libtests", "JSON parse leading zero"); |
| 1086 | throw std::runtime_error( | 1083 | throw std::runtime_error( |
| 1087 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1084 | + "JSON: offset " + std::to_string(offset) + |
| 1088 | ": number with leading zero"); | 1085 | ": number with leading zero"); |
| 1089 | } | 1086 | } |
| 1090 | if ((number_before_point == 0) && (number_after_point == 0)) { | 1087 | if ((number_before_point == 0) && (number_after_point == 0)) { |
| 1091 | QTC::TC("libtests", "JSON parse number no digits"); | 1088 | QTC::TC("libtests", "JSON parse number no digits"); |
| 1092 | throw std::runtime_error( | 1089 | throw std::runtime_error( |
| 1093 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1090 | + "JSON: offset " + std::to_string(offset) + |
| 1094 | ": number with no digits"); | 1091 | ": number with no digits"); |
| 1095 | } | 1092 | } |
| 1096 | item = std::make_shared<JSON>(JSON::makeNumber(token)); | 1093 | item = std::make_shared<JSON>(JSON::makeNumber(token)); |
| @@ -1106,7 +1103,7 @@ JSONParser::handleToken() | @@ -1106,7 +1103,7 @@ JSONParser::handleToken() | ||
| 1106 | } else { | 1103 | } else { |
| 1107 | QTC::TC("libtests", "JSON parse invalid keyword"); | 1104 | QTC::TC("libtests", "JSON parse invalid keyword"); |
| 1108 | throw std::runtime_error( | 1105 | throw std::runtime_error( |
| 1109 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1106 | + "JSON: offset " + std::to_string(offset) + |
| 1110 | ": invalid keyword " + token); | 1107 | ": invalid keyword " + token); |
| 1111 | } | 1108 | } |
| 1112 | break; | 1109 | break; |
| @@ -1139,21 +1136,20 @@ JSONParser::handleToken() | @@ -1139,21 +1136,20 @@ JSONParser::handleToken() | ||
| 1139 | case ps_dict_after_key: | 1136 | case ps_dict_after_key: |
| 1140 | QTC::TC("libtests", "JSON parse expected colon"); | 1137 | QTC::TC("libtests", "JSON parse expected colon"); |
| 1141 | throw std::runtime_error( | 1138 | throw std::runtime_error( |
| 1142 | - "JSON: offset " + QUtil::int_to_string(offset) + | ||
| 1143 | - ": expected ':'"); | 1139 | + "JSON: offset " + std::to_string(offset) + ": expected ':'"); |
| 1144 | break; | 1140 | break; |
| 1145 | 1141 | ||
| 1146 | case ps_dict_after_item: | 1142 | case ps_dict_after_item: |
| 1147 | QTC::TC("libtests", "JSON parse expected , or }"); | 1143 | QTC::TC("libtests", "JSON parse expected , or }"); |
| 1148 | throw std::runtime_error( | 1144 | throw std::runtime_error( |
| 1149 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1145 | + "JSON: offset " + std::to_string(offset) + |
| 1150 | ": expected ',' or '}'"); | 1146 | ": expected ',' or '}'"); |
| 1151 | break; | 1147 | break; |
| 1152 | 1148 | ||
| 1153 | case ps_array_after_item: | 1149 | case ps_array_after_item: |
| 1154 | QTC::TC("libtests", "JSON parse expected, or ]"); | 1150 | QTC::TC("libtests", "JSON parse expected, or ]"); |
| 1155 | throw std::runtime_error( | 1151 | throw std::runtime_error( |
| 1156 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1152 | + "JSON: offset " + std::to_string(offset) + |
| 1157 | ": expected ',' or ']'"); | 1153 | ": expected ',' or ']'"); |
| 1158 | break; | 1154 | break; |
| 1159 | 1155 | ||
| @@ -1162,7 +1158,7 @@ JSONParser::handleToken() | @@ -1162,7 +1158,7 @@ JSONParser::handleToken() | ||
| 1162 | if (lex_state != ls_string) { | 1158 | if (lex_state != ls_string) { |
| 1163 | QTC::TC("libtests", "JSON parse string as dict key"); | 1159 | QTC::TC("libtests", "JSON parse string as dict key"); |
| 1164 | throw std::runtime_error( | 1160 | throw std::runtime_error( |
| 1165 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1161 | + "JSON: offset " + std::to_string(offset) + |
| 1166 | ": expect string as dictionary key"); | 1162 | ": expect string as dictionary key"); |
| 1167 | } | 1163 | } |
| 1168 | break; | 1164 | break; |
| @@ -1181,7 +1177,7 @@ JSONParser::handleToken() | @@ -1181,7 +1177,7 @@ JSONParser::handleToken() | ||
| 1181 | { | 1177 | { |
| 1182 | QTC::TC("libtests", "JSON parse unexpected }"); | 1178 | QTC::TC("libtests", "JSON parse unexpected }"); |
| 1183 | throw std::runtime_error( | 1179 | throw std::runtime_error( |
| 1184 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1180 | + "JSON: offset " + std::to_string(offset) + |
| 1185 | ": unexpected dictionary end delimiter"); | 1181 | ": unexpected dictionary end delimiter"); |
| 1186 | } | 1182 | } |
| 1187 | } else if (delimiter == ']') { | 1183 | } else if (delimiter == ']') { |
| @@ -1191,14 +1187,14 @@ JSONParser::handleToken() | @@ -1191,14 +1187,14 @@ JSONParser::handleToken() | ||
| 1191 | { | 1187 | { |
| 1192 | QTC::TC("libtests", "JSON parse unexpected ]"); | 1188 | QTC::TC("libtests", "JSON parse unexpected ]"); |
| 1193 | throw std::runtime_error( | 1189 | throw std::runtime_error( |
| 1194 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1190 | + "JSON: offset " + std::to_string(offset) + |
| 1195 | ": unexpected array end delimiter"); | 1191 | ": unexpected array end delimiter"); |
| 1196 | } | 1192 | } |
| 1197 | } else if (delimiter == ':') { | 1193 | } else if (delimiter == ':') { |
| 1198 | if (parser_state != ps_dict_after_key) { | 1194 | if (parser_state != ps_dict_after_key) { |
| 1199 | QTC::TC("libtests", "JSON parse unexpected :"); | 1195 | QTC::TC("libtests", "JSON parse unexpected :"); |
| 1200 | throw std::runtime_error( | 1196 | throw std::runtime_error( |
| 1201 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1197 | + "JSON: offset " + std::to_string(offset) + |
| 1202 | ": unexpected colon"); | 1198 | ": unexpected colon"); |
| 1203 | } | 1199 | } |
| 1204 | } else if (delimiter == ',') { | 1200 | } else if (delimiter == ',') { |
| @@ -1206,7 +1202,7 @@ JSONParser::handleToken() | @@ -1206,7 +1202,7 @@ JSONParser::handleToken() | ||
| 1206 | (parser_state == ps_array_after_item))) { | 1202 | (parser_state == ps_array_after_item))) { |
| 1207 | QTC::TC("libtests", "JSON parse unexpected ,"); | 1203 | QTC::TC("libtests", "JSON parse unexpected ,"); |
| 1208 | throw std::runtime_error( | 1204 | throw std::runtime_error( |
| 1209 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1205 | + "JSON: offset " + std::to_string(offset) + |
| 1210 | ": unexpected comma"); | 1206 | ": unexpected comma"); |
| 1211 | } | 1207 | } |
| 1212 | } else if (delimiter != '\0') { | 1208 | } else if (delimiter != '\0') { |
| @@ -1265,7 +1261,7 @@ JSONParser::handleToken() | @@ -1265,7 +1261,7 @@ JSONParser::handleToken() | ||
| 1265 | if (tos->checkDictionaryKeySeen(dict_key)) { | 1261 | if (tos->checkDictionaryKeySeen(dict_key)) { |
| 1266 | QTC::TC("libtests", "JSON parse duplicate key"); | 1262 | QTC::TC("libtests", "JSON parse duplicate key"); |
| 1267 | throw std::runtime_error( | 1263 | throw std::runtime_error( |
| 1268 | - "JSON: offset " + QUtil::int_to_string(dict_key_offset) + | 1264 | + "JSON: offset " + std::to_string(dict_key_offset) + |
| 1269 | ": duplicated dictionary key"); | 1265 | ": duplicated dictionary key"); |
| 1270 | } | 1266 | } |
| 1271 | if (!reactor || !reactor->dictionaryItem(dict_key, *item)) { | 1267 | if (!reactor || !reactor->dictionaryItem(dict_key, *item)) { |
| @@ -1326,7 +1322,7 @@ JSONParser::handleToken() | @@ -1326,7 +1322,7 @@ JSONParser::handleToken() | ||
| 1326 | } | 1322 | } |
| 1327 | if (ps_stack.size() > 500) { | 1323 | if (ps_stack.size() > 500) { |
| 1328 | throw std::runtime_error( | 1324 | throw std::runtime_error( |
| 1329 | - "JSON: offset " + QUtil::int_to_string(offset) + | 1325 | + "JSON: offset " + std::to_string(offset) + |
| 1330 | ": maximum object depth exceeded"); | 1326 | ": maximum object depth exceeded"); |
| 1331 | } | 1327 | } |
| 1332 | parser_state = next_state; | 1328 | parser_state = next_state; |
libqpdf/JSONHandler.cc
| @@ -132,7 +132,7 @@ JSONHandler::handle(std::string const& path, JSON j) | @@ -132,7 +132,7 @@ JSONHandler::handle(std::string const& path, JSON j) | ||
| 132 | size_t i = 0; | 132 | size_t i = 0; |
| 133 | j.forEachArrayItem([&i, &path, this](JSON v) { | 133 | j.forEachArrayItem([&i, &path, this](JSON v) { |
| 134 | this->m->h.array_item_handler->handle( | 134 | this->m->h.array_item_handler->handle( |
| 135 | - path + "[" + QUtil::uint_to_string(i) + "]", v); | 135 | + path + "[" + std::to_string(i) + "]", v); |
| 136 | ++i; | 136 | ++i; |
| 137 | }); | 137 | }); |
| 138 | this->m->h.array_end_handler(path); | 138 | this->m->h.array_end_handler(path); |
libqpdf/NNTree.cc
| @@ -10,7 +10,7 @@ get_description(QPDFObjectHandle& node) | @@ -10,7 +10,7 @@ get_description(QPDFObjectHandle& node) | ||
| 10 | { | 10 | { |
| 11 | std::string result("Name/Number tree node"); | 11 | std::string result("Name/Number tree node"); |
| 12 | if (node.isIndirect()) { | 12 | if (node.isIndirect()) { |
| 13 | - result += " (object " + QUtil::int_to_string(node.getObjectID()) + ")"; | 13 | + result += " (object " + std::to_string(node.getObjectID()) + ")"; |
| 14 | } | 14 | } |
| 15 | return result; | 15 | return result; |
| 16 | } | 16 | } |
| @@ -103,7 +103,7 @@ NNTreeIterator::getNextKid(PathElement& pe, bool backward) | @@ -103,7 +103,7 @@ NNTreeIterator::getNextKid(PathElement& pe, bool backward) | ||
| 103 | impl.qpdf, | 103 | impl.qpdf, |
| 104 | pe.node, | 104 | pe.node, |
| 105 | ("skipping over invalid kid at index " + | 105 | ("skipping over invalid kid at index " + |
| 106 | - QUtil::int_to_string(pe.kid_number))); | 106 | + std::to_string(pe.kid_number))); |
| 107 | } | 107 | } |
| 108 | } else { | 108 | } else { |
| 109 | result = QPDFObjectHandle::newNull(); | 109 | result = QPDFObjectHandle::newNull(); |
| @@ -159,7 +159,7 @@ NNTreeIterator::increment(bool backward) | @@ -159,7 +159,7 @@ NNTreeIterator::increment(bool backward) | ||
| 159 | warn( | 159 | warn( |
| 160 | impl.qpdf, | 160 | impl.qpdf, |
| 161 | this->node, | 161 | this->node, |
| 162 | - ("item " + QUtil::int_to_string(this->item_number) + | 162 | + ("item " + std::to_string(this->item_number) + |
| 163 | " has the wrong type")); | 163 | " has the wrong type")); |
| 164 | } else { | 164 | } else { |
| 165 | found_valid_key = true; | 165 | found_valid_key = true; |
| @@ -685,8 +685,7 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty) | @@ -685,8 +685,7 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty) | ||
| 685 | warn( | 685 | warn( |
| 686 | impl.qpdf, | 686 | impl.qpdf, |
| 687 | node, | 687 | node, |
| 688 | - ("converting kid number " + | ||
| 689 | - QUtil::int_to_string(kid_number) + | 688 | + ("converting kid number " + std::to_string(kid_number) + |
| 690 | " to an indirect object")); | 689 | " to an indirect object")); |
| 691 | next = impl.qpdf.makeIndirectObject(next); | 690 | next = impl.qpdf.makeIndirectObject(next); |
| 692 | kids.setArrayItem(kid_number, next); | 691 | kids.setArrayItem(kid_number, next); |
| @@ -695,7 +694,7 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty) | @@ -695,7 +694,7 @@ NNTreeIterator::deepen(QPDFObjectHandle node, bool first, bool allow_empty) | ||
| 695 | warn( | 694 | warn( |
| 696 | impl.qpdf, | 695 | impl.qpdf, |
| 697 | node, | 696 | node, |
| 698 | - ("kid number " + QUtil::int_to_string(kid_number) + | 697 | + ("kid number " + std::to_string(kid_number) + |
| 699 | " is not an indirect object")); | 698 | " is not an indirect object")); |
| 700 | } | 699 | } |
| 701 | } | 700 | } |
| @@ -853,7 +852,7 @@ NNTreeImpl::compareKeyItem( | @@ -853,7 +852,7 @@ NNTreeImpl::compareKeyItem( | ||
| 853 | error( | 852 | error( |
| 854 | qpdf, | 853 | qpdf, |
| 855 | this->oh, | 854 | this->oh, |
| 856 | - ("item at index " + QUtil::int_to_string(2 * idx) + | 855 | + ("item at index " + std::to_string(2 * idx) + |
| 857 | " is not the right type")); | 856 | " is not the right type")); |
| 858 | } | 857 | } |
| 859 | return details.compareKeys(key, items.getArrayItem(2 * idx)); | 858 | return details.compareKeys(key, items.getArrayItem(2 * idx)); |
| @@ -866,10 +865,7 @@ NNTreeImpl::compareKeyKid( | @@ -866,10 +865,7 @@ NNTreeImpl::compareKeyKid( | ||
| 866 | if (!(kids.isArray() && (idx < kids.getArrayNItems()) && | 865 | if (!(kids.isArray() && (idx < kids.getArrayNItems()) && |
| 867 | kids.getArrayItem(idx).isDictionary())) { | 866 | kids.getArrayItem(idx).isDictionary())) { |
| 868 | QTC::TC("qpdf", "NNTree kid is invalid"); | 867 | QTC::TC("qpdf", "NNTree kid is invalid"); |
| 869 | - error( | ||
| 870 | - qpdf, | ||
| 871 | - this->oh, | ||
| 872 | - "invalid kid at index " + QUtil::int_to_string(idx)); | 868 | + error(qpdf, this->oh, "invalid kid at index " + std::to_string(idx)); |
| 873 | } | 869 | } |
| 874 | return withinLimits(key, kids.getArrayItem(idx)); | 870 | return withinLimits(key, kids.getArrayItem(idx)); |
| 875 | } | 871 | } |
libqpdf/PDFVersion.cc
| @@ -48,8 +48,8 @@ void | @@ -48,8 +48,8 @@ void | ||
| 48 | PDFVersion::getVersion(std::string& version, int& extension_level) const | 48 | PDFVersion::getVersion(std::string& version, int& extension_level) const |
| 49 | { | 49 | { |
| 50 | extension_level = this->extension_level; | 50 | extension_level = this->extension_level; |
| 51 | - version = QUtil::int_to_string(this->major_version) + "." + | ||
| 52 | - QUtil::int_to_string(this->minor_version); | 51 | + version = std::to_string(this->major_version) + "." + |
| 52 | + std::to_string(this->minor_version); | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | int | 55 | int |
libqpdf/Pipeline.cc
| @@ -57,56 +57,56 @@ Pipeline::operator<<(std::string const& str) | @@ -57,56 +57,56 @@ Pipeline::operator<<(std::string const& str) | ||
| 57 | Pipeline& | 57 | Pipeline& |
| 58 | Pipeline::operator<<(short i) | 58 | Pipeline::operator<<(short i) |
| 59 | { | 59 | { |
| 60 | - this->writeString(QUtil::int_to_string(i)); | 60 | + this->writeString(std::to_string(i)); |
| 61 | return *this; | 61 | return *this; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | Pipeline& | 64 | Pipeline& |
| 65 | Pipeline::operator<<(int i) | 65 | Pipeline::operator<<(int i) |
| 66 | { | 66 | { |
| 67 | - this->writeString(QUtil::int_to_string(i)); | 67 | + this->writeString(std::to_string(i)); |
| 68 | return *this; | 68 | return *this; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | Pipeline& | 71 | Pipeline& |
| 72 | Pipeline::operator<<(long i) | 72 | Pipeline::operator<<(long i) |
| 73 | { | 73 | { |
| 74 | - this->writeString(QUtil::int_to_string(i)); | 74 | + this->writeString(std::to_string(i)); |
| 75 | return *this; | 75 | return *this; |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | Pipeline& | 78 | Pipeline& |
| 79 | Pipeline::operator<<(long long i) | 79 | Pipeline::operator<<(long long i) |
| 80 | { | 80 | { |
| 81 | - this->writeString(QUtil::int_to_string(i)); | 81 | + this->writeString(std::to_string(i)); |
| 82 | return *this; | 82 | return *this; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | Pipeline& | 85 | Pipeline& |
| 86 | Pipeline::operator<<(unsigned short i) | 86 | Pipeline::operator<<(unsigned short i) |
| 87 | { | 87 | { |
| 88 | - this->writeString(QUtil::uint_to_string(i)); | 88 | + this->writeString(std::to_string(i)); |
| 89 | return *this; | 89 | return *this; |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | Pipeline& | 92 | Pipeline& |
| 93 | Pipeline::operator<<(unsigned int i) | 93 | Pipeline::operator<<(unsigned int i) |
| 94 | { | 94 | { |
| 95 | - this->writeString(QUtil::uint_to_string(i)); | 95 | + this->writeString(std::to_string(i)); |
| 96 | return *this; | 96 | return *this; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | Pipeline& | 99 | Pipeline& |
| 100 | Pipeline::operator<<(unsigned long i) | 100 | Pipeline::operator<<(unsigned long i) |
| 101 | { | 101 | { |
| 102 | - this->writeString(QUtil::uint_to_string(i)); | 102 | + this->writeString(std::to_string(i)); |
| 103 | return *this; | 103 | return *this; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | Pipeline& | 106 | Pipeline& |
| 107 | Pipeline::operator<<(unsigned long long i) | 107 | Pipeline::operator<<(unsigned long long i) |
| 108 | { | 108 | { |
| 109 | - this->writeString(QUtil::uint_to_string(i)); | 109 | + this->writeString(std::to_string(i)); |
| 110 | return *this; | 110 | return *this; |
| 111 | } | 111 | } |
| 112 | 112 |
libqpdf/Pl_AES_PDF.cc
| @@ -53,7 +53,7 @@ Pl_AES_PDF::setIV(unsigned char const* iv, size_t bytes) | @@ -53,7 +53,7 @@ Pl_AES_PDF::setIV(unsigned char const* iv, size_t bytes) | ||
| 53 | throw std::logic_error( | 53 | throw std::logic_error( |
| 54 | "Pl_AES_PDF: specified initialization vector" | 54 | "Pl_AES_PDF: specified initialization vector" |
| 55 | " size in bytes must be " + | 55 | " size in bytes must be " + |
| 56 | - QUtil::uint_to_string(bytes)); | 56 | + std::to_string(bytes)); |
| 57 | } | 57 | } |
| 58 | this->use_specified_iv = true; | 58 | this->use_specified_iv = true; |
| 59 | memcpy(this->specified_iv, iv, bytes); | 59 | memcpy(this->specified_iv, iv, bytes); |
libqpdf/Pl_DCT.cc
| @@ -302,9 +302,8 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b) | @@ -302,9 +302,8 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b) | ||
| 302 | QIntC::to_size(cinfo->input_components); | 302 | QIntC::to_size(cinfo->input_components); |
| 303 | if (b->getSize() != expected_size) { | 303 | if (b->getSize() != expected_size) { |
| 304 | throw std::runtime_error( | 304 | throw std::runtime_error( |
| 305 | - "Pl_DCT: image buffer size = " + | ||
| 306 | - QUtil::uint_to_string(b->getSize()) + | ||
| 307 | - "; expected size = " + QUtil::uint_to_string(expected_size)); | 305 | + "Pl_DCT: image buffer size = " + std::to_string(b->getSize()) + |
| 306 | + "; expected size = " + std::to_string(expected_size)); | ||
| 308 | } | 307 | } |
| 309 | JSAMPROW row_pointer[1]; | 308 | JSAMPROW row_pointer[1]; |
| 310 | unsigned char* buffer = b->getBuffer(); | 309 | unsigned char* buffer = b->getBuffer(); |
libqpdf/Pl_Flate.cc
| @@ -286,7 +286,7 @@ Pl_Flate::checkError(char const* prefix, int error_code) | @@ -286,7 +286,7 @@ Pl_Flate::checkError(char const* prefix, int error_code) | ||
| 286 | 286 | ||
| 287 | default: | 287 | default: |
| 288 | msg += std::string("zlib unknown error (") + | 288 | msg += std::string("zlib unknown error (") + |
| 289 | - QUtil::int_to_string(error_code) + ")"; | 289 | + std::to_string(error_code) + ")"; |
| 290 | break; | 290 | break; |
| 291 | } | 291 | } |
| 292 | } | 292 | } |
libqpdf/Pl_Function.cc
| @@ -25,7 +25,7 @@ Pl_Function::Pl_Function( | @@ -25,7 +25,7 @@ Pl_Function::Pl_Function( | ||
| 25 | if (code != 0) { | 25 | if (code != 0) { |
| 26 | throw std::runtime_error( | 26 | throw std::runtime_error( |
| 27 | std::string(identifier) + " function returned code " + | 27 | std::string(identifier) + " function returned code " + |
| 28 | - QUtil::int_to_string(code)); | 28 | + std::to_string(code)); |
| 29 | } | 29 | } |
| 30 | }; | 30 | }; |
| 31 | } | 31 | } |
| @@ -40,7 +40,7 @@ Pl_Function::Pl_Function( | @@ -40,7 +40,7 @@ Pl_Function::Pl_Function( | ||
| 40 | if (code != 0) { | 40 | if (code != 0) { |
| 41 | throw std::runtime_error( | 41 | throw std::runtime_error( |
| 42 | std::string(identifier) + " function returned code " + | 42 | std::string(identifier) + " function returned code " + |
| 43 | - QUtil::int_to_string(code)); | 43 | + std::to_string(code)); |
| 44 | } | 44 | } |
| 45 | }; | 45 | }; |
| 46 | } | 46 | } |
libqpdf/Pl_LZWDecoder.cc
| @@ -98,7 +98,7 @@ Pl_LZWDecoder::getFirstChar(unsigned int code) | @@ -98,7 +98,7 @@ Pl_LZWDecoder::getFirstChar(unsigned int code) | ||
| 98 | } else { | 98 | } else { |
| 99 | throw std::runtime_error( | 99 | throw std::runtime_error( |
| 100 | "Pl_LZWDecoder::getFirstChar called with invalid code (" + | 100 | "Pl_LZWDecoder::getFirstChar called with invalid code (" + |
| 101 | - QUtil::int_to_string(code) + ")"); | 101 | + std::to_string(code) + ")"); |
| 102 | } | 102 | } |
| 103 | return result; | 103 | return result; |
| 104 | } | 104 | } |
| @@ -126,7 +126,7 @@ Pl_LZWDecoder::addToTable(unsigned char next) | @@ -126,7 +126,7 @@ Pl_LZWDecoder::addToTable(unsigned char next) | ||
| 126 | } else { | 126 | } else { |
| 127 | throw std::runtime_error( | 127 | throw std::runtime_error( |
| 128 | "Pl_LZWDecoder::addToTable called with invalid code (" + | 128 | "Pl_LZWDecoder::addToTable called with invalid code (" + |
| 129 | - QUtil::int_to_string(this->last_code) + ")"); | 129 | + std::to_string(this->last_code) + ")"); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | Buffer entry(1 + last_size); | 132 | Buffer entry(1 + last_size); |
libqpdf/Pl_QPDFTokenizer.cc
| @@ -49,7 +49,7 @@ Pl_QPDFTokenizer::finish() | @@ -49,7 +49,7 @@ Pl_QPDFTokenizer::finish() | ||
| 49 | 49 | ||
| 50 | while (true) { | 50 | while (true) { |
| 51 | QPDFTokenizer::Token token = this->m->tokenizer.readToken( | 51 | QPDFTokenizer::Token token = this->m->tokenizer.readToken( |
| 52 | - input, "offset " + QUtil::int_to_string(input->tell()), true); | 52 | + input, "offset " + std::to_string(input->tell()), true); |
| 53 | this->m->filter->handleToken(token); | 53 | this->m->filter->handleToken(token); |
| 54 | if (token.getType() == QPDFTokenizer::tt_eof) { | 54 | if (token.getType() == QPDFTokenizer::tt_eof) { |
| 55 | break; | 55 | break; |
libqpdf/QPDF.cc
| @@ -773,9 +773,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset) | @@ -773,9 +773,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset) | ||
| 773 | "", | 773 | "", |
| 774 | 0, | 774 | 0, |
| 775 | (std::string("reported number of objects (") + | 775 | (std::string("reported number of objects (") + |
| 776 | - QUtil::int_to_string(size) + | 776 | + std::to_string(size) + |
| 777 | ") is not one plus the highest object number (" + | 777 | ") is not one plus the highest object number (" + |
| 778 | - QUtil::int_to_string(max_obj) + ")")); | 778 | + std::to_string(max_obj) + ")")); |
| 779 | } | 779 | } |
| 780 | 780 | ||
| 781 | // We no longer need the deleted_objects table, so go ahead and | 781 | // We no longer need the deleted_objects table, so go ahead and |
| @@ -954,7 +954,7 @@ QPDF::read_xrefTable(qpdf_offset_t xref_offset) | @@ -954,7 +954,7 @@ QPDF::read_xrefTable(qpdf_offset_t xref_offset) | ||
| 954 | this->m->file->getName(), | 954 | this->m->file->getName(), |
| 955 | "xref table", | 955 | "xref table", |
| 956 | this->m->file->getLastOffset(), | 956 | this->m->file->getLastOffset(), |
| 957 | - "invalid xref entry (obj=" + QUtil::int_to_string(i) + ")"); | 957 | + "invalid xref entry (obj=" + std::to_string(i) + ")"); |
| 958 | } | 958 | } |
| 959 | if (type == 'f') { | 959 | if (type == 'f') { |
| 960 | // Save deleted items until after we've checked the | 960 | // Save deleted items until after we've checked the |
| @@ -1160,7 +1160,7 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | @@ -1160,7 +1160,7 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | ||
| 1160 | "xref stream", | 1160 | "xref stream", |
| 1161 | xref_offset, | 1161 | xref_offset, |
| 1162 | ("Cross-reference stream's /Index's item " + | 1162 | ("Cross-reference stream's /Index's item " + |
| 1163 | - QUtil::int_to_string(i) + " is not an integer")); | 1163 | + std::to_string(i) + " is not an integer")); |
| 1164 | } | 1164 | } |
| 1165 | } | 1165 | } |
| 1166 | QTC::TC("qpdf", "QPDF xref /Index is array", n_index == 2 ? 0 : 1); | 1166 | QTC::TC("qpdf", "QPDF xref /Index is array", n_index == 2 ? 0 : 1); |
| @@ -1181,9 +1181,9 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | @@ -1181,9 +1181,9 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | ||
| 1181 | xref_offset, | 1181 | xref_offset, |
| 1182 | ("Cross-reference stream claims to contain" | 1182 | ("Cross-reference stream claims to contain" |
| 1183 | " too many entries: " + | 1183 | " too many entries: " + |
| 1184 | - QUtil::int_to_string(indx.at(i)) + " " + | ||
| 1185 | - QUtil::uint_to_string(max_num_entries) + " " + | ||
| 1186 | - QUtil::uint_to_string(num_entries))); | 1184 | + std::to_string(indx.at(i)) + " " + |
| 1185 | + std::to_string(max_num_entries) + " " + | ||
| 1186 | + std::to_string(num_entries))); | ||
| 1187 | } | 1187 | } |
| 1188 | num_entries += toS(indx.at(i)); | 1188 | num_entries += toS(indx.at(i)); |
| 1189 | } | 1189 | } |
| @@ -1203,8 +1203,8 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | @@ -1203,8 +1203,8 @@ QPDF::processXRefStream(qpdf_offset_t xref_offset, QPDFObjectHandle& xref_obj) | ||
| 1203 | xref_offset, | 1203 | xref_offset, |
| 1204 | ("Cross-reference stream data has the wrong size;" | 1204 | ("Cross-reference stream data has the wrong size;" |
| 1205 | " expected = " + | 1205 | " expected = " + |
| 1206 | - QUtil::uint_to_string(expected_size) + | ||
| 1207 | - "; actual = " + QUtil::uint_to_string(actual_size))); | 1206 | + std::to_string(expected_size) + |
| 1207 | + "; actual = " + std::to_string(actual_size))); | ||
| 1208 | if (expected_size > actual_size) { | 1208 | if (expected_size > actual_size) { |
| 1209 | throw x; | 1209 | throw x; |
| 1210 | } else { | 1210 | } else { |
| @@ -1356,7 +1356,7 @@ QPDF::insertXrefEntry(int obj, int f0, qpdf_offset_t f1, int f2, bool overwrite) | @@ -1356,7 +1356,7 @@ QPDF::insertXrefEntry(int obj, int f0, qpdf_offset_t f1, int f2, bool overwrite) | ||
| 1356 | this->m->file->getName(), | 1356 | this->m->file->getName(), |
| 1357 | "xref stream", | 1357 | "xref stream", |
| 1358 | this->m->file->getLastOffset(), | 1358 | this->m->file->getLastOffset(), |
| 1359 | - "unknown xref stream entry type " + QUtil::int_to_string(f0)); | 1359 | + "unknown xref stream entry type " + std::to_string(f0)); |
| 1360 | break; | 1360 | break; |
| 1361 | } | 1361 | } |
| 1362 | } | 1362 | } |
| @@ -1747,7 +1747,7 @@ QPDF::recoverStreamLength( | @@ -1747,7 +1747,7 @@ QPDF::recoverStreamLength( | ||
| 1747 | input->getName(), | 1747 | input->getName(), |
| 1748 | this->m->last_object_description, | 1748 | this->m->last_object_description, |
| 1749 | stream_offset, | 1749 | stream_offset, |
| 1750 | - "recovered stream length: " + QUtil::uint_to_string(length))); | 1750 | + "recovered stream length: " + std::to_string(length))); |
| 1751 | } | 1751 | } |
| 1752 | 1752 | ||
| 1753 | QTC::TC("qpdf", "QPDF recovered stream length"); | 1753 | QTC::TC("qpdf", "QPDF recovered stream length"); |
| @@ -2026,8 +2026,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | @@ -2026,8 +2026,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | ||
| 2026 | this->m->file->getName(), | 2026 | this->m->file->getName(), |
| 2027 | this->m->last_object_description, | 2027 | this->m->last_object_description, |
| 2028 | this->m->file->getLastOffset(), | 2028 | this->m->file->getLastOffset(), |
| 2029 | - ("supposed object stream " + | ||
| 2030 | - QUtil::int_to_string(obj_stream_number) + " is not a stream")); | 2029 | + ("supposed object stream " + std::to_string(obj_stream_number) + |
| 2030 | + " is not a stream")); | ||
| 2031 | } | 2031 | } |
| 2032 | 2032 | ||
| 2033 | // For linearization data in the object, use the data from the | 2033 | // For linearization data in the object, use the data from the |
| @@ -2045,8 +2045,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | @@ -2045,8 +2045,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | ||
| 2045 | qpdf_e_damaged_pdf, | 2045 | qpdf_e_damaged_pdf, |
| 2046 | this->m->last_object_description, | 2046 | this->m->last_object_description, |
| 2047 | this->m->file->getLastOffset(), | 2047 | this->m->file->getLastOffset(), |
| 2048 | - ("supposed object stream " + | ||
| 2049 | - QUtil::int_to_string(obj_stream_number) + " has wrong type")); | 2048 | + ("supposed object stream " + std::to_string(obj_stream_number) + |
| 2049 | + " has wrong type")); | ||
| 2050 | } | 2050 | } |
| 2051 | 2051 | ||
| 2052 | if (!(dict.getKey("/N").isInteger() && dict.getKey("/First").isInteger())) { | 2052 | if (!(dict.getKey("/N").isInteger() && dict.getKey("/First").isInteger())) { |
| @@ -2055,7 +2055,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | @@ -2055,7 +2055,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | ||
| 2055 | this->m->file->getName(), | 2055 | this->m->file->getName(), |
| 2056 | this->m->last_object_description, | 2056 | this->m->last_object_description, |
| 2057 | this->m->file->getLastOffset(), | 2057 | this->m->file->getLastOffset(), |
| 2058 | - ("object stream " + QUtil::int_to_string(obj_stream_number) + | 2058 | + ("object stream " + std::to_string(obj_stream_number) + |
| 2059 | " has incorrect keys")); | 2059 | " has incorrect keys")); |
| 2060 | } | 2060 | } |
| 2061 | 2061 | ||
| @@ -2069,7 +2069,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | @@ -2069,7 +2069,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number) | ||
| 2069 | // line-break | 2069 | // line-break |
| 2070 | new BufferInputSource( | 2070 | new BufferInputSource( |
| 2071 | (this->m->file->getName() + " object stream " + | 2071 | (this->m->file->getName() + " object stream " + |
| 2072 | - QUtil::int_to_string(obj_stream_number)), | 2072 | + std::to_string(obj_stream_number)), |
| 2073 | bp.get())); | 2073 | bp.get())); |
| 2074 | 2074 | ||
| 2075 | for (int i = 0; i < n; ++i) { | 2075 | for (int i = 0; i < n; ++i) { |
libqpdf/QPDFAcroFormDocumentHelper.cc
| @@ -104,7 +104,7 @@ QPDFAcroFormDocumentHelper::addAndRenameFormFields( | @@ -104,7 +104,7 @@ QPDFAcroFormDocumentHelper::addAndRenameFormFields( | ||
| 104 | std::string append; | 104 | std::string append; |
| 105 | while (!getFieldsWithQualifiedName(new_name).empty()) { | 105 | while (!getFieldsWithQualifiedName(new_name).empty()) { |
| 106 | ++suffix; | 106 | ++suffix; |
| 107 | - append = "+" + QUtil::int_to_string(suffix); | 107 | + append = "+" + std::to_string(suffix); |
| 108 | new_name = old_name + append; | 108 | new_name = old_name + append; |
| 109 | } | 109 | } |
| 110 | renames[old_name] = append; | 110 | renames[old_name] = append; |
libqpdf/QPDFCrypto_gnutls.cc
| @@ -135,7 +135,7 @@ QPDFCrypto_gnutls::SHA2_init(int bits) | @@ -135,7 +135,7 @@ QPDFCrypto_gnutls::SHA2_init(int bits) | ||
| 135 | if (code < 0) { | 135 | if (code < 0) { |
| 136 | this->hash_ctx = nullptr; | 136 | this->hash_ctx = nullptr; |
| 137 | throw std::runtime_error( | 137 | throw std::runtime_error( |
| 138 | - std::string("gnutls: SHA") + QUtil::int_to_string(bits) + | 138 | + std::string("gnutls: SHA") + std::to_string(bits) + |
| 139 | " error: " + std::string(gnutls_strerror(code))); | 139 | " error: " + std::string(gnutls_strerror(code))); |
| 140 | } | 140 | } |
| 141 | } | 141 | } |
libqpdf/QPDFExc.cc
| @@ -39,7 +39,7 @@ QPDFExc::createWhat( | @@ -39,7 +39,7 @@ QPDFExc::createWhat( | ||
| 39 | } | 39 | } |
| 40 | } | 40 | } |
| 41 | if (offset > 0) { | 41 | if (offset > 0) { |
| 42 | - result += "offset " + QUtil::int_to_string(offset); | 42 | + result += "offset " + std::to_string(offset); |
| 43 | } | 43 | } |
| 44 | if (!filename.empty()) { | 44 | if (!filename.empty()) { |
| 45 | result += ")"; | 45 | result += ")"; |
libqpdf/QPDFJob.cc
| @@ -2472,7 +2472,7 @@ QPDFJob::handleTransformations(QPDF& pdf) | @@ -2472,7 +2472,7 @@ QPDFJob::handleTransformations(QPDF& pdf) | ||
| 2472 | std::shared_ptr<QPDFObjectHandle::StreamDataProvider> sdp(io); | 2472 | std::shared_ptr<QPDFObjectHandle::StreamDataProvider> sdp(io); |
| 2473 | if (io->evaluate( | 2473 | if (io->evaluate( |
| 2474 | "image " + name + " on page " + | 2474 | "image " + name + " on page " + |
| 2475 | - QUtil::int_to_string(pageno))) { | 2475 | + std::to_string(pageno))) { |
| 2476 | QPDFObjectHandle new_image = | 2476 | QPDFObjectHandle new_image = |
| 2477 | QPDFObjectHandle::newStream(&pdf); | 2477 | QPDFObjectHandle::newStream(&pdf); |
| 2478 | new_image.replaceDict(image.getDict().shallowCopy()); | 2478 | new_image.replaceDict(image.getDict().shallowCopy()); |
| @@ -3318,7 +3318,7 @@ QPDFJob::doSplitPages(QPDF& pdf, bool& warnings) | @@ -3318,7 +3318,7 @@ QPDFJob::doSplitPages(QPDF& pdf, bool& warnings) | ||
| 3318 | QPDFPageLabelDocumentHelper pldh(pdf); | 3318 | QPDFPageLabelDocumentHelper pldh(pdf); |
| 3319 | QPDFAcroFormDocumentHelper afdh(pdf); | 3319 | QPDFAcroFormDocumentHelper afdh(pdf); |
| 3320 | std::vector<QPDFObjectHandle> const& pages = pdf.getAllPages(); | 3320 | std::vector<QPDFObjectHandle> const& pages = pdf.getAllPages(); |
| 3321 | - size_t pageno_len = QUtil::uint_to_string(pages.size()).length(); | 3321 | + size_t pageno_len = std::to_string(pages.size()).length(); |
| 3322 | size_t num_pages = pages.size(); | 3322 | size_t num_pages = pages.size(); |
| 3323 | for (size_t i = 0; i < num_pages; i += QIntC::to_size(m->split_pages)) { | 3323 | for (size_t i = 0; i < num_pages; i += QIntC::to_size(m->split_pages)) { |
| 3324 | size_t first = i + 1; | 3324 | size_t first = i + 1; |
libqpdf/QPDFObjGen.cc
| @@ -12,6 +12,5 @@ operator<<(std::ostream& os, const QPDFObjGen& og) | @@ -12,6 +12,5 @@ operator<<(std::ostream& os, const QPDFObjGen& og) | ||
| 12 | std::string | 12 | std::string |
| 13 | QPDFObjGen::unparse(char separator) const | 13 | QPDFObjGen::unparse(char separator) const |
| 14 | { | 14 | { |
| 15 | - return QUtil::int_to_string(this->obj) + separator + | ||
| 16 | - QUtil::int_to_string(this->gen); | 15 | + return std::to_string(this->obj) + separator + std::to_string(this->gen); |
| 17 | } | 16 | } |
libqpdf/QPDFObjectHandle.cc
| @@ -1257,7 +1257,7 @@ QPDFObjectHandle::getUniqueResourceName( | @@ -1257,7 +1257,7 @@ QPDFObjectHandle::getUniqueResourceName( | ||
| 1257 | std::set<std::string> names = (namesp ? *namesp : getResourceNames()); | 1257 | std::set<std::string> names = (namesp ? *namesp : getResourceNames()); |
| 1258 | int max_suffix = min_suffix + QIntC::to_int(names.size()); | 1258 | int max_suffix = min_suffix + QIntC::to_int(names.size()); |
| 1259 | while (min_suffix <= max_suffix) { | 1259 | while (min_suffix <= max_suffix) { |
| 1260 | - std::string candidate = prefix + QUtil::int_to_string(min_suffix); | 1260 | + std::string candidate = prefix + std::to_string(min_suffix); |
| 1261 | if (names.count(candidate) == 0) { | 1261 | if (names.count(candidate) == 0) { |
| 1262 | return candidate; | 1262 | return candidate; |
| 1263 | } | 1263 | } |
| @@ -1554,8 +1554,8 @@ QPDFObjectHandle::arrayOrStreamToStreamArray( | @@ -1554,8 +1554,8 @@ QPDFObjectHandle::arrayOrStreamToStreamArray( | ||
| 1554 | QPDFExc( | 1554 | QPDFExc( |
| 1555 | qpdf_e_damaged_pdf, | 1555 | qpdf_e_damaged_pdf, |
| 1556 | "", | 1556 | "", |
| 1557 | - description + ": item index " + | ||
| 1558 | - QUtil::int_to_string(i) + " (from 0)", | 1557 | + description + ": item index " + std::to_string(i) + |
| 1558 | + " (from 0)", | ||
| 1559 | 0, | 1559 | 0, |
| 1560 | "ignoring non-stream in an array of streams")); | 1560 | "ignoring non-stream in an array of streams")); |
| 1561 | } | 1561 | } |
libqpdf/QPDFParser.cc
| @@ -335,8 +335,8 @@ QPDFParser::parse(bool& empty, bool content_stream) | @@ -335,8 +335,8 @@ QPDFParser::parse(bool& empty, bool content_stream) | ||
| 335 | bool found_fake = false; | 335 | bool found_fake = false; |
| 336 | std::string candidate; | 336 | std::string candidate; |
| 337 | while (!found_fake) { | 337 | while (!found_fake) { |
| 338 | - candidate = "/QPDFFake" + | ||
| 339 | - QUtil::int_to_string(next_fake_key++); | 338 | + candidate = |
| 339 | + "/QPDFFake" + std::to_string(next_fake_key++); | ||
| 340 | found_fake = (names.count(candidate) == 0); | 340 | found_fake = (names.count(candidate) == 0); |
| 341 | QTC::TC( | 341 | QTC::TC( |
| 342 | "qpdf", | 342 | "qpdf", |
| @@ -416,7 +416,7 @@ QPDFParser::setDescriptionFromInput( | @@ -416,7 +416,7 @@ QPDFParser::setDescriptionFromInput( | ||
| 416 | oh.setObjectDescription( | 416 | oh.setObjectDescription( |
| 417 | context, | 417 | context, |
| 418 | (input->getName() + ", " + object_description + " at offset " + | 418 | (input->getName() + ", " + object_description + " at offset " + |
| 419 | - QUtil::int_to_string(offset))); | 419 | + std::to_string(offset))); |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | void | 422 | void |
libqpdf/QPDFWriter.cc
| @@ -842,8 +842,7 @@ QPDFWriter::parseVersion( | @@ -842,8 +842,7 @@ QPDFWriter::parseVersion( | ||
| 842 | if ((p != std::string::npos) && (version.length() > p)) { | 842 | if ((p != std::string::npos) && (version.length() > p)) { |
| 843 | minor = QUtil::string_to_int(version.substr(p + 1).c_str()); | 843 | minor = QUtil::string_to_int(version.substr(p + 1).c_str()); |
| 844 | } | 844 | } |
| 845 | - std::string tmp = | ||
| 846 | - QUtil::int_to_string(major) + "." + QUtil::int_to_string(minor); | 845 | + std::string tmp = std::to_string(major) + "." + std::to_string(minor); |
| 847 | if (tmp != version) { | 846 | if (tmp != version) { |
| 848 | // The version number in the input is probably invalid. This | 847 | // The version number in the input is probably invalid. This |
| 849 | // happens with some files that are designed to exercise bugs, | 848 | // happens with some files that are designed to exercise bugs, |
| @@ -888,11 +887,10 @@ QPDFWriter::setEncryptionParametersInternal( | @@ -888,11 +887,10 @@ QPDFWriter::setEncryptionParametersInternal( | ||
| 888 | this->m->encryption_V = V; | 887 | this->m->encryption_V = V; |
| 889 | this->m->encryption_R = R; | 888 | this->m->encryption_R = R; |
| 890 | this->m->encryption_dictionary["/Filter"] = "/Standard"; | 889 | this->m->encryption_dictionary["/Filter"] = "/Standard"; |
| 891 | - this->m->encryption_dictionary["/V"] = QUtil::int_to_string(V); | ||
| 892 | - this->m->encryption_dictionary["/Length"] = | ||
| 893 | - QUtil::int_to_string(key_len * 8); | ||
| 894 | - this->m->encryption_dictionary["/R"] = QUtil::int_to_string(R); | ||
| 895 | - this->m->encryption_dictionary["/P"] = QUtil::int_to_string(P); | 890 | + this->m->encryption_dictionary["/V"] = std::to_string(V); |
| 891 | + this->m->encryption_dictionary["/Length"] = std::to_string(key_len * 8); | ||
| 892 | + this->m->encryption_dictionary["/R"] = std::to_string(R); | ||
| 893 | + this->m->encryption_dictionary["/P"] = std::to_string(P); | ||
| 896 | this->m->encryption_dictionary["/O"] = QPDF_String(O).unparse(true); | 894 | this->m->encryption_dictionary["/O"] = QPDF_String(O).unparse(true); |
| 897 | this->m->encryption_dictionary["/U"] = QPDF_String(U).unparse(true); | 895 | this->m->encryption_dictionary["/U"] = QPDF_String(U).unparse(true); |
| 898 | if (V >= 5) { | 896 | if (V >= 5) { |
| @@ -1037,8 +1035,7 @@ QPDFWriter::initializePipelineStack(Pipeline* p) | @@ -1037,8 +1035,7 @@ QPDFWriter::initializePipelineStack(Pipeline* p) | ||
| 1037 | void | 1035 | void |
| 1038 | QPDFWriter::activatePipelineStack(PipelinePopper& pp) | 1036 | QPDFWriter::activatePipelineStack(PipelinePopper& pp) |
| 1039 | { | 1037 | { |
| 1040 | - std::string stack_id( | ||
| 1041 | - "stack " + QUtil::uint_to_string(this->m->next_stack_id)); | 1038 | + std::string stack_id("stack " + std::to_string(this->m->next_stack_id)); |
| 1042 | Pl_Count* c = | 1039 | Pl_Count* c = |
| 1043 | new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back()); | 1040 | new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back()); |
| 1044 | ++this->m->next_stack_id; | 1041 | ++this->m->next_stack_id; |
| @@ -1161,7 +1158,7 @@ QPDFWriter::openObject(int objid) | @@ -1161,7 +1158,7 @@ QPDFWriter::openObject(int objid) | ||
| 1161 | objid = this->m->next_objid++; | 1158 | objid = this->m->next_objid++; |
| 1162 | } | 1159 | } |
| 1163 | this->m->xref[objid] = QPDFXRefEntry(1, this->m->pipeline->getCount(), 0); | 1160 | this->m->xref[objid] = QPDFXRefEntry(1, this->m->pipeline->getCount(), 0); |
| 1164 | - writeString(QUtil::int_to_string(objid)); | 1161 | + writeString(std::to_string(objid)); |
| 1165 | writeString(" 0 obj\n"); | 1162 | writeString(" 0 obj\n"); |
| 1166 | return objid; | 1163 | return objid; |
| 1167 | } | 1164 | } |
| @@ -1286,7 +1283,7 @@ QPDFWriter::unparseChild(QPDFObjectHandle child, int level, int flags) | @@ -1286,7 +1283,7 @@ QPDFWriter::unparseChild(QPDFObjectHandle child, int level, int flags) | ||
| 1286 | if (child.isIndirect()) { | 1283 | if (child.isIndirect()) { |
| 1287 | QPDFObjGen old_og = child.getObjGen(); | 1284 | QPDFObjGen old_og = child.getObjGen(); |
| 1288 | int new_id = this->m->obj_renumber[old_og]; | 1285 | int new_id = this->m->obj_renumber[old_og]; |
| 1289 | - writeString(QUtil::int_to_string(new_id)); | 1286 | + writeString(std::to_string(new_id)); |
| 1290 | writeString(" 0 R"); | 1287 | writeString(" 0 R"); |
| 1291 | } else { | 1288 | } else { |
| 1292 | unparseObject(child, level, flags); | 1289 | unparseObject(child, level, flags); |
| @@ -1310,7 +1307,7 @@ QPDFWriter::writeTrailer( | @@ -1310,7 +1307,7 @@ QPDFWriter::writeTrailer( | ||
| 1310 | writeStringQDF("\n"); | 1307 | writeStringQDF("\n"); |
| 1311 | if (which == t_lin_second) { | 1308 | if (which == t_lin_second) { |
| 1312 | writeString(" /Size "); | 1309 | writeString(" /Size "); |
| 1313 | - writeString(QUtil::int_to_string(size)); | 1310 | + writeString(std::to_string(size)); |
| 1314 | } else { | 1311 | } else { |
| 1315 | for (auto const& key: trailer.getKeys()) { | 1312 | for (auto const& key: trailer.getKeys()) { |
| 1316 | writeStringQDF(" "); | 1313 | writeStringQDF(" "); |
| @@ -1318,11 +1315,11 @@ QPDFWriter::writeTrailer( | @@ -1318,11 +1315,11 @@ QPDFWriter::writeTrailer( | ||
| 1318 | writeString(QPDF_Name::normalizeName(key)); | 1315 | writeString(QPDF_Name::normalizeName(key)); |
| 1319 | writeString(" "); | 1316 | writeString(" "); |
| 1320 | if (key == "/Size") { | 1317 | if (key == "/Size") { |
| 1321 | - writeString(QUtil::int_to_string(size)); | 1318 | + writeString(std::to_string(size)); |
| 1322 | if (which == t_lin_first) { | 1319 | if (which == t_lin_first) { |
| 1323 | writeString(" /Prev "); | 1320 | writeString(" /Prev "); |
| 1324 | qpdf_offset_t pos = this->m->pipeline->getCount(); | 1321 | qpdf_offset_t pos = this->m->pipeline->getCount(); |
| 1325 | - writeString(QUtil::int_to_string(prev)); | 1322 | + writeString(std::to_string(prev)); |
| 1326 | int nspaces = | 1323 | int nspaces = |
| 1327 | QIntC::to_int(pos - this->m->pipeline->getCount() + 21); | 1324 | QIntC::to_int(pos - this->m->pipeline->getCount() + 21); |
| 1328 | if (nspaces < 0) { | 1325 | if (nspaces < 0) { |
| @@ -1374,7 +1371,7 @@ QPDFWriter::writeTrailer( | @@ -1374,7 +1371,7 @@ QPDFWriter::writeTrailer( | ||
| 1374 | // Write reference to encryption dictionary | 1371 | // Write reference to encryption dictionary |
| 1375 | if (this->m->encrypted) { | 1372 | if (this->m->encrypted) { |
| 1376 | writeString(" /Encrypt "); | 1373 | writeString(" /Encrypt "); |
| 1377 | - writeString(QUtil::int_to_string(this->m->encryption_dict_objid)); | 1374 | + writeString(std::to_string(this->m->encryption_dict_objid)); |
| 1378 | writeString(" 0 R"); | 1375 | writeString(" 0 R"); |
| 1379 | } | 1376 | } |
| 1380 | } | 1377 | } |
| @@ -1607,8 +1604,7 @@ QPDFWriter::unparseObject( | @@ -1607,8 +1604,7 @@ QPDFWriter::unparseObject( | ||
| 1607 | QPDFObjectHandle::parse( | 1604 | QPDFObjectHandle::parse( |
| 1608 | "<< /BaseVersion /" + this->m->final_pdf_version + | 1605 | "<< /BaseVersion /" + this->m->final_pdf_version + |
| 1609 | " /ExtensionLevel " + | 1606 | " /ExtensionLevel " + |
| 1610 | - QUtil::int_to_string( | ||
| 1611 | - this->m->final_extension_level) + | 1607 | + std::to_string(this->m->final_extension_level) + |
| 1612 | " >>")); | 1608 | " >>")); |
| 1613 | } else { | 1609 | } else { |
| 1614 | QTC::TC("qpdf", "QPDFWriter remove ADBE"); | 1610 | QTC::TC("qpdf", "QPDFWriter remove ADBE"); |
| @@ -1697,10 +1693,9 @@ QPDFWriter::unparseObject( | @@ -1697,10 +1693,9 @@ QPDFWriter::unparseObject( | ||
| 1697 | writeString(" /Length "); | 1693 | writeString(" /Length "); |
| 1698 | 1694 | ||
| 1699 | if (this->m->direct_stream_lengths) { | 1695 | if (this->m->direct_stream_lengths) { |
| 1700 | - writeString(QUtil::uint_to_string(stream_length)); | 1696 | + writeString(std::to_string(stream_length)); |
| 1701 | } else { | 1697 | } else { |
| 1702 | - writeString( | ||
| 1703 | - QUtil::int_to_string(this->m->cur_stream_length_id)); | 1698 | + writeString(std::to_string(this->m->cur_stream_length_id)); |
| 1704 | writeString(" 0 R"); | 1699 | writeString(" 0 R"); |
| 1705 | } | 1700 | } |
| 1706 | writeStringQDF("\n"); | 1701 | writeStringQDF("\n"); |
| @@ -1808,9 +1803,9 @@ QPDFWriter::writeObjectStreamOffsets( | @@ -1808,9 +1803,9 @@ QPDFWriter::writeObjectStreamOffsets( | ||
| 1808 | writeStringQDF("\n"); | 1803 | writeStringQDF("\n"); |
| 1809 | writeStringNoQDF(" "); | 1804 | writeStringNoQDF(" "); |
| 1810 | } | 1805 | } |
| 1811 | - writeString(QUtil::uint_to_string(i + QIntC::to_size(first_obj))); | 1806 | + writeString(std::to_string(i + QIntC::to_size(first_obj))); |
| 1812 | writeString(" "); | 1807 | writeString(" "); |
| 1813 | - writeString(QUtil::int_to_string(offsets.at(i))); | 1808 | + writeString(std::to_string(offsets.at(i))); |
| 1814 | } | 1809 | } |
| 1815 | writeString("\n"); | 1810 | writeString("\n"); |
| 1816 | } | 1811 | } |
| @@ -1877,13 +1872,12 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | @@ -1877,13 +1872,12 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | ||
| 1877 | } | 1872 | } |
| 1878 | if (this->m->qdf_mode) { | 1873 | if (this->m->qdf_mode) { |
| 1879 | writeString( | 1874 | writeString( |
| 1880 | - "%% Object stream: object " + | ||
| 1881 | - QUtil::int_to_string(new_obj) + ", index " + | ||
| 1882 | - QUtil::int_to_string(count)); | 1875 | + "%% Object stream: object " + std::to_string(new_obj) + |
| 1876 | + ", index " + std::to_string(count)); | ||
| 1883 | if (!this->m->suppress_original_object_ids) { | 1877 | if (!this->m->suppress_original_object_ids) { |
| 1884 | writeString( | 1878 | writeString( |
| 1885 | "; original object ID: " + | 1879 | "; original object ID: " + |
| 1886 | - QUtil::int_to_string(obj.getObj())); | 1880 | + std::to_string(obj.getObj())); |
| 1887 | // For compatibility, only write the generation if | 1881 | // For compatibility, only write the generation if |
| 1888 | // non-zero. While object streams only allow | 1882 | // non-zero. While object streams only allow |
| 1889 | // objects with generation 0, if we are generating | 1883 | // objects with generation 0, if we are generating |
| @@ -1891,7 +1885,7 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | @@ -1891,7 +1885,7 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | ||
| 1891 | // non-zero generation. | 1885 | // non-zero generation. |
| 1892 | if (obj.getGen() != 0) { | 1886 | if (obj.getGen() != 0) { |
| 1893 | QTC::TC("qpdf", "QPDFWriter original obj non-zero gen"); | 1887 | QTC::TC("qpdf", "QPDFWriter original obj non-zero gen"); |
| 1894 | - writeString(" " + QUtil::int_to_string(obj.getGen())); | 1888 | + writeString(" " + std::to_string(obj.getGen())); |
| 1895 | } | 1889 | } |
| 1896 | } | 1890 | } |
| 1897 | writeString("\n"); | 1891 | writeString("\n"); |
| @@ -1928,14 +1922,14 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | @@ -1928,14 +1922,14 @@ QPDFWriter::writeObjectStream(QPDFObjectHandle object) | ||
| 1928 | writeStringQDF("\n "); | 1922 | writeStringQDF("\n "); |
| 1929 | size_t length = stream_buffer->getSize(); | 1923 | size_t length = stream_buffer->getSize(); |
| 1930 | adjustAESStreamLength(length); | 1924 | adjustAESStreamLength(length); |
| 1931 | - writeString(" /Length " + QUtil::uint_to_string(length)); | 1925 | + writeString(" /Length " + std::to_string(length)); |
| 1932 | writeStringQDF("\n "); | 1926 | writeStringQDF("\n "); |
| 1933 | if (compressed) { | 1927 | if (compressed) { |
| 1934 | writeString(" /Filter /FlateDecode"); | 1928 | writeString(" /Filter /FlateDecode"); |
| 1935 | } | 1929 | } |
| 1936 | - writeString(" /N " + QUtil::uint_to_string(offsets.size())); | 1930 | + writeString(" /N " + std::to_string(offsets.size())); |
| 1937 | writeStringQDF("\n "); | 1931 | writeStringQDF("\n "); |
| 1938 | - writeString(" /First " + QUtil::int_to_string(first)); | 1932 | + writeString(" /First " + std::to_string(first)); |
| 1939 | if (!object.isNull()) { | 1933 | if (!object.isNull()) { |
| 1940 | // If the original object has an /Extends key, preserve it. | 1934 | // If the original object has an /Extends key, preserve it. |
| 1941 | QPDFObjectHandle dict = object.getDict(); | 1935 | QPDFObjectHandle dict = object.getDict(); |
| @@ -1982,14 +1976,12 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) | @@ -1982,14 +1976,12 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) | ||
| 1982 | if (this->m->qdf_mode) { | 1976 | if (this->m->qdf_mode) { |
| 1983 | if (this->m->page_object_to_seq.count(old_og)) { | 1977 | if (this->m->page_object_to_seq.count(old_og)) { |
| 1984 | writeString("%% Page "); | 1978 | writeString("%% Page "); |
| 1985 | - writeString( | ||
| 1986 | - QUtil::int_to_string(this->m->page_object_to_seq[old_og])); | 1979 | + writeString(std::to_string(this->m->page_object_to_seq[old_og])); |
| 1987 | writeString("\n"); | 1980 | writeString("\n"); |
| 1988 | } | 1981 | } |
| 1989 | if (this->m->contents_to_page_seq.count(old_og)) { | 1982 | if (this->m->contents_to_page_seq.count(old_og)) { |
| 1990 | writeString("%% Contents for page "); | 1983 | writeString("%% Contents for page "); |
| 1991 | - writeString( | ||
| 1992 | - QUtil::int_to_string(this->m->contents_to_page_seq[old_og])); | 1984 | + writeString(std::to_string(this->m->contents_to_page_seq[old_og])); |
| 1993 | writeString("\n"); | 1985 | writeString("\n"); |
| 1994 | } | 1986 | } |
| 1995 | } | 1987 | } |
| @@ -2016,7 +2008,7 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) | @@ -2016,7 +2008,7 @@ QPDFWriter::writeObject(QPDFObjectHandle object, int object_stream_index) | ||
| 2016 | } | 2008 | } |
| 2017 | } | 2009 | } |
| 2018 | openObject(new_id + 1); | 2010 | openObject(new_id + 1); |
| 2019 | - writeString(QUtil::uint_to_string(this->m->cur_stream_length)); | 2011 | + writeString(std::to_string(this->m->cur_stream_length)); |
| 2020 | closeObject(new_id + 1); | 2012 | closeObject(new_id + 1); |
| 2021 | } | 2013 | } |
| 2022 | } | 2014 | } |
| @@ -2093,7 +2085,7 @@ QPDFWriter::generateID() | @@ -2093,7 +2085,7 @@ QPDFWriter::generateID() | ||
| 2093 | } | 2085 | } |
| 2094 | seed += this->m->deterministic_id_data; | 2086 | seed += this->m->deterministic_id_data; |
| 2095 | } else { | 2087 | } else { |
| 2096 | - seed += QUtil::int_to_string(QUtil::get_current_time()); | 2088 | + seed += std::to_string(QUtil::get_current_time()); |
| 2097 | seed += this->m->filename; | 2089 | seed += this->m->filename; |
| 2098 | seed += " "; | 2090 | seed += " "; |
| 2099 | } | 2091 | } |
| @@ -2562,14 +2554,14 @@ QPDFWriter::writeHintStream(int hint_id) | @@ -2562,14 +2554,14 @@ QPDFWriter::writeHintStream(int hint_id) | ||
| 2562 | size_t hlen = hint_buffer->getSize(); | 2554 | size_t hlen = hint_buffer->getSize(); |
| 2563 | 2555 | ||
| 2564 | writeString("<< /Filter /FlateDecode /S "); | 2556 | writeString("<< /Filter /FlateDecode /S "); |
| 2565 | - writeString(QUtil::int_to_string(S)); | 2557 | + writeString(std::to_string(S)); |
| 2566 | if (O) { | 2558 | if (O) { |
| 2567 | writeString(" /O "); | 2559 | writeString(" /O "); |
| 2568 | - writeString(QUtil::int_to_string(O)); | 2560 | + writeString(std::to_string(O)); |
| 2569 | } | 2561 | } |
| 2570 | writeString(" /Length "); | 2562 | writeString(" /Length "); |
| 2571 | adjustAESStreamLength(hlen); | 2563 | adjustAESStreamLength(hlen); |
| 2572 | - writeString(QUtil::uint_to_string(hlen)); | 2564 | + writeString(std::to_string(hlen)); |
| 2573 | writeString(" >>\nstream\n"); | 2565 | writeString(" >>\nstream\n"); |
| 2574 | 2566 | ||
| 2575 | if (this->m->encrypted) { | 2567 | if (this->m->encrypted) { |
| @@ -2613,9 +2605,9 @@ QPDFWriter::writeXRefTable( | @@ -2613,9 +2605,9 @@ QPDFWriter::writeXRefTable( | ||
| 2613 | int linearization_pass) | 2605 | int linearization_pass) |
| 2614 | { | 2606 | { |
| 2615 | writeString("xref\n"); | 2607 | writeString("xref\n"); |
| 2616 | - writeString(QUtil::int_to_string(first)); | 2608 | + writeString(std::to_string(first)); |
| 2617 | writeString(" "); | 2609 | writeString(" "); |
| 2618 | - writeString(QUtil::int_to_string(last - first + 1)); | 2610 | + writeString(std::to_string(last - first + 1)); |
| 2619 | qpdf_offset_t space_before_zero = this->m->pipeline->getCount(); | 2611 | qpdf_offset_t space_before_zero = this->m->pipeline->getCount(); |
| 2620 | writeString("\n"); | 2612 | writeString("\n"); |
| 2621 | for (int i = first; i <= last; ++i) { | 2613 | for (int i = first; i <= last; ++i) { |
| @@ -2762,23 +2754,23 @@ QPDFWriter::writeXRefStream( | @@ -2762,23 +2754,23 @@ QPDFWriter::writeXRefStream( | ||
| 2762 | writeStringQDF("\n "); | 2754 | writeStringQDF("\n "); |
| 2763 | writeString(" /Type /XRef"); | 2755 | writeString(" /Type /XRef"); |
| 2764 | writeStringQDF("\n "); | 2756 | writeStringQDF("\n "); |
| 2765 | - writeString(" /Length " + QUtil::uint_to_string(xref_data->getSize())); | 2757 | + writeString(" /Length " + std::to_string(xref_data->getSize())); |
| 2766 | if (compressed) { | 2758 | if (compressed) { |
| 2767 | writeStringQDF("\n "); | 2759 | writeStringQDF("\n "); |
| 2768 | writeString(" /Filter /FlateDecode"); | 2760 | writeString(" /Filter /FlateDecode"); |
| 2769 | writeStringQDF("\n "); | 2761 | writeStringQDF("\n "); |
| 2770 | writeString( | 2762 | writeString( |
| 2771 | - " /DecodeParms << /Columns " + QUtil::int_to_string(esize) + | 2763 | + " /DecodeParms << /Columns " + std::to_string(esize) + |
| 2772 | " /Predictor 12 >>"); | 2764 | " /Predictor 12 >>"); |
| 2773 | } | 2765 | } |
| 2774 | writeStringQDF("\n "); | 2766 | writeStringQDF("\n "); |
| 2775 | writeString( | 2767 | writeString( |
| 2776 | - " /W [ 1 " + QUtil::int_to_string(f1_size) + " " + | ||
| 2777 | - QUtil::int_to_string(f2_size) + " ]"); | 2768 | + " /W [ 1 " + std::to_string(f1_size) + " " + std::to_string(f2_size) + |
| 2769 | + " ]"); | ||
| 2778 | if (!((first == 0) && (last == size - 1))) { | 2770 | if (!((first == 0) && (last == size - 1))) { |
| 2779 | writeString( | 2771 | writeString( |
| 2780 | - " /Index [ " + QUtil::int_to_string(first) + " " + | ||
| 2781 | - QUtil::int_to_string(last - first + 1) + " ]"); | 2772 | + " /Index [ " + std::to_string(first) + " " + |
| 2773 | + std::to_string(last - first + 1) + " ]"); | ||
| 2782 | } | 2774 | } |
| 2783 | writeTrailer(which, size, true, prev, linearization_pass); | 2775 | writeTrailer(which, size, true, prev, linearization_pass); |
| 2784 | writeString("\nstream\n"); | 2776 | writeString("\nstream\n"); |
| @@ -3015,22 +3007,21 @@ QPDFWriter::writeLinearized() | @@ -3015,22 +3007,21 @@ QPDFWriter::writeLinearized() | ||
| 3015 | int npages = QIntC::to_int(pages.size()); | 3007 | int npages = QIntC::to_int(pages.size()); |
| 3016 | 3008 | ||
| 3017 | writeString(" /Linearized 1 /L "); | 3009 | writeString(" /Linearized 1 /L "); |
| 3018 | - writeString(QUtil::int_to_string(file_size + hint_length)); | 3010 | + writeString(std::to_string(file_size + hint_length)); |
| 3019 | // Implementation note 121 states that a space is | 3011 | // Implementation note 121 states that a space is |
| 3020 | // mandatory after this open bracket. | 3012 | // mandatory after this open bracket. |
| 3021 | writeString(" /H [ "); | 3013 | writeString(" /H [ "); |
| 3022 | - writeString( | ||
| 3023 | - QUtil::int_to_string(this->m->xref[hint_id].getOffset())); | 3014 | + writeString(std::to_string(this->m->xref[hint_id].getOffset())); |
| 3024 | writeString(" "); | 3015 | writeString(" "); |
| 3025 | - writeString(QUtil::int_to_string(hint_length)); | 3016 | + writeString(std::to_string(hint_length)); |
| 3026 | writeString(" ] /O "); | 3017 | writeString(" ] /O "); |
| 3027 | - writeString(QUtil::int_to_string(first_page_object)); | 3018 | + writeString(std::to_string(first_page_object)); |
| 3028 | writeString(" /E "); | 3019 | writeString(" /E "); |
| 3029 | - writeString(QUtil::int_to_string(part6_end_offset + hint_length)); | 3020 | + writeString(std::to_string(part6_end_offset + hint_length)); |
| 3030 | writeString(" /N "); | 3021 | writeString(" /N "); |
| 3031 | - writeString(QUtil::int_to_string(npages)); | 3022 | + writeString(std::to_string(npages)); |
| 3032 | writeString(" /T "); | 3023 | writeString(" /T "); |
| 3033 | - writeString(QUtil::int_to_string(space_before_zero + hint_length)); | 3024 | + writeString(std::to_string(space_before_zero + hint_length)); |
| 3034 | } | 3025 | } |
| 3035 | writeString(" >>"); | 3026 | writeString(" >>"); |
| 3036 | closeObject(lindict_id); | 3027 | closeObject(lindict_id); |
| @@ -3094,8 +3085,8 @@ QPDFWriter::writeLinearized() | @@ -3094,8 +3085,8 @@ QPDFWriter::writeLinearized() | ||
| 3094 | throw std::logic_error( | 3085 | throw std::logic_error( |
| 3095 | "insufficient padding for first pass xref stream; " | 3086 | "insufficient padding for first pass xref stream; " |
| 3096 | "first_xref_end=" + | 3087 | "first_xref_end=" + |
| 3097 | - QUtil::int_to_string(first_xref_end) + | ||
| 3098 | - "; endpos=" + QUtil::int_to_string(endpos)); | 3088 | + std::to_string(first_xref_end) + |
| 3089 | + "; endpos=" + std::to_string(endpos)); | ||
| 3099 | } | 3090 | } |
| 3100 | } | 3091 | } |
| 3101 | writeString("\n"); | 3092 | writeString("\n"); |
| @@ -3197,7 +3188,7 @@ QPDFWriter::writeLinearized() | @@ -3197,7 +3188,7 @@ QPDFWriter::writeLinearized() | ||
| 3197 | pass); | 3188 | pass); |
| 3198 | } | 3189 | } |
| 3199 | writeString("startxref\n"); | 3190 | writeString("startxref\n"); |
| 3200 | - writeString(QUtil::int_to_string(first_xref_offset)); | 3191 | + writeString(std::to_string(first_xref_offset)); |
| 3201 | writeString("\n%%EOF\n"); | 3192 | writeString("\n%%EOF\n"); |
| 3202 | 3193 | ||
| 3203 | discardGeneration(this->m->obj_renumber, this->m->obj_renumber_no_gen); | 3194 | discardGeneration(this->m->obj_renumber, this->m->obj_renumber_no_gen); |
| @@ -3237,19 +3228,19 @@ QPDFWriter::writeLinearized() | @@ -3237,19 +3228,19 @@ QPDFWriter::writeLinearized() | ||
| 3237 | fprintf( | 3228 | fprintf( |
| 3238 | lin_pass1_file, | 3229 | lin_pass1_file, |
| 3239 | "%% hint_offset=%s\n", | 3230 | "%% hint_offset=%s\n", |
| 3240 | - QUtil::int_to_string(hint_offset1).c_str()); | 3231 | + std::to_string(hint_offset1).c_str()); |
| 3241 | fprintf( | 3232 | fprintf( |
| 3242 | lin_pass1_file, | 3233 | lin_pass1_file, |
| 3243 | "%% hint_length=%s\n", | 3234 | "%% hint_length=%s\n", |
| 3244 | - QUtil::int_to_string(hint_length).c_str()); | 3235 | + std::to_string(hint_length).c_str()); |
| 3245 | fprintf( | 3236 | fprintf( |
| 3246 | lin_pass1_file, | 3237 | lin_pass1_file, |
| 3247 | "%% second_xref_offset=%s\n", | 3238 | "%% second_xref_offset=%s\n", |
| 3248 | - QUtil::int_to_string(second_xref_offset).c_str()); | 3239 | + std::to_string(second_xref_offset).c_str()); |
| 3249 | fprintf( | 3240 | fprintf( |
| 3250 | lin_pass1_file, | 3241 | lin_pass1_file, |
| 3251 | "%% second_xref_end=%s\n", | 3242 | "%% second_xref_end=%s\n", |
| 3252 | - QUtil::int_to_string(second_xref_end).c_str()); | 3243 | + std::to_string(second_xref_end).c_str()); |
| 3253 | fclose(lin_pass1_file); | 3244 | fclose(lin_pass1_file); |
| 3254 | lin_pass1_file = nullptr; | 3245 | lin_pass1_file = nullptr; |
| 3255 | } | 3246 | } |
| @@ -3399,7 +3390,7 @@ QPDFWriter::writeStandard() | @@ -3399,7 +3390,7 @@ QPDFWriter::writeStandard() | ||
| 3399 | this->m->next_objid); | 3390 | this->m->next_objid); |
| 3400 | } | 3391 | } |
| 3401 | writeString("startxref\n"); | 3392 | writeString("startxref\n"); |
| 3402 | - writeString(QUtil::int_to_string(xref_offset)); | 3393 | + writeString(std::to_string(xref_offset)); |
| 3403 | writeString("\n%%EOF\n"); | 3394 | writeString("\n%%EOF\n"); |
| 3404 | 3395 | ||
| 3405 | if (this->m->deterministic_id) { | 3396 | if (this->m->deterministic_id) { |
libqpdf/QPDFXRefEntry.cc
| @@ -17,8 +17,7 @@ QPDFXRefEntry::QPDFXRefEntry(int type, qpdf_offset_t field1, int field2) : | @@ -17,8 +17,7 @@ QPDFXRefEntry::QPDFXRefEntry(int type, qpdf_offset_t field1, int field2) : | ||
| 17 | field2(field2) | 17 | field2(field2) |
| 18 | { | 18 | { |
| 19 | if ((type < 1) || (type > 2)) { | 19 | if ((type < 1) || (type > 2)) { |
| 20 | - throw std::logic_error( | ||
| 21 | - "invalid xref type " + QUtil::int_to_string(type)); | 20 | + throw std::logic_error("invalid xref type " + std::to_string(type)); |
| 22 | } | 21 | } |
| 23 | } | 22 | } |
| 24 | 23 |
libqpdf/QPDF_Integer.cc
| @@ -23,7 +23,7 @@ QPDF_Integer::shallowCopy() | @@ -23,7 +23,7 @@ QPDF_Integer::shallowCopy() | ||
| 23 | std::string | 23 | std::string |
| 24 | QPDF_Integer::unparse() | 24 | QPDF_Integer::unparse() |
| 25 | { | 25 | { |
| 26 | - return QUtil::int_to_string(this->val); | 26 | + return std::to_string(this->val); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | JSON | 29 | JSON |
libqpdf/QPDF_Stream.cc
| @@ -618,9 +618,9 @@ QPDF_Stream::pipeStreamData( | @@ -618,9 +618,9 @@ QPDF_Stream::pipeStreamData( | ||
| 618 | // part of a library user, not by invalid input data. | 618 | // part of a library user, not by invalid input data. |
| 619 | throw std::runtime_error( | 619 | throw std::runtime_error( |
| 620 | "stream data provider for " + og.unparse(' ') + | 620 | "stream data provider for " + og.unparse(' ') + |
| 621 | - " provided " + QUtil::int_to_string(actual_length) + | 621 | + " provided " + std::to_string(actual_length) + |
| 622 | " bytes instead of expected " + | 622 | " bytes instead of expected " + |
| 623 | - QUtil::int_to_string(desired_length) + " bytes"); | 623 | + std::to_string(desired_length) + " bytes"); |
| 624 | } | 624 | } |
| 625 | } else if (success) { | 625 | } else if (success) { |
| 626 | QTC::TC("qpdf", "QPDF_Stream provider length not provided"); | 626 | QTC::TC("qpdf", "QPDF_Stream provider length not provided"); |
libqpdf/QPDF_encryption.cc
| @@ -869,8 +869,8 @@ QPDF::initializeEncryption() | @@ -869,8 +869,8 @@ QPDF::initializeEncryption() | ||
| 869 | "encryption dictionary", | 869 | "encryption dictionary", |
| 870 | this->m->file->getLastOffset(), | 870 | this->m->file->getLastOffset(), |
| 871 | "Unsupported /R or /V in encryption dictionary; R = " + | 871 | "Unsupported /R or /V in encryption dictionary; R = " + |
| 872 | - QUtil::int_to_string(R) + | ||
| 873 | - " (max 6), V = " + QUtil::int_to_string(V) + " (max 5)"); | 872 | + std::to_string(R) + " (max 6), V = " + std::to_string(V) + |
| 873 | + " (max 5)"); | ||
| 874 | } | 874 | } |
| 875 | 875 | ||
| 876 | this->m->encp->encryption_V = V; | 876 | this->m->encp->encryption_V = V; |
libqpdf/QPDF_json.cc
| @@ -641,7 +641,7 @@ QPDF::JSONReactor::dictionaryItem(std::string const& key, JSON const& value) | @@ -641,7 +641,7 @@ QPDF::JSONReactor::dictionaryItem(std::string const& key, JSON const& value) | ||
| 641 | } | 641 | } |
| 642 | } else { | 642 | } else { |
| 643 | throw std::logic_error( | 643 | throw std::logic_error( |
| 644 | - "QPDF_json: unknown state " + QUtil::int_to_string(state)); | 644 | + "QPDF_json: unknown state " + std::to_string(state)); |
| 645 | } | 645 | } |
| 646 | return true; | 646 | return true; |
| 647 | } | 647 | } |
| @@ -679,7 +679,7 @@ QPDF::JSONReactor::setObjectDescription(QPDFObjectHandle& oh, JSON const& value) | @@ -679,7 +679,7 @@ QPDF::JSONReactor::setObjectDescription(QPDFObjectHandle& oh, JSON const& value) | ||
| 679 | if (!this->cur_object.empty()) { | 679 | if (!this->cur_object.empty()) { |
| 680 | description += ", " + this->cur_object; | 680 | description += ", " + this->cur_object; |
| 681 | } | 681 | } |
| 682 | - description += " at offset " + QUtil::int_to_string(value.getStart()); | 682 | + description += " at offset " + std::to_string(value.getStart()); |
| 683 | oh.setObjectDescription(&this->pdf, description); | 683 | oh.setObjectDescription(&this->pdf, description); |
| 684 | } | 684 | } |
| 685 | 685 | ||
| @@ -790,7 +790,7 @@ QPDF::writeJSONStream( | @@ -790,7 +790,7 @@ QPDF::writeJSONStream( | ||
| 790 | std::shared_ptr<Pl_StdioFile> f_pl; | 790 | std::shared_ptr<Pl_StdioFile> f_pl; |
| 791 | std::string filename; | 791 | std::string filename; |
| 792 | if (json_stream_data == qpdf_sj_file) { | 792 | if (json_stream_data == qpdf_sj_file) { |
| 793 | - filename = file_prefix + "-" + QUtil::int_to_string(obj.getObjectID()); | 793 | + filename = file_prefix + "-" + std::to_string(obj.getObjectID()); |
| 794 | f = QUtil::safe_fopen(filename.c_str(), "wb"); | 794 | f = QUtil::safe_fopen(filename.c_str(), "wb"); |
| 795 | f_pl = std::make_shared<Pl_StdioFile>("stream data", f); | 795 | f_pl = std::make_shared<Pl_StdioFile>("stream data", f); |
| 796 | stream_p = f_pl.get(); | 796 | stream_p = f_pl.get(); |
libqpdf/QPDF_linearization.cc
| @@ -534,7 +534,7 @@ QPDF::checkLinearizationInternal() | @@ -534,7 +534,7 @@ QPDF::checkLinearizationInternal() | ||
| 534 | QPDFObjGen og(page.getObjGen()); | 534 | QPDFObjGen og(page.getObjGen()); |
| 535 | if (this->m->xref_table[og].getType() == 2) { | 535 | if (this->m->xref_table[og].getType() == 2) { |
| 536 | errors.push_back( | 536 | errors.push_back( |
| 537 | - "page dictionary for page " + QUtil::uint_to_string(i) + | 537 | + "page dictionary for page " + std::to_string(i) + |
| 538 | " is compressed"); | 538 | " is compressed"); |
| 539 | } | 539 | } |
| 540 | } | 540 | } |
| @@ -554,8 +554,8 @@ QPDF::checkLinearizationInternal() | @@ -554,8 +554,8 @@ QPDF::checkLinearizationInternal() | ||
| 554 | errors.push_back( | 554 | errors.push_back( |
| 555 | "space before first xref item (/T) mismatch " | 555 | "space before first xref item (/T) mismatch " |
| 556 | "(computed = " + | 556 | "(computed = " + |
| 557 | - QUtil::int_to_string(this->m->first_xref_item_offset) + | ||
| 558 | - "; file = " + QUtil::int_to_string(this->m->file->tell())); | 557 | + std::to_string(this->m->first_xref_item_offset) + |
| 558 | + "; file = " + std::to_string(this->m->file->tell())); | ||
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | // P: first page number -- Implementation note 124 says Acrobat | 561 | // P: first page number -- Implementation note 124 says Acrobat |
| @@ -619,8 +619,8 @@ QPDF::checkLinearizationInternal() | @@ -619,8 +619,8 @@ QPDF::checkLinearizationInternal() | ||
| 619 | QTC::TC("qpdf", "QPDF warn /E mismatch"); | 619 | QTC::TC("qpdf", "QPDF warn /E mismatch"); |
| 620 | warnings.push_back( | 620 | warnings.push_back( |
| 621 | "end of first page section (/E) mismatch: /E = " + | 621 | "end of first page section (/E) mismatch: /E = " + |
| 622 | - QUtil::int_to_string(p.first_page_end) + "; computed = " + | ||
| 623 | - QUtil::int_to_string(min_E) + ".." + QUtil::int_to_string(max_E)); | 622 | + std::to_string(p.first_page_end) + "; computed = " + |
| 623 | + std::to_string(min_E) + ".." + std::to_string(max_E)); | ||
| 624 | } | 624 | } |
| 625 | 625 | ||
| 626 | // Check hint tables | 626 | // Check hint tables |
| @@ -717,8 +717,8 @@ QPDF::lengthNextN(int first_object, int n, std::list<std::string>& errors) | @@ -717,8 +717,8 @@ QPDF::lengthNextN(int first_object, int n, std::list<std::string>& errors) | ||
| 717 | QPDFObjGen og(first_object + i, 0); | 717 | QPDFObjGen og(first_object + i, 0); |
| 718 | if (this->m->xref_table.count(og) == 0) { | 718 | if (this->m->xref_table.count(og) == 0) { |
| 719 | errors.push_back( | 719 | errors.push_back( |
| 720 | - "no xref table entry for " + | ||
| 721 | - QUtil::int_to_string(first_object + i) + " 0"); | 720 | + "no xref table entry for " + std::to_string(first_object + i) + |
| 721 | + " 0"); | ||
| 722 | } else { | 722 | } else { |
| 723 | if (this->m->obj_cache.count(og) == 0) { | 723 | if (this->m->obj_cache.count(og) == 0) { |
| 724 | stopOnError("found unknown object while" | 724 | stopOnError("found unknown object while" |
| @@ -785,10 +785,9 @@ QPDF::checkHPageOffset( | @@ -785,10 +785,9 @@ QPDF::checkHPageOffset( | ||
| 785 | if (h_nobjects != ce.nobjects) { | 785 | if (h_nobjects != ce.nobjects) { |
| 786 | // This happens with pdlin when there are thumbnails. | 786 | // This happens with pdlin when there are thumbnails. |
| 787 | warnings.push_back( | 787 | warnings.push_back( |
| 788 | - "object count mismatch for page " + | ||
| 789 | - QUtil::int_to_string(pageno) + | ||
| 790 | - ": hint table = " + QUtil::int_to_string(h_nobjects) + | ||
| 791 | - "; computed = " + QUtil::int_to_string(ce.nobjects)); | 788 | + "object count mismatch for page " + std::to_string(pageno) + |
| 789 | + ": hint table = " + std::to_string(h_nobjects) + | ||
| 790 | + "; computed = " + std::to_string(ce.nobjects)); | ||
| 792 | } | 791 | } |
| 793 | 792 | ||
| 794 | // Use value for number of objects in hint table rather than | 793 | // Use value for number of objects in hint table rather than |
| @@ -800,11 +799,10 @@ QPDF::checkHPageOffset( | @@ -800,11 +799,10 @@ QPDF::checkHPageOffset( | ||
| 800 | // This condition almost certainly indicates a bad hint | 799 | // This condition almost certainly indicates a bad hint |
| 801 | // table or a bug in this code. | 800 | // table or a bug in this code. |
| 802 | errors.push_back( | 801 | errors.push_back( |
| 803 | - "page length mismatch for page " + | ||
| 804 | - QUtil::int_to_string(pageno) + | ||
| 805 | - ": hint table = " + QUtil::int_to_string(h_length) + | ||
| 806 | - "; computed length = " + QUtil::int_to_string(length) + | ||
| 807 | - " (offset = " + QUtil::int_to_string(offset) + ")"); | 802 | + "page length mismatch for page " + std::to_string(pageno) + |
| 803 | + ": hint table = " + std::to_string(h_length) + | ||
| 804 | + "; computed length = " + std::to_string(length) + | ||
| 805 | + " (offset = " + std::to_string(offset) + ")"); | ||
| 808 | } | 806 | } |
| 809 | 807 | ||
| 810 | offset += h_length; | 808 | offset += h_length; |
| @@ -841,8 +839,8 @@ QPDF::checkHPageOffset( | @@ -841,8 +839,8 @@ QPDF::checkHPageOffset( | ||
| 841 | if (!computed_shared.count(iter)) { | 839 | if (!computed_shared.count(iter)) { |
| 842 | // pdlin puts thumbnails here even though it shouldn't | 840 | // pdlin puts thumbnails here even though it shouldn't |
| 843 | warnings.push_back( | 841 | warnings.push_back( |
| 844 | - "page " + QUtil::int_to_string(pageno) + | ||
| 845 | - ": shared object " + QUtil::int_to_string(iter) + | 842 | + "page " + std::to_string(pageno) + ": shared object " + |
| 843 | + std::to_string(iter) + | ||
| 846 | ": in hint table but not computed list"); | 844 | ": in hint table but not computed list"); |
| 847 | } | 845 | } |
| 848 | } | 846 | } |
| @@ -853,8 +851,8 @@ QPDF::checkHPageOffset( | @@ -853,8 +851,8 @@ QPDF::checkHPageOffset( | ||
| 853 | // built-in fonts and procsets here, at least in some | 851 | // built-in fonts and procsets here, at least in some |
| 854 | // cases. | 852 | // cases. |
| 855 | warnings.push_back( | 853 | warnings.push_back( |
| 856 | - "page " + QUtil::int_to_string(pageno) + | ||
| 857 | - ": shared object " + QUtil::int_to_string(iter) + | 854 | + "page " + std::to_string(pageno) + ": shared object " + |
| 855 | + std::to_string(iter) + | ||
| 858 | ": in computed list but not hint table"); | 856 | ": in computed list but not hint table"); |
| 859 | } | 857 | } |
| 860 | } | 858 | } |
| @@ -906,8 +904,8 @@ QPDF::checkHSharedObject( | @@ -906,8 +904,8 @@ QPDF::checkHSharedObject( | ||
| 906 | errors.push_back( | 904 | errors.push_back( |
| 907 | "first shared object number mismatch: " | 905 | "first shared object number mismatch: " |
| 908 | "hint table = " + | 906 | "hint table = " + |
| 909 | - QUtil::int_to_string(so.first_shared_obj) + | ||
| 910 | - "; computed = " + QUtil::int_to_string(obj)); | 907 | + std::to_string(so.first_shared_obj) + |
| 908 | + "; computed = " + std::to_string(obj)); | ||
| 911 | } | 909 | } |
| 912 | } | 910 | } |
| 913 | 911 | ||
| @@ -923,8 +921,8 @@ QPDF::checkHSharedObject( | @@ -923,8 +921,8 @@ QPDF::checkHSharedObject( | ||
| 923 | if (offset != h_offset) { | 921 | if (offset != h_offset) { |
| 924 | errors.push_back( | 922 | errors.push_back( |
| 925 | "first shared object offset mismatch: hint table = " + | 923 | "first shared object offset mismatch: hint table = " + |
| 926 | - QUtil::int_to_string(h_offset) + | ||
| 927 | - "; computed = " + QUtil::int_to_string(offset)); | 924 | + std::to_string(h_offset) + |
| 925 | + "; computed = " + std::to_string(offset)); | ||
| 928 | } | 926 | } |
| 929 | } | 927 | } |
| 930 | 928 | ||
| @@ -935,10 +933,10 @@ QPDF::checkHSharedObject( | @@ -935,10 +933,10 @@ QPDF::checkHSharedObject( | ||
| 935 | int h_length = so.min_group_length + se.delta_group_length; | 933 | int h_length = so.min_group_length + se.delta_group_length; |
| 936 | if (length != h_length) { | 934 | if (length != h_length) { |
| 937 | errors.push_back( | 935 | errors.push_back( |
| 938 | - "shared object " + QUtil::int_to_string(i) + | 936 | + "shared object " + std::to_string(i) + |
| 939 | " length mismatch: hint table = " + | 937 | " length mismatch: hint table = " + |
| 940 | - QUtil::int_to_string(h_length) + | ||
| 941 | - "; computed = " + QUtil::int_to_string(length)); | 938 | + std::to_string(h_length) + |
| 939 | + "; computed = " + std::to_string(length)); | ||
| 942 | } | 940 | } |
| 943 | cur_object += nobjects; | 941 | cur_object += nobjects; |
| 944 | } | 942 | } |
| @@ -985,15 +983,15 @@ QPDF::checkHOutlines(std::list<std::string>& warnings) | @@ -985,15 +983,15 @@ QPDF::checkHOutlines(std::list<std::string>& warnings) | ||
| 985 | if (offset != table_offset) { | 983 | if (offset != table_offset) { |
| 986 | warnings.push_back( | 984 | warnings.push_back( |
| 987 | "incorrect offset in outlines table: hint table = " + | 985 | "incorrect offset in outlines table: hint table = " + |
| 988 | - QUtil::int_to_string(table_offset) + | ||
| 989 | - "; computed = " + QUtil::int_to_string(offset)); | 986 | + std::to_string(table_offset) + |
| 987 | + "; computed = " + std::to_string(offset)); | ||
| 990 | } | 988 | } |
| 991 | int table_length = this->m->outline_hints.group_length; | 989 | int table_length = this->m->outline_hints.group_length; |
| 992 | if (length != table_length) { | 990 | if (length != table_length) { |
| 993 | warnings.push_back( | 991 | warnings.push_back( |
| 994 | "incorrect length in outlines table: hint table = " + | 992 | "incorrect length in outlines table: hint table = " + |
| 995 | - QUtil::int_to_string(table_length) + | ||
| 996 | - "; computed = " + QUtil::int_to_string(length)); | 993 | + std::to_string(table_length) + |
| 994 | + "; computed = " + std::to_string(length)); | ||
| 997 | } | 995 | } |
| 998 | } else { | 996 | } else { |
| 999 | warnings.push_back("incorrect first object number in outline " | 997 | warnings.push_back("incorrect first object number in outline " |
| @@ -1443,7 +1441,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) | @@ -1443,7 +1441,7 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) | ||
| 1443 | stopOnError( | 1441 | stopOnError( |
| 1444 | "INTERNAL ERROR: " | 1442 | "INTERNAL ERROR: " |
| 1445 | "QPDF::calculateLinearizationData: page object for page " + | 1443 | "QPDF::calculateLinearizationData: page object for page " + |
| 1446 | - QUtil::uint_to_string(i) + " not in lc_other_page_private"); | 1444 | + std::to_string(i) + " not in lc_other_page_private"); |
| 1447 | } | 1445 | } |
| 1448 | lc_other_page_private.erase(page_og); | 1446 | lc_other_page_private.erase(page_og); |
| 1449 | this->m->part7.push_back(pages.at(i)); | 1447 | this->m->part7.push_back(pages.at(i)); |
| @@ -1565,8 +1563,8 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) | @@ -1565,8 +1563,8 @@ QPDF::calculateLinearizationData(std::map<int, int> const& object_stream_data) | ||
| 1565 | stopOnError( | 1563 | stopOnError( |
| 1566 | "INTERNAL ERROR: QPDF::calculateLinearizationData: wrong " | 1564 | "INTERNAL ERROR: QPDF::calculateLinearizationData: wrong " |
| 1567 | "number of objects placed (num_placed = " + | 1565 | "number of objects placed (num_placed = " + |
| 1568 | - QUtil::uint_to_string(num_placed) + | ||
| 1569 | - "; number of objects: " + QUtil::uint_to_string(num_wanted)); | 1566 | + std::to_string(num_placed) + |
| 1567 | + "; number of objects: " + std::to_string(num_wanted)); | ||
| 1570 | } | 1568 | } |
| 1571 | 1569 | ||
| 1572 | // Calculate shared object hint table information including | 1570 | // Calculate shared object hint table information including |
libqpdf/QPDF_pages.cc
| @@ -121,7 +121,7 @@ QPDF::getAllPagesInternal( | @@ -121,7 +121,7 @@ QPDF::getAllPagesInternal( | ||
| 121 | if (!kid.isIndirect()) { | 121 | if (!kid.isIndirect()) { |
| 122 | QTC::TC("qpdf", "QPDF handle direct page object"); | 122 | QTC::TC("qpdf", "QPDF handle direct page object"); |
| 123 | cur_node.warnIfPossible( | 123 | cur_node.warnIfPossible( |
| 124 | - "kid " + QUtil::int_to_string(i) + | 124 | + "kid " + std::to_string(i) + |
| 125 | " (from 0) is direct; converting to indirect"); | 125 | " (from 0) is direct; converting to indirect"); |
| 126 | kid = makeIndirectObject(kid); | 126 | kid = makeIndirectObject(kid); |
| 127 | kids.setArrayItem(i, kid); | 127 | kids.setArrayItem(i, kid); |
| @@ -130,7 +130,7 @@ QPDF::getAllPagesInternal( | @@ -130,7 +130,7 @@ QPDF::getAllPagesInternal( | ||
| 130 | // shallowCopyPage in QPDFPageObjectHelper. | 130 | // shallowCopyPage in QPDFPageObjectHelper. |
| 131 | QTC::TC("qpdf", "QPDF resolve duplicated page object"); | 131 | QTC::TC("qpdf", "QPDF resolve duplicated page object"); |
| 132 | cur_node.warnIfPossible( | 132 | cur_node.warnIfPossible( |
| 133 | - "kid " + QUtil::int_to_string(i) + | 133 | + "kid " + std::to_string(i) + |
| 134 | " (from 0) appears more than once in the pages tree;" | 134 | " (from 0) appears more than once in the pages tree;" |
| 135 | " creating a new page object as a copy"); | 135 | " creating a new page object as a copy"); |
| 136 | kid = makeIndirectObject(QPDFObjectHandle(kid).shallowCopy()); | 136 | kid = makeIndirectObject(QPDFObjectHandle(kid).shallowCopy()); |
| @@ -205,8 +205,7 @@ QPDF::insertPageobjToPage( | @@ -205,8 +205,7 @@ QPDF::insertPageobjToPage( | ||
| 205 | // The library never calls insertPageobjToPage in a way | 205 | // The library never calls insertPageobjToPage in a way |
| 206 | // that causes this to happen. | 206 | // that causes this to happen. |
| 207 | setLastObjectDescription( | 207 | setLastObjectDescription( |
| 208 | - "page " + QUtil::int_to_string(pos) + " (numbered from zero)", | ||
| 209 | - og); | 208 | + "page " + std::to_string(pos) + " (numbered from zero)", og); |
| 210 | throw QPDFExc( | 209 | throw QPDFExc( |
| 211 | qpdf_e_pages, | 210 | qpdf_e_pages, |
| 212 | this->m->file->getName(), | 211 | this->m->file->getName(), |
libqpdf/SecureRandomDataProvider.cc
| @@ -107,7 +107,7 @@ SecureRandomDataProvider::provideRandomData(unsigned char* data, size_t len) | @@ -107,7 +107,7 @@ SecureRandomDataProvider::provideRandomData(unsigned char* data, size_t len) | ||
| 107 | fclose(f); | 107 | fclose(f); |
| 108 | if (fr != len) { | 108 | if (fr != len) { |
| 109 | throw std::runtime_error( | 109 | throw std::runtime_error( |
| 110 | - "unable to read " + QUtil::uint_to_string(len) + " bytes from " + | 110 | + "unable to read " + std::to_string(len) + " bytes from " + |
| 111 | std::string(RANDOM_DEVICE)); | 111 | std::string(RANDOM_DEVICE)); |
| 112 | } | 112 | } |
| 113 | 113 |
libqpdf/qpdf-c.cc
| @@ -994,7 +994,7 @@ do_with_oh( | @@ -994,7 +994,7 @@ do_with_oh( | ||
| 994 | throw QPDFExc( | 994 | throw QPDFExc( |
| 995 | qpdf_e_internal, | 995 | qpdf_e_internal, |
| 996 | q->qpdf->getFilename(), | 996 | q->qpdf->getFilename(), |
| 997 | - std::string("C API object handle ") + QUtil::uint_to_string(oh), | 997 | + std::string("C API object handle ") + std::to_string(oh), |
| 998 | 0, | 998 | 0, |
| 999 | "attempted access to unknown object handle"); | 999 | "attempted access to unknown object handle"); |
| 1000 | } | 1000 | } |
libqpdf/qpdf/bits_functions.hh
| @@ -33,8 +33,8 @@ read_bits( | @@ -33,8 +33,8 @@ read_bits( | ||
| 33 | if (bits_wanted > bits_available) { | 33 | if (bits_wanted > bits_available) { |
| 34 | throw std::runtime_error( | 34 | throw std::runtime_error( |
| 35 | "overflow reading bit stream: wanted = " + | 35 | "overflow reading bit stream: wanted = " + |
| 36 | - QUtil::uint_to_string(bits_wanted) + | ||
| 37 | - "; available = " + QUtil::uint_to_string(bits_available)); | 36 | + std::to_string(bits_wanted) + |
| 37 | + "; available = " + std::to_string(bits_available)); | ||
| 38 | } | 38 | } |
| 39 | if (bits_wanted > 32) { | 39 | if (bits_wanted > 32) { |
| 40 | throw std::out_of_range("read_bits: too many bits requested"); | 40 | throw std::out_of_range("read_bits: too many bits requested"); |
libtests/arg_parser.cc
| @@ -141,7 +141,7 @@ ArgParser::getQuack(std::string const& p) | @@ -141,7 +141,7 @@ ArgParser::getQuack(std::string const& p) | ||
| 141 | ++this->quacks; | 141 | ++this->quacks; |
| 142 | if (this->ap.isCompleting() && (this->ap.argsLeft() == 0)) { | 142 | if (this->ap.isCompleting() && (this->ap.argsLeft() == 0)) { |
| 143 | this->ap.insertCompletion( | 143 | this->ap.insertCompletion( |
| 144 | - std::string("thing-") + QUtil::int_to_string(this->quacks)); | 144 | + std::string("thing-") + std::to_string(this->quacks)); |
| 145 | return; | 145 | return; |
| 146 | } | 146 | } |
| 147 | output(std::string("got quack: ") + p); | 147 | output(std::string("got quack: ") + p); |
| @@ -150,13 +150,13 @@ ArgParser::getQuack(std::string const& p) | @@ -150,13 +150,13 @@ ArgParser::getQuack(std::string const& p) | ||
| 150 | void | 150 | void |
| 151 | ArgParser::endQuack() | 151 | ArgParser::endQuack() |
| 152 | { | 152 | { |
| 153 | - output("total quacks so far: " + QUtil::int_to_string(this->quacks)); | 153 | + output("total quacks so far: " + std::to_string(this->quacks)); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | void | 156 | void |
| 157 | ArgParser::finalChecks() | 157 | ArgParser::finalChecks() |
| 158 | { | 158 | { |
| 159 | - output("total quacks: " + QUtil::int_to_string(this->quacks)); | 159 | + output("total quacks: " + std::to_string(this->quacks)); |
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | void | 162 | void |
libtests/nntree.cc
| @@ -28,13 +28,12 @@ report(QPDF& q, QPDFObjectHandle oh, long long item, long long exp_item) | @@ -28,13 +28,12 @@ report(QPDF& q, QPDFObjectHandle oh, long long item, long long exp_item) | ||
| 28 | auto mk_wanted = [](long long i) { | 28 | auto mk_wanted = [](long long i) { |
| 29 | return ( | 29 | return ( |
| 30 | (i == -1) ? "end" | 30 | (i == -1) ? "end" |
| 31 | - : (QUtil::int_to_string(i) + "/(-" + | ||
| 32 | - QUtil::int_to_string(i) + "-)")); | 31 | + : (std::to_string(i) + "/(-" + std::to_string(i) + "-)")); |
| 33 | }; | 32 | }; |
| 34 | std::string i1_wanted = mk_wanted(exp_item); | 33 | std::string i1_wanted = mk_wanted(exp_item); |
| 35 | std::string i2_wanted = mk_wanted(item == exp_item ? item : -1); | 34 | std::string i2_wanted = mk_wanted(item == exp_item ? item : -1); |
| 36 | auto mk_actual = [](bool found, long long v, QPDFObjectHandle& o) { | 35 | auto mk_actual = [](bool found, long long v, QPDFObjectHandle& o) { |
| 37 | - return (found ? QUtil::int_to_string(v) + "/" + o.unparse() : "end"); | 36 | + return (found ? std::to_string(v) + "/" + o.unparse() : "end"); |
| 38 | }; | 37 | }; |
| 39 | std::string i1_actual = mk_actual(f1, item - offset, o1); | 38 | std::string i1_actual = mk_actual(f1, item - offset, o1); |
| 40 | std::string i2_actual = mk_actual(f2, item, o2); | 39 | std::string i2_actual = mk_actual(f2, item, o2); |
| @@ -63,8 +62,8 @@ test_bsearch() | @@ -63,8 +62,8 @@ test_bsearch() | ||
| 63 | auto nums = QPDFObjectHandle::newArray(); | 62 | auto nums = QPDFObjectHandle::newArray(); |
| 64 | for (auto i: v) { | 63 | for (auto i: v) { |
| 65 | nums.appendItem(QPDFObjectHandle::newInteger(i)); | 64 | nums.appendItem(QPDFObjectHandle::newInteger(i)); |
| 66 | - nums.appendItem(QPDFObjectHandle::newString( | ||
| 67 | - "-" + QUtil::int_to_string(i) + "-")); | 65 | + nums.appendItem( |
| 66 | + QPDFObjectHandle::newString("-" + std::to_string(i) + "-")); | ||
| 68 | } | 67 | } |
| 69 | auto limits = QPDFObjectHandle::newArray(); | 68 | auto limits = QPDFObjectHandle::newArray(); |
| 70 | limits.appendItem(QPDFObjectHandle::newInteger(v.at(0))); | 69 | limits.appendItem(QPDFObjectHandle::newInteger(v.at(0))); |
qpdf/fix-qdf.cc
| @@ -256,11 +256,10 @@ QdfFixer::processLines(std::list<std::string>& lines) | @@ -256,11 +256,10 @@ QdfFixer::processLines(std::list<std::string>& lines) | ||
| 256 | } else if (state == st_in_length) { | 256 | } else if (state == st_in_length) { |
| 257 | if (!matches(re_num)) { | 257 | if (!matches(re_num)) { |
| 258 | fatal( | 258 | fatal( |
| 259 | - filename + ":" + QUtil::uint_to_string(lineno) + | 259 | + filename + ":" + std::to_string(lineno) + |
| 260 | ": expected integer"); | 260 | ": expected integer"); |
| 261 | } | 261 | } |
| 262 | - std::string new_length = | ||
| 263 | - QUtil::uint_to_string(stream_length) + "\n"; | 262 | + std::string new_length = std::to_string(stream_length) + "\n"; |
| 264 | offset -= QIntC::to_offset(line.length()); | 263 | offset -= QIntC::to_offset(line.length()); |
| 265 | offset += QIntC::to_offset(new_length.length()); | 264 | offset += QIntC::to_offset(new_length.length()); |
| 266 | std::cout << new_length; | 265 | std::cout << new_length; |
| @@ -301,8 +300,8 @@ QdfFixer::checkObjId(std::string const& cur_obj_str) | @@ -301,8 +300,8 @@ QdfFixer::checkObjId(std::string const& cur_obj_str) | ||
| 301 | int cur_obj = QUtil::string_to_int(cur_obj_str.c_str()); | 300 | int cur_obj = QUtil::string_to_int(cur_obj_str.c_str()); |
| 302 | if (cur_obj != last_obj + 1) { | 301 | if (cur_obj != last_obj + 1) { |
| 303 | fatal( | 302 | fatal( |
| 304 | - filename + ":" + QUtil::uint_to_string(lineno) + | ||
| 305 | - ": expected object " + QUtil::int_to_string(last_obj + 1)); | 303 | + filename + ":" + std::to_string(lineno) + ": expected object " + |
| 304 | + std::to_string(last_obj + 1)); | ||
| 306 | } | 305 | } |
| 307 | last_obj = cur_obj; | 306 | last_obj = cur_obj; |
| 308 | xref.push_back(QPDFXRefEntry(1, QIntC::to_offset(last_offset), 0)); | 307 | xref.push_back(QPDFXRefEntry(1, QIntC::to_offset(last_offset), 0)); |
| @@ -325,16 +324,15 @@ QdfFixer::writeOstream() | @@ -325,16 +324,15 @@ QdfFixer::writeOstream() | ||
| 325 | for (auto iter: ostream_offsets) { | 324 | for (auto iter: ostream_offsets) { |
| 326 | iter -= QIntC::to_offset(first); | 325 | iter -= QIntC::to_offset(first); |
| 327 | ++onum; | 326 | ++onum; |
| 328 | - offsets += QUtil::int_to_string(onum) + " " + | ||
| 329 | - QUtil::int_to_string(iter) + "\n"; | 327 | + offsets += std::to_string(onum) + " " + std::to_string(iter) + "\n"; |
| 330 | } | 328 | } |
| 331 | auto offset_adjust = QIntC::to_offset(offsets.size()); | 329 | auto offset_adjust = QIntC::to_offset(offsets.size()); |
| 332 | first += offset_adjust; | 330 | first += offset_adjust; |
| 333 | stream_length += QIntC::to_size(offset_adjust); | 331 | stream_length += QIntC::to_size(offset_adjust); |
| 334 | std::string dict_data = ""; | 332 | std::string dict_data = ""; |
| 335 | - dict_data += " /Length " + QUtil::uint_to_string(stream_length) + "\n"; | ||
| 336 | - dict_data += " /N " + QUtil::uint_to_string(n) + "\n"; | ||
| 337 | - dict_data += " /First " + QUtil::int_to_string(first) + "\n"; | 333 | + dict_data += " /Length " + std::to_string(stream_length) + "\n"; |
| 334 | + dict_data += " /N " + std::to_string(n) + "\n"; | ||
| 335 | + dict_data += " /First " + std::to_string(first) + "\n"; | ||
| 338 | if (!ostream_extends.empty()) { | 336 | if (!ostream_extends.empty()) { |
| 339 | dict_data += " /Extends " + ostream_extends + "\n"; | 337 | dict_data += " /Extends " + ostream_extends + "\n"; |
| 340 | } | 338 | } |
qpdf/pdf_from_scratch.cc
| @@ -78,7 +78,7 @@ runtest(int n) | @@ -78,7 +78,7 @@ runtest(int n) | ||
| 78 | w.write(); | 78 | w.write(); |
| 79 | } else { | 79 | } else { |
| 80 | throw std::runtime_error( | 80 | throw std::runtime_error( |
| 81 | - std::string("invalid test ") + QUtil::int_to_string(n)); | 81 | + std::string("invalid test ") + std::to_string(n)); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | std::cout << "test " << n << " done" << std::endl; | 84 | std::cout << "test " << n << " done" << std::endl; |