📄 dfadir.cpp
字号:
#include <astl.h>#include <dir_cursor.h>#include <tools.h>#include <stream.h>#include <iostream>#include <string>#include <algorithm>#include <cstdio> // perror#include <sys/types.h> // opendir#include <dirent.h>using namespace std;const string USAGE = "[dir]";const string DESCRIPTION = "build a DFA from a directory tree\n \dir\troot directory (initial state)";int main(int argc, char **argv){ config c(argc, argv, 0, "", USAGE, DESCRIPTION); if (find(c.begin(), c.end(), "-h") != c.end()) c.usage(); string root = "."; if (c.arg_pos < argc) root = argv[c.arg_pos]; DIR *just_testing = opendir(root.c_str()); if (just_testing == NULL) { string error_msg = string(argv[0]) + ": " + root; perror(error_msg.c_str()); exit(2); } closedir(just_testing); DFA_stream out(cout); if (c.state_mark) clone(out, dfirst_markc(directoryc(root))); else clone(out, dfirstc(directoryc(root))); return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -