// // Created by robin on 8/8/15. // #ifndef PDNS_SLAVE_MAINCLASS_H #define PDNS_SLAVE_MAINCLASS_H #include #include #include class MainClass { public: enum Actions { Read, Write, Map, Devices, Tags }; MainClass(int argc, char* argv[]); int main(); std::shared_ptr getDevice(const std::string& deviceName, std::vector> devices); std::shared_ptr getTag(const std::string& tagUid, std::vector> tags); int mapKeys(std::shared_ptr tag, std::vector keys); int read(std::shared_ptr tag, std::vector keys); int write(std::shared_ptr tag, std::vector keys, const std::string& data); LibNfc::Utils::Result> readFile(const std::string& filePath); LibNfc::Utils::Result> readStream(std::istream& stream); void printSectors(const std::vector& sectors); void printBlockAccessBits(const LibNfc::FreeFare::FreeFareAccessBits& accessBits, int block); void printTrailerAccessBits(const LibNfc::FreeFare::FreeFareAccessBits& accessBits); void printVersion(); std::ostream& cout(); std::istream& cin(); static void printPercent(int done, int total, const std::string& header); static void printPercentMapKeys(int done, int total); static void printPercentDump(int done, int total); static void printPercentWrite(int done, int total); private: int _argc; char** _argv; std::shared_ptr _outputStream; std::shared_ptr _inputStream; }; #endif //PDNS_SLAVE_MAINCLASS_H