Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cxong/tinydir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCong <c_xong@hotmail.com>2013-02-02 09:56:54 +0400
committerCong <c_xong@hotmail.com>2013-02-02 09:56:54 +0400
commite813071b39b07055b126abc33d5ed5a3ed93805c (patch)
tree2e631517be65051de8997c6264394c3ba728d97c /README.md
parent5d1231334c55c3965ab14508a28570c5232e0993 (diff)
Add code example to README.md; update VS projects
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/README.md b/README.md
index b6bc46c..38b8d16 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,35 @@
-tinydir
+TinyDir
=======
Lightweight, portable and easy to integrate C directory and file reader.
+Example
+=======
+
+Error checking omitted:
+
+```C
+tinydir_dir dir;
+tinydir_open(&dir, "/path/to/dir");
+
+while (dir.has_next)
+{
+ tinydir_file file;
+ tinydir_readfile(&dir, &file);
+
+ printf("%s", file.name);
+ if (file.is_dir)
+ {
+ printf("/");
+ }
+ printf("\n");
+
+ tinydir_next(&dir);
+}
+
+tinydir_close(&dir);
+```
+
Language
========