From 70cdd89e887641b7423e5d4d05928d14ee014aba Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 17 May 2018 19:10:57 +0800 Subject: change file tree --- src/fs/filesystem.cpp | 68 --------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/fs/filesystem.cpp (limited to 'src/fs/filesystem.cpp') diff --git a/src/fs/filesystem.cpp b/src/fs/filesystem.cpp deleted file mode 100644 index 72f1144..0000000 --- a/src/fs/filesystem.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "filesystem.h" -#include -#include -#include /* defines FILENAME_MAX */ - -namespace jin -{ -namespace fs -{ - - Filesystem* Filesystem::fs = 0; - - Filesystem::Filesystem() - { - S = sm_newshared(); - } - - Filesystem* Filesystem::get() - { - return fs ? fs : (fs = new Filesystem()); - } - - /** - * r is relative path - */ - void Filesystem::mount(const char * path) - { - int err = sm_mount(S, path); - if (err) - { - printf("%s mounted path %s", sm_errstr(err), path); - exit(1); - } - } - - /** - * - */ - int Filesystem::read(const char* path, Buffer* buffer) - { - buffer->data = sm_read(S, path, &buffer->size); - if (buffer->data == 0) - return 0; - return 1; - } - - const char* Filesystem::getFull(const char* path) - { - return sm_fullpath(S, path); - } - - bool Filesystem::isDir(const char* path) - { - return sm_isdir(S, path); - } - - bool Filesystem::isFile(const char* path) - { - return sm_isreg(S, path); - } - - bool Filesystem::exists(const char* path) - { - return sm_exists(S, path) == 0; - } - -} -} \ No newline at end of file -- cgit v1.1-26-g67d0