Skip to content

Commit f09bdb2

Browse files
author
Dan Smith
committed
latest from NITRO
2 parents c73d46b + 41ea3de commit f09bdb2

10 files changed

Lines changed: 25 additions & 25 deletions

File tree

externals/nitro/modules/c++/nitf/include/nitf/Object.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class NITRO_NITFCPP_API Object
151151
*/
152152
std::string getObjectID() const
153153
{
154-
return FmtX("%p", getNative());
154+
return str::Format("%p", getNative());
155155
}
156156

157157
bool isManaged() const noexcept { return isValid() && mHandle->isManaged(); }

externals/nitro/modules/c++/nitf/source/FileHeader.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ nitf::ComponentInfo FileHeader::getImageInfo(int i) const
200200
{
201201
int num = getNumImages();
202202
if (i < 0 || i >= num)
203-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
203+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
204204
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
205205
return make_ComponentInfo(getNativeOrThrow()->imageInfo, i);
206206
}
@@ -209,7 +209,7 @@ nitf::ComponentInfo FileHeader::getGraphicInfo(int i) const
209209
{
210210
int num = getNumGraphics();
211211
if (i < 0 || i >= num)
212-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
212+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
213213
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
214214
return make_ComponentInfo(getNativeOrThrow()->graphicInfo, i);
215215
}
@@ -218,7 +218,7 @@ nitf::ComponentInfo FileHeader::getLabelInfo(int i) const
218218
{
219219
int num = getNumLabels();
220220
if (i < 0 || i >= num)
221-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
221+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
222222
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
223223
return make_ComponentInfo(getNativeOrThrow()->labelInfo, i);
224224
}
@@ -227,7 +227,7 @@ nitf::ComponentInfo FileHeader::getTextInfo(int i) const
227227
{
228228
int num = getNumTexts();
229229
if (i < 0 || i >= num)
230-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
230+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
231231
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
232232
return make_ComponentInfo(getNativeOrThrow()->textInfo, i);
233233
}
@@ -236,7 +236,7 @@ nitf::ComponentInfo FileHeader::getDataExtensionInfo(int i) const
236236
{
237237
int num = getNumDataExtensions();
238238
if (i < 0 || i >= num)
239-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
239+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
240240
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
241241
return make_ComponentInfo(getNativeOrThrow()->dataExtensionInfo, i);
242242
}
@@ -245,7 +245,7 @@ nitf::ComponentInfo FileHeader::getReservedExtensionInfo(int i) const
245245
{
246246
int num = getNumReservedExtensions();
247247
if (i < 0 || i >= num)
248-
throw except::IndexOutOfRangeException(Ctxt(FmtX(
248+
throw except::IndexOutOfRangeException(Ctxt(str::Format(
249249
"Index out of range: (%d <= %d <= %d)", 0, i, num)));
250250
return make_ComponentInfo(getNativeOrThrow()->reservedExtensionInfo, i);
251251
}

externals/nitro/modules/c++/nitf/source/TRE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ nitf::Field TRE::getField(const std::string& key) const
9696
nitf_Field* field = ::nitf_TRE_getField(getNativeOrThrow(), key.c_str());
9797
if (!field)
9898
throw except::NoSuchKeyException(
99-
Ctxt(FmtX("Field does not exist in TRE: %s", key.c_str())));
99+
Ctxt(str::Format("Field does not exist in TRE: %s", key)));
100100
return nitf::Field(field);
101101
}
102102

externals/nitro/modules/c++/nitf/tests/test_create++.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int main(int argc, char** argv)
2828
{
2929
if (argc != 2)
3030
{
31-
throw nitf::NITFException(Ctxt(FmtX("Usage %s <file-to-create>\n",
31+
throw nitf::NITFException(Ctxt(str::Format("Usage %s <file-to-create>\n",
3232
argv[0])));
3333
}
3434

externals/nitro/modules/c++/nitf/tests/test_extract.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ static std::vector<std::string> extract_image(const nitf::ImageSubheader& subhe
4444
size_t band = 0;
4545
for (const auto& data : bandData) // for band, data in enumerate(bandData):
4646
{
47-
auto outName = FmtX("%s_%d__", baseName, index);
48-
outName += FmtX("%d_x_%d_", window.getNumRows(), window.getNumCols());
49-
outName += FmtX("%d_band_%d.out", static_cast<int>(nbpp), static_cast<int>(band));
47+
auto outName = str::Format("%s_%d__", baseName, index);
48+
outName += str::Format("%d_x_%d_", window.getNumRows(), window.getNumCols());
49+
outName += str::Format("%d_band_%d.out", static_cast<int>(nbpp), static_cast<int>(band));
5050
outName = sys::Path::joinPaths(outDir, outName);
5151
auto f = fopen(outName.c_str(), "wb"); // f = open(outName, "wb");
5252
nitf::write(f, data); // fwrite(data.data(), sizeof(data[0]), data.size() / sizeof(data[0]), f);

externals/nitro/modules/c++/nitf/tests/test_fhdr_clone++.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int main(int argc, char** argv)
118118
{
119119
if (argc != 2)
120120
{
121-
throw nitf::NITFException(Ctxt(FmtX("Usage: %s <nitf-file>\n", argv[0])));
121+
throw nitf::NITFException(Ctxt(str::Format("Usage: %s <nitf-file>\n", argv[0])));
122122
}
123123

124124
nitf::Reader reader;

externals/nitro/modules/c++/nitf/tests/test_functional.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int main(int argc, char **argv)
3434
{
3535
nitf::Reader reader;
3636
if ( argc != 2 )
37-
throw nitf::NITFException(Ctxt(FmtX("Usage: %s <nitf-file>\n", argv[0])));
37+
throw nitf::NITFException(Ctxt(str::Format("Usage: %s <nitf-file>\n", argv[0])));
3838

3939
nitf::IOHandle io(argv[1]);
4040
nitf::Record record = reader.read(io);

externals/nitro/modules/c++/nitf/tests/test_j2k_nitf_read_region.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
void writeFile(uint32_t x0, uint32_t y0,
4848
uint32_t x1, uint32_t y1, std::span<const uint8_t> buf, const std::string& prefix)
4949
{
50-
auto filename = FmtX("%s-raw-", prefix);
51-
filename += FmtX("%d_%d__%d_%d.out", x0, y0, x1, y1);
50+
auto filename = str::Format("%s-raw-", prefix);
51+
filename += str::Format("%d_%d__%d_%d.out", x0, y0, x1, y1);
5252
nitf::IOHandle outHandle(filename, NRT_ACCESS_WRITEONLY, NRT_CREATE);
5353
outHandle.write(buf.data(), buf.size());
5454
printf("Wrote file: %s\n", filename.c_str());
@@ -58,8 +58,8 @@ void writeJ2K(uint32_t x0, uint32_t y0,
5858
uint32_t x1, uint32_t y1, std::span<const uint8_t> buf,
5959
const j2k::Container& inContainer, const std::string& prefix)
6060
{
61-
auto outName = FmtX("%s-raw-", prefix);
62-
outName += FmtX("%d_%d__%d_%d.j2k", x0, y0, x1, y1);
61+
auto outName = str::Format("%s-raw-", prefix);
62+
outName += str::Format("%d_%d__%d_%d.j2k", x0, y0, x1, y1);
6363

6464
const auto num_x_tiles = inContainer.getTilesX();
6565
const auto num_y_tiles = inContainer.getTilesY();
@@ -217,7 +217,7 @@ int main(int argc, char **argv)
217217
const auto result_ = j2kReader.readRegion(0, 0, width, height, buf);
218218
const std::span<const uint8_t> result(result_.data(), result_.size());
219219

220-
const auto namePrefix = FmtX("image-%d", (i + 1));
220+
const auto namePrefix = str::Format("image-%d", (i + 1));
221221
// TODO: Update write to only output tiles in read region
222222
writeFile(0, 0, width, height, result, namePrefix);
223223
writeJ2K(0, 0, width, height, result, container, namePrefix);

externals/nitro/modules/c++/nitf/tests/test_read_acftb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int main(int argc, char** argv)
8383
nitf::Reader reader;
8484
if (argc != 2)
8585
{
86-
throw nitf::NITFException(Ctxt(FmtX("Usage: %s <nitf-file>\n",
86+
throw nitf::NITFException(Ctxt(str::Format("Usage: %s <nitf-file>\n",
8787
argv[0])));
8888
}
8989
nitf::IOHandle io(argv[1]);

externals/nitro/modules/c++/nitf/unittests/test_j2k_loading++.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ TEST_CASE(test_j2k_nitf)
168168
void writeFile(uint32_t x0, uint32_t y0,
169169
uint32_t x1, uint32_t y1, std::span<const uint8_t> buf, const std::string& prefix)
170170
{
171-
auto filename = FmtX("%s-raw-", prefix);
172-
filename += FmtX("%d_%d__%d_%d.out", x0, y0, x1, y1);
171+
auto filename = str::Format("%s-raw-", prefix);
172+
filename += str::Format("%d_%d__%d_%d.out", x0, y0, x1, y1);
173173
nitf::IOHandle outHandle(filename, NRT_ACCESS_WRITEONLY, NRT_CREATE);
174174
outHandle.write(buf.data(), buf.size());
175175
//printf("Wrote file: %s\n", filename.c_str());
@@ -178,8 +178,8 @@ void writeJ2K(uint32_t x0, uint32_t y0,
178178
uint32_t x1, uint32_t y1, std::span<const uint8_t> buf,
179179
const j2k::Container& inContainer, const std::string& prefix)
180180
{
181-
auto outName = FmtX("%s-raw-", prefix);
182-
outName += FmtX("%d_%d__%d_%d.j2k", x0, y0, x1, y1);
181+
auto outName = str::Format("%s-raw-", prefix);
182+
outName += str::Format("%d_%d__%d_%d.j2k", x0, y0, x1, y1);
183183

184184
const auto num_x_tiles = inContainer.getTilesX();
185185
const auto num_y_tiles = inContainer.getTilesY();
@@ -273,7 +273,7 @@ void test_j2k_nitf_read_region_(const std::string& testName,
273273
const auto result_ = j2kReader.readRegion(0, 0, width, height, buf);
274274
const auto result = sys::make_const_span(result_);
275275

276-
const auto namePrefix = FmtX("image-%d", (i + 1));
276+
const auto namePrefix = str::Format("image-%d", (i + 1));
277277
// TODO: Update write to only output tiles in read region
278278
writeFile(0, 0, width, height, result, namePrefix);
279279
writeJ2K(0, 0, width, height, result, container, namePrefix);

0 commit comments

Comments
 (0)