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