implements of file system function. More...
#include "stdafx.h"#include "FileFunctions.h"#include "LogFunctions.h"#include "StringFunctions.h"#include "CoreMacros.h"#include "ErrorCode.h"#include <vector>#include <list>#include <boost/filesystem/path.hpp>#include <boost/filesystem/operations.hpp>#include <boost/bind.hpp>#include <direct.h>
Go to the source code of this file.
Functions | |
| bool | fileexists (const char *path) |
| judge whether file exists More... | |
| bool | isdirectory (const char *path) |
| judge whether file is directory More... | |
| bool | checkfile (const char *path) |
| check file before open. (This function calls fileexists and isdirectory ) More... | |
| std::string | getfilename (const char *path) |
| get file name More... | |
| std::string | getdir (const char *path) |
| get dir that the file exists More... | |
| std::string | getpath (const char *dir, const char *file) |
| get file path More... | |
| std::string | absolutepath (const char *path) |
| get absolute path More... | |
| std::string | getabsolutepath (const char *dir, const char *file) |
| get absolute path More... | |
| bool | isabsolutepath (const char *file) |
| judges whether the specified file path is absolute file path or not. More... | |
| void | setarguments (int argc, char **argv) |
| set arguments More... | |
| int | getargc () |
| get number of arguments More... | |
| const char * | getargv (int index) |
| get argument More... | |
| std::string | getext (const char *path) |
| get the extension of the file More... | |
| std::string | getenvariable (const char *name) |
| get environment variable More... | |
| std::string | getmodulefile () |
| gets module file path More... | |
| std::string | getmoduledir () |
| gets module file directory More... | |
| std::string | gethomedir () |
| gets current user's home directory More... | |
| FILE * | fileopen (const char *path, const char *mode) |
| opens file More... | |
| void | fileseek (FILE *fp, long long offset, int origin) |
| sets file position More... | |
| long long | filetell (FILE *fp) |
| gets file position More... | |
| bool | copyfile (const char *src, const char *dst) |
| copies file More... | |
| bool | removefile (const char *path) |
| removes file More... | |
| bool | makedirectory (const char *path) |
| creates directory More... | |
| bool | removedirs (const char *path) |
| remove directories More... | |
| bool | makedirs (const char *path) |
| make directories More... | |
| std::string | getplugindir () |
| gets mspp plugin paths | |
| unsigned long long | filesize (const char *path) |
| gets the file size More... | |
| std::string | searchfile (const char *dir, const char *fileName, const bool recursive) |
| searches file More... | |
Variables | |
| std::vector< std::string > | g_arguments |
| std::string | g_moduleFile |
| std::string | g_homeDir |
implements of file system function.
Copyright(C) 2006-2014 Eisai Co., Ltd. All rights reserved.
Definition in file FileFunctions.cpp.
| std::string absolutepath | ( | const char * | path | ) |
get absolute path
| [in] | path | file path |
Definition at line 176 of file FileFunctions.cpp.
| bool checkfile | ( | const char * | path | ) |
check file before open. (This function calls fileexists and isdirectory )
| [in] | path | file path |
Definition at line 92 of file FileFunctions.cpp.

| bool copyfile | ( | const char * | src, |
| const char * | dst | ||
| ) |
copies file
| [in] | src | file path to be copied |
| [in] | dst | copy file path |
Definition at line 438 of file FileFunctions.cpp.

