forked from WolvenKit/WolvenKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArchiveLoader.cpp
68 lines (53 loc) · 1.55 KB
/
ArchiveLoader.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "stdafx.h"
#include "ArchiveLoader.h"
#include "FileArchive.h"
#include "ReadFile.h"
#include "ReferenceCounted.h"
using namespace irr;
using namespace System;
using namespace IrrlichtLime::Core;
namespace IrrlichtLime {
namespace IO {
ArchiveLoader^ ArchiveLoader::Wrap(io::IArchiveLoader* ref)
{
if (ref == nullptr)
return nullptr;
return gcnew ArchiveLoader(ref);
}
ArchiveLoader::ArchiveLoader(io::IArchiveLoader* ref)
: ReferenceCounted(ref)
{
m_ArchiveLoader = ref;
}
FileArchive^ ArchiveLoader::CreateArchive(String^ filename, bool ignoreCase, bool ignorePaths)
{
LIME_ASSERT(filename != nullptr);
io::IFileArchive* a = m_ArchiveLoader->createArchive(
Lime::StringToPath(filename),
ignoreCase,
ignorePaths);
return FileArchive::Wrap(a);
}
FileArchive^ ArchiveLoader::CreateArchive(ReadFile^ file, bool ignoreCase, bool ignorePaths)
{
LIME_ASSERT(file != nullptr);
io::IFileArchive* a = m_ArchiveLoader->createArchive(file->m_ReadFile, ignoreCase, ignorePaths);
return FileArchive::Wrap(a);
}
bool ArchiveLoader::IsALoadableFileFormat(String^ filename)
{
LIME_ASSERT(filename != nullptr);
return m_ArchiveLoader->isALoadableFileFormat(
Lime::StringToPath(filename));
}
bool ArchiveLoader::IsALoadableFileFormat(ReadFile^ file)
{
LIME_ASSERT(file != nullptr);
return m_ArchiveLoader->isALoadableFileFormat(file->m_ReadFile);
}
bool ArchiveLoader::IsALoadableFileFormat(FileArchiveType fileType)
{
return m_ArchiveLoader->isALoadableFileFormat((io::E_FILE_ARCHIVE_TYPE)fileType);
}
} // end namespace IO
} // end namespace IrrlichtLime