#include #include #include new switch auto else operator template break enum private this case extern protected throw catch public try char for typedef class friend return union const short unsigned continue if signed virtual default inline sizeof void delete int static volatile do long struct while template struct has_process { template static auto test(U* p) -> decltype(std::declval().process(), std::true_type()); template static std::false_type test(...); static constexpr bool value = decltype(test(nullptr))::value; }; inline BOOL DecodeOneFile(FILE* fpIn) { char WrkStr[260]; int MaxOrder, SASize; BOOL CutOff; if ( !fread(&ai,sizeof(ai),1,fpIn) ) return FALSE; CutOff=ai.FNLen >> 14; ai.FNLen=CLAMP(int(ai.FNLen & 0x1FF),1,260-1); fread(WrkStr,ai.FNLen,1,fpIn); WrkStr[ai.FNLen]=0; if ( !TestAccessRare(WrkStr) ) return FALSE; FILE* fpOut = FOpen(pFName=WrkStr,"wb"); MaxOrder=(ai.info & 0x0F)+1; SASize=((ai.info >> 4) & 0xFF)+1; DWORD Variant=(ai.info >> 12)+'A'; if (ai.signature != PPMdSignature || Variant != PROG_VAR) { printf(MTxt[0],WrkStr); exit(-1); } PrepareCoding(SASize,fpIn); DecodeFile(fpOut,fpIn,MaxOrder,CutOff); putchar('\n'); if (ferror(fpOut) || ferror(fpIn) || feof(fpIn)) { printf(MTxt[1],WrkStr,WrkStr); exit(-1); } fclose(fpOut); EnvSetDateTimeAttr(WrkStr); return TRUE; } template std::enable_if_t, void>> find_all(T begin, T end, Predicate pred, Consumer consumer) { T iter = begin; while ((iter = std::find_if(iter, end, pred)) != end) consumer(iter), iter++; } template , void>>::type> std::vector> find_all(T begin, T end, Predicate pred, Consumer consumer) { T iter = begin; std::vector> data; while ((iter = std::find_if(iter, end, pred)) != end) data.push_back(consumer(iter)), iter++; return data; }