| bool fileexists | ( | const char * | path | ) |
judge whether file exists
| [in] | path | file path |
Definition at line 51 of file FileFunctions.cpp.
| FILE * fileopen | ( | const char * | path, |
| const char * | mode | ||
| ) |
opens file
| [in] | path | file path to be opened |
| [in] | mode | open mode |
Definition at line 399 of file FileFunctions.cpp.
| void fileseek | ( | FILE * | fp, |
| long long | offset, | ||
| int | origin | ||
| ) |
sets file position
| [in] | fp | file descriptor |
| [in] | offset | position from origin |
| [in] | origin | SEEK_SET, SEEK_CUR or SEEK_END (see "fseek" document) |
Definition at line 416 of file FileFunctions.cpp.
| unsigned long long filesize | ( | const char * | path | ) |
gets the file size
| [in] | path | file path |
Definition at line 576 of file FileFunctions.cpp.
| long long filetell | ( | FILE * | fp | ) |
gets file position
| [in] | fp | file description |
Definition at line 426 of file FileFunctions.cpp.
| std::string getabsolutepath | ( | const char * | dir, |
| const char * | file | ||
| ) |
get absolute path
| [in] | dir | directory name |
| [in] | file | file name |
Definition at line 192 of file FileFunctions.cpp.

| int getargc | ( | ) |
get number of arguments
Definition at line 232 of file FileFunctions.cpp.
| const char * getargv | ( | int | index | ) |
get argument
| [in] | index | argument index |
Definition at line 242 of file FileFunctions.cpp.
| std::string getdir | ( | const char * | path | ) |
get dir that the file exists
| [in] | path | file path |
Definition at line 129 of file FileFunctions.cpp.
| std::string getenvariable | ( | const char * | name | ) |
get environment variable
| [in] | name | environment variable name |
Definition at line 274 of file FileFunctions.cpp.
| std::string getext | ( | const char * | path | ) |
get the extension of the file
| [in] | path | file path |
Definition at line 257 of file FileFunctions.cpp.
| std::string getfilename | ( | const char * | path | ) |
get file name
| [in] | path | file path |
Definition at line 114 of file FileFunctions.cpp.
| std::string gethomedir | ( | ) |
gets current user's home directory
Definition at line 374 of file FileFunctions.cpp.

| std::string getmoduledir | ( | ) |
gets module file directory
Definition at line 369 of file FileFunctions.cpp.

| std::string getmodulefile | ( | ) |
gets module file path
Definition at line 303 of file FileFunctions.cpp.

| std::string getpath | ( | const char * | dir, |
| const char * | file | ||
| ) |
get file path
| dir | directory name | |
| [in] | file | file name |
Definition at line 148 of file FileFunctions.cpp.

| bool isabsolutepath | ( | const char * | file | ) |
judges whether the specified file path is absolute file path or not.
| [in] | file | file path |
Definition at line 208 of file FileFunctions.cpp.
| bool isdirectory | ( | const char * | path | ) |
judge whether file is directory
| [in] | path | file path |
Definition at line 73 of file FileFunctions.cpp.

| bool makedirectory | ( | const char * | path | ) |
creates directory
| [in] | path | directory path to be maken |
Definition at line 486 of file FileFunctions.cpp.
| bool makedirs | ( | const char * | path | ) |
make directories
| [in] | path | directory path |
Definition at line 541 of file FileFunctions.cpp.

| bool removedirs | ( | const char * | path | ) |
remove directories
| [in] | path | directory path |
Definition at line 504 of file FileFunctions.cpp.

| void removefile | ( | const char * | path | ) |
removes file
| [in] | path | file path to be removed |
Definition at line 468 of file FileFunctions.cpp.
| std::string searchfile | ( | const char * | dir, |
| const char * | fileName, | ||
| const bool | recursive | ||
| ) |
searches file
| [in] | dir | file directory |
| [in] | fileName | file name |
| [in] | recursive | If true, search file recursively. |
Definition at line 587 of file FileFunctions.cpp.

| void setarguments | ( | int | argc, |
| char ** | argv | ||
| ) |
set arguments
| [in] | argc | the number of arguments |
| [in] | argv | the array of arguments |
Definition at line 218 of file FileFunctions.cpp.
| std::vector<std::string> g_arguments |
the array of arguments
Definition at line 41 of file FileFunctions.cpp.
| std::string g_homeDir |
home directory
Definition at line 47 of file FileFunctions.cpp.
| std::string g_moduleFile |
module file path
Definition at line 44 of file FileFunctions.cpp.
1.8.6