Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
deprecated-irrlicht-mac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
deprecated-irrlicht-mac
Commits
f6662bff
Commit
f6662bff
authored
Sep 10, 2011
by
hybrid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
5c67d339
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
include/IFileSystem.h
include/IFileSystem.h
+8
-2
tests/archiveReader.cpp
tests/archiveReader.cpp
+42
-0
No files found.
include/IFileSystem.h
View file @
f6662bff
...
...
@@ -156,8 +156,14 @@ public:
//! Removes an archive from the file system.
/** This will close the archive and free any file handles, but will not
close resources which have already been loaded and are now cached, for
example textures and meshes.
\param filename The archive of the given name will be removed
example textures and meshes. Note that a relative filename might be
interpreted differently on each call, depending on the current working
directory. In case you want to remove an archive that was added using
a relative path name, you have to change to the same working directory
again. This means, that the filename given on creation is not an identifier
for the archive, but just a usual filename that is used for locating the
archive to work with.
\param filename The archive pointed to by the name will be removed
\return True on success, false on failure */
virtual
bool
removeFileArchive
(
const
path
&
filename
)
=
0
;
...
...
tests/archiveReader.cpp
View file @
f6662bff
...
...
@@ -4,6 +4,9 @@ using namespace irr;
using
namespace
core
;
using
namespace
io
;
namespace
{
bool
testArchive
(
IFileSystem
*
fs
,
const
io
::
path
&
archiveName
)
{
// make sure there is no archive mounted
...
...
@@ -387,6 +390,43 @@ static bool testMountFile(IFileSystem* fs)
return
result
;
}
bool
testAddRemove
(
IFileSystem
*
fs
,
const
io
::
path
&
archiveName
)
{
// make sure there is no archive mounted
if
(
fs
->
getFileArchiveCount
()
)
{
logTestString
(
"Already mounted archives found
\n
"
);
return
false
;
}
if
(
!
fs
->
addFileArchive
(
archiveName
,
/*bool ignoreCase=*/
true
,
/*bool ignorePaths=*/
false
)
)
{
logTestString
(
"Mounting archive failed
\n
"
);
return
false
;
}
// make sure there is an archive mounted
if
(
!
fs
->
getFileArchiveCount
()
)
{
logTestString
(
"Mounted archive not in list
\n
"
);
return
false
;
}
if
(
!
fs
->
removeFileArchive
(
archiveName
))
{
logTestString
(
"Couldn't remove archive.
\n
"
);
return
false
;
}
// make sure there is no archive mounted
if
(
fs
->
getFileArchiveCount
()
)
return
false
;
return
true
;
}
}
bool
archiveReader
()
{
IrrlichtDevice
*
device
=
irr
::
createDevice
(
video
::
EDT_NULL
,
dimension2d
<
u32
>
(
1
,
1
));
...
...
@@ -418,6 +458,8 @@ bool archiveReader()
ret
&=
testSpecialZip
(
fs
,
"media/lzmadata.zip"
,
"tahoma10_.xml"
,
buf
);
// logTestString("Testing complex mount file.\n");
// ret &= testMountFile(fs);
logTestString
(
"Testing add/remove with filenames.
\n
"
);
testAddRemove
(
fs
,
"media/file_with_path.zip"
);
device
->
closeDevice
();
device
->
run
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment