Georg Baum <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: > >> Georg Baum <[EMAIL PROTECTED]> >> writes: >> | Would it be ok with you to have something like >> | Format const *Formats::getFormatFromFile(string filename) >> | that does what getFormatFromContents() did before your patch? >> >> Yes. >> >> One solution will be a wrapper function >> >> string discoverFormat(string const & filename) >> { >> string fmt = getFormatFromFile(filename); >> if (fmt == "user) { >> // try to get format from the Formats >> } >> return fmt; >> } > | Why a wrapper function? We never need the part that gets the format from | file extension alone.
for gzip I have no need to look at the formats... so why ever look them up? Why wrapper? The generalized function in support, the specialized variant in Format. -- Lgb