annotate engine/core/vfs/vfsdirectory.cpp @ 629:e37469251b22

* Removed some more unused files
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 04 Oct 2010 20:52:06 +0000
parents 293e812316c0
children f67e9f47526d
rev   line source
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 /***************************************************************************
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 * Copyright (C) 2005-2008 by the FIFE team *
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 * http://www.fifengine.de *
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 * This file is part of FIFE. *
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
6 * FIFE is free software; you can redistribute it and/or *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
7 * modify it under the terms of the GNU Lesser General Public *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
8 * License as published by the Free Software Foundation; either *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
9 * version 2.1 of the License, or (at your option) any later version. *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
11 * This library is distributed in the hope that it will be useful, *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
14 * Lesser General Public License for more details. *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 * *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
16 * You should have received a copy of the GNU Lesser General Public *
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
17 * License along with this library; if not, write to the *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 * Free Software Foundation, Inc., *
46
90005975cdbb * Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 0
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 ***************************************************************************/
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 // Standard C++ library includes
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 #include <fstream>
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 // 3rd party library includes
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26 #include <boost/filesystem/operations.hpp>
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 #include <boost/filesystem/path.hpp>
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29 // FIFE includes
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 // These includes are split up in two parts, separated by one empty line
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 // First block: files included from the FIFE root src directory
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32 // Second block: files included from the same folder
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 #include "vfs/raw/rawdata.h"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34 #include "vfs/raw/rawdatafile.h"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 #include "util/log/logger.h"
421
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
36 #include "util/base/exception.h"
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 #include "vfsdirectory.h"
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
38
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39 namespace bfs = boost::filesystem;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40 namespace FIFE {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41 static Logger _log(LM_VFS);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43 VFSDirectory::VFSDirectory(VFS* vfs, const std::string& root) : VFSSource(vfs), m_root(root) {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 FL_DBG(_log, LMsg("VFSDirectory created with root path ") << m_root);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 if(!m_root.empty() && *(m_root.end() - 1) != '/')
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46 m_root.append(1,'/');
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
48
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50 VFSDirectory::~VFSDirectory() {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54 bool VFSDirectory::fileExists(const std::string& name) const {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 std::string fullpath = m_root + name;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 std::ifstream file(fullpath.c_str());
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
57 if (file)
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 return true;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60 return false;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 RawData* VFSDirectory::open(const std::string& file) const {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 return new RawData(new RawDataFile(m_root + file));
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67 std::set<std::string> VFSDirectory::listFiles(const std::string& path) const {
202
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
68 return list(path, false);
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
69 }
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
70
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
71 std::set<std::string> VFSDirectory::listDirectories(const std::string& path) const {
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
72 return list(path, true);
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
73 }
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
74
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
75 std::set<std::string> VFSDirectory::list(const std::string& path, bool directorys) const {
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
76 std::set<std::string> list;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 std::string dir = m_root;
202
1d9154c535cf fixed bug where the root directory path name was being added to the filename twice. It was initially added in the listFiles/listDirectories functions and then added again in the private function list. I modified the code so it is only added in the list function now.
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 189
diff changeset
78
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 // Avoid double slashes
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80 if(path[0] == '/' && m_root[m_root.size()-1] == '/') {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 dir.append(path.substr(1));
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83 else {
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 dir.append(path);
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86
421
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
87 try {
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
88 bfs::path boost_path(dir);
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
89 if (!bfs::exists(boost_path) || !bfs::is_directory(boost_path))
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
90 return list;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91
421
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
92 bfs::directory_iterator end;
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
93 for (bfs::directory_iterator i(boost_path); i != end; ++i) {
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
94 if (bfs::is_directory(*i) != directorys)
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
95 continue;
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96
421
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
97 // This only works with boost 1.34 and up
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
98 // list.insert(i->path().leaf());
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
99 // This one should be ok with both 1.33 and above
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
100 list.insert(i->leaf());
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
101 }
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
102 }
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
103 catch (const bfs::filesystem_error& ex) {
293e812316c0 Fixed a bug where the editor would exit because of a boost exception when browsing to a directory that the user does not have access to. The vfs now catches the boost exception and throws a FIFE exception. Updated the filebrowser to catch the exception and display a warning to the user. fixes[t:413]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 390
diff changeset
104 throw Exception(ex.what());
0
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 return list;
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 }
4a0efb7baf70 * Datasets becomes the new trunk and retires after that :-)
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109 }