source: branches/work_320/FileSystemUtil.h @ 679

Revision 331, 1.6 KB checked in by jls17, 6 years ago (diff)
  • removed the resources from the executable (imgaes, css, javascript are already placed in a separate archive next to the executable)
Line 
1//Copyright (C) 2009 Stefan Nerlich | stefan.nerlich@hotmail.com
2//
3//This file is part of ARInside.
4//
5//    ARInside is free software: you can redistribute it and/or modify
6//    it under the terms of the GNU General Public License as published by
7//    the Free Software Foundation, version 2 of the License.
8//
9//    ARInside is distributed in the hope that it will be useful,
10//    but WITHOUT ANY WARRANTY; without even the implied warranty of
11//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12//    GNU General Public License for more details.
13//
14//    You should have received a copy of the GNU General Public License
15//    along with ARInside.  If not, see <http://www.gnu.org/licenses/>.
16
17#pragma once
18#include "AppConfig.h"
19
20#ifdef WIN32
21#define ARINSIDE_PATH_SEPARATOR "\\"
22#else
23#define ARINSIDE_PATH_SEPARATOR "/"
24#endif
25
26class FileSystemUtil
27{
28public:
29        FileSystemUtil(AppConfig &appConfig);
30        ~FileSystemUtil(void);
31
32        bool CreateAppDirectory();
33        int CreateSubDirectory(string name);
34
35        static int ValidateTargetDir(std::string targetFolder);
36        static std::string GetRealPathName(const std::string &path);
37        static bool FileExistsAndReadable(const std::string &filename);
38        static bool DeleteDirectory(const char* sPath, bool topLevel = true);
39        static bool IsDots(const char* str);
40        static void CompactFolder(std::string path);
41        static std::string GetExecutableDirectory(const char* argv_0);
42        static std::string CombinePath(const std::string &path1, const std::string &path2);
43#if WIN32
44        static std::string GetFormattedMessage(unsigned int error);
45#endif
46
47private:
48        AppConfig &appConfig;
49};
Note: See TracBrowser for help on using the repository browser.