diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llvfs/lldir.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llvfs/lldir.h | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/linden/indra/llvfs/lldir.h b/linden/indra/llvfs/lldir.h new file mode 100644 index 0000000..2012f1b --- /dev/null +++ b/linden/indra/llvfs/lldir.h | |||
@@ -0,0 +1,121 @@ | |||
1 | /** | ||
2 | * @file lldir.h | ||
3 | * @brief Definition of directory utilities class | ||
4 | * | ||
5 | * Copyright (c) 2000-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLDIR_H | ||
29 | #define LL_LLDIR_H | ||
30 | |||
31 | typedef enum ELLPath | ||
32 | { | ||
33 | LL_PATH_NONE = 0, | ||
34 | LL_PATH_USER_SETTINGS = 1, | ||
35 | LL_PATH_APP_SETTINGS = 2, | ||
36 | LL_PATH_PER_SL_ACCOUNT = 3, | ||
37 | LL_PATH_CACHE = 4, | ||
38 | LL_PATH_CHARACTER = 5, | ||
39 | LL_PATH_MOTIONS = 6, | ||
40 | LL_PATH_HELP = 7, | ||
41 | LL_PATH_LOGS = 8, | ||
42 | LL_PATH_TEMP = 9, | ||
43 | LL_PATH_SKINS = 10, | ||
44 | LL_PATH_TOP_SKIN = 11, | ||
45 | LL_PATH_CHAT_LOGS = 12, | ||
46 | LL_PATH_PER_ACCOUNT_CHAT_LOGS = 13, | ||
47 | LL_PATH_MOZILLA_PROFILE = 14, | ||
48 | LL_PATH_COUNT = 15 | ||
49 | } ELLPath; | ||
50 | |||
51 | |||
52 | class LLDir | ||
53 | { | ||
54 | public: | ||
55 | LLDir(); | ||
56 | virtual ~LLDir(); | ||
57 | |||
58 | virtual void initAppDirs(const std::string &app_name) = 0; | ||
59 | public: | ||
60 | virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); | ||
61 | |||
62 | // pure virtual functions | ||
63 | virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0; | ||
64 | virtual BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) = 0; | ||
65 | virtual void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) = 0; | ||
66 | virtual std::string getCurPath() = 0; | ||
67 | virtual BOOL fileExists(const std::string &filename) = 0; | ||
68 | |||
69 | const std::string findFile(const std::string &filename, const std::string searchPath1 = "", const std::string searchPath2 = "", const std::string searchPath3 = ""); | ||
70 | const std::string &getExecutablePathAndName() const; // Full pathname of the executable | ||
71 | const std::string &getAppName() const; // install directory under progams/ ie "SecondLife" | ||
72 | const std::string &getExecutableDir() const; // Directory where the executable is located | ||
73 | const std::string &getExecutableFilename() const;// Filename of .exe | ||
74 | const std::string &getWorkingDir() const; // Current working directory | ||
75 | const std::string &getAppRODataDir() const; // Location of read-only data files | ||
76 | const std::string &getOSUserDir() const; // Location of the os-specific user dir | ||
77 | const std::string &getOSUserAppDir() const; // Location of the os-specific user app dir | ||
78 | const std::string &getLindenUserDir() const; // Location of the Linden user dir. | ||
79 | const std::string &getChatLogsDir() const; // Location of the chat logs dir. | ||
80 | const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. | ||
81 | const std::string &getTempDir() const; // Common temporary directory | ||
82 | const std::string &getCAFile() const; // File containing TLS certificate authorities | ||
83 | const std::string &getDirDelimiter() const; // directory separator for platform (ie. '\' or '/' or ':') | ||
84 | const std::string &getSkinDir() const; // User-specified skin folder. | ||
85 | |||
86 | // Expanded filename | ||
87 | std::string getExpandedFilename(ELLPath location, const std::string &filename) const; | ||
88 | |||
89 | // random filename in common temporary directory | ||
90 | std::string getTempFilename() const; | ||
91 | |||
92 | virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir | ||
93 | virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. | ||
94 | virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir | ||
95 | virtual void setSkinFolder(const std::string &skin_folder); | ||
96 | |||
97 | virtual void dumpCurrentDirectories(); | ||
98 | |||
99 | protected: | ||
100 | std::string mAppName; // install directory under progams/ ie "SecondLife" | ||
101 | std::string mExecutablePathAndName; // full path + Filename of .exe | ||
102 | std::string mExecutableFilename; // Filename of .exe | ||
103 | std::string mExecutableDir; // Location of executable | ||
104 | std::string mWorkingDir; // Current working directory | ||
105 | std::string mAppRODataDir; // Location for static app data | ||
106 | std::string mOSUserDir; // OS Specific user directory | ||
107 | std::string mOSUserAppDir; // OS Specific user app directory | ||
108 | std::string mLindenUserDir; // Location for Linden user-specific data | ||
109 | std::string mPerAccountChatLogsDir; // Location for chat logs. | ||
110 | std::string mChatLogsDir; // Location for chat logs. | ||
111 | std::string mCAFile; // Location of the TLS certificate authority PEM file. | ||
112 | std::string mTempDir; | ||
113 | std::string mDirDelimiter; | ||
114 | std::string mSkinDir; // Location for u ser-specified skin info. | ||
115 | }; | ||
116 | |||
117 | void dir_exists_or_crash(const std::string &dir_name); | ||
118 | |||
119 | extern LLDir *gDirUtilp; | ||
120 | |||
121 | #endif // LL_LLDIR_H | ||