Commit d2515f31 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

TEST: allow different styles of SUBDATASETS (for testing)

parent a0514a1a
......@@ -55,17 +55,15 @@ int otbMultiDatasetReadingInfo(int argc, char* argv[])
for( unsigned int itSubDataset = 0; itSubDataset < (unsigned int)names.size(); itSubDataset++ )
{
std::size_t posDeb = names[itSubDataset].find(":\"");
if (posDeb==std::string::npos)
return EXIT_FAILURE;
std::size_t posEnd = names[itSubDataset].rfind("\":");
if (posEnd==std::string::npos)
return EXIT_FAILURE;
// Remove the path from the SubDataset_name metadata
std::string strFilepath = names[itSubDataset].substr(posDeb+2, posEnd - posDeb - 2);
std::string filename = itksys::SystemTools::GetFilenameName(strFilepath);
names[itSubDataset].replace(posDeb+2, posEnd - posDeb - 2, filename.c_str() );
if (posDeb!=std::string::npos && posEnd!=std::string::npos)
{
// Remove the path from the SubDataset_name metadata
std::string strFilepath = names[itSubDataset].substr(posDeb+2, posEnd - posDeb - 2);
std::string filename = itksys::SystemTools::GetFilenameName(strFilepath);
names[itSubDataset].replace(posDeb+2, posEnd - posDeb - 2, filename.c_str() );
}
}
std::ofstream file;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment