OSDN Git Service

dtl追加。
[wordring-tm/wordring-tm.git] / third-party / dtl-1.18 / examples / common.cpp
diff --git a/third-party/dtl-1.18/examples/common.cpp b/third-party/dtl-1.18/examples/common.cpp
new file mode 100644 (file)
index 0000000..cd2a9b6
--- /dev/null
@@ -0,0 +1,20 @@
+
+#include "common.hpp"
+
+bool isFileExist (string& fs) {
+    FILE *fp;
+    if ((fp = fopen(fs.c_str(), "r")) == NULL) {
+        return false;
+    }
+    fclose(fp);
+    return true;
+}
+
+bool isFewArgs (int argc, int limit) {
+    bool ret = false;
+    if (argc < limit) {
+        ret = true;
+    }
+    return ret;
+}
+