+ std::string filename = T->Option(ReleaseInfo ? IndexTarget::EXISTING_FILENAME : IndexTarget::FILENAME);
+ if (filename.empty())
+ continue;
+
+ std::ostringstream stanza;
+ if (Filtered || Format.empty())
+ {
+ stanza << "MetaKey: " << T->MetaKey << "\n"
+ << "ShortDesc: " << T->ShortDesc << "\n"
+ << "Description: " << T->Description << "\n"
+ << "URI: " << T->URI << "\n"
+ << "Filename: " << filename << "\n"
+ << "Optional: " << (T->IsOptional ? "yes" : "no") << "\n"
+ << "KeepCompressed: " << (T->KeepCompressed ? "yes" : "no") << "\n";
+ for (std::map<std::string,std::string>::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O)
+ stanza << format_key(O->first) << ": " << O->second << "\n";
+ for (std::map<std::string,std::string>::const_iterator O = T->Options.begin(); O != T->Options.end(); ++O)
+ {
+ if (O->first == "PDIFFS")
+ stanza << "PDiffs: " << O->second << "\n";
+ else if (O->first == "COMPRESSIONTYPES")
+ stanza << "CompressionTypes: " << O->second << "\n";
+ else if (O->first == "DEFAULTENABLED")
+ stanza << "DefaultEnabled: " << O->second << "\n";
+ else
+ stanza << format_key(O->first) << ": " << O->second << "\n";
+ }
+ stanza << "\n";
+
+ if (Filtered)
+ {
+ // that is a bit crude, but good enough for now
+ bool found = true;
+ std::string haystack = std::string("\n") + stanza.str() + "\n";
+ std::transform(haystack.begin(), haystack.end(), haystack.begin(), ::tolower);
+ size_t const filesize = CmdL.FileSize() - 1;
+ for (size_t i = 0; i != filesize; ++i)
+ {
+ std::string needle = std::string("\n") + CmdL.FileList[i + 1] + "\n";
+ std::transform(needle.begin(), needle.end(), needle.begin(), ::tolower);
+ if (haystack.find(needle) != std::string::npos)
+ continue;
+ found = false;
+ break;
+ }
+ if (found == false)
+ continue;
+ }
+ }
+
+ if (Format.empty())
+ cout << stanza.str();
+ else
+ {
+ std::string out = SubstVar(Format, "$(FILENAME)", filename);
+ out = T->Format(out);
+ for (std::map<std::string,std::string>::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O)
+ out = SubstVar(out, std::string("$(") + O->first + ")", O->second);
+ cout << out << std::endl;
+ }