Skip to content

Commit cf5fec1

Browse files
committed
reverted core to std on vector usages
1 parent 806a43e commit cf5fec1

File tree

8 files changed

+10
-11
lines changed

8 files changed

+10
-11
lines changed

include/nbl/system/CFileArchive.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,10 @@ class CFileArchive : public IFileArchive
105105
}
106106

107107
protected:
108-
CFileArchive(path&& _defaultAbsolutePath, system::logger_opt_smart_ptr&& logger, core::vector<SFileList::SEntry> _items) :
108+
CFileArchive(path&& _defaultAbsolutePath, system::logger_opt_smart_ptr&& logger, std::vector<SFileList::SEntry>* _items) :
109109
IFileArchive(std::move(_defaultAbsolutePath),std::move(logger))
110110
{
111-
//should _items be rvalue reference?
112-
auto itemsSharedPtr = std::make_shared<core::vector<IFileArchive::SFileList::SEntry>>(std::move(_items));
111+
auto itemsSharedPtr = std::make_shared<std::vector<IFileArchive::SFileList::SEntry>>(std::move(_items));
113112
std::sort(itemsSharedPtr->begin(), itemsSharedPtr->end());
114113
m_items.store(itemsSharedPtr);
115114

include/nbl/system/IFileArchive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class IFileArchive : public core::IReferenceCounted
6565
return pathRelativeToArchive < other.pathRelativeToArchive;
6666
}
6767
};
68-
using refctd_storage_t = std::shared_ptr<const core::vector<SEntry>>;
68+
using refctd_storage_t = std::shared_ptr<const std::vector<SEntry>>;
6969
using range_t = core::SRange<const SEntry>;
7070

7171
inline operator range_t() const { return m_range; }

src/nbl/system/CAPKResourcesArchive.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ CAPKResourcesArchive::CAPKResourcesArchive(const path& _path, system::logger_opt
1212
{
1313
}
1414

15-
core::vector<IFileArchive::SFileList::SEntry> CAPKResourcesArchive::computeItems(const std::string& asset_path, ANativeActivity* activity, JNIEnv* jniEnv)
15+
std::vector<IFileArchive::SFileList::SEntry> CAPKResourcesArchive::computeItems(const std::string& asset_path, ANativeActivity* activity, JNIEnv* jniEnv)
1616
{
1717
auto context_object = activity->clazz;
1818
auto getAssets_method = jniEnv->GetMethodID(jniEnv->GetObjectClass(context_object), "getAssets", "()Landroid/content/res/AssetManager;");
@@ -27,7 +27,7 @@ core::vector<IFileArchive::SFileList::SEntry> CAPKResourcesArchive::computeItems
2727

2828
auto length = jniEnv->GetArrayLength(files_object);
2929

30-
core::vector<IFileArchive::SFileList::SEntry> result;
30+
std::vector<IFileArchive::SFileList::SEntry> result;
3131
for (decltype(length) i=0; i<length; i++)
3232
{
3333
jstring jstr = (jstring)jniEnv->GetObjectArrayElement(files_object,i);

src/nbl/system/CArchiveLoaderTar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ core::smart_refctd_ptr<IFileArchive> CArchiveLoaderTar::createArchive_impl(core:
9898
if (!file || !(file->getFlags()&IFileBase::ECF_MAPPABLE))
9999
return nullptr;
100100

101-
core::vector<IFileArchive::SFileList::SEntry> items;
101+
std::vector<IFileArchive::SFileList::SEntry> items;
102102
for (size_t pos=0ull; true; )
103103
{
104104
STarHeader fHead;

src/nbl/system/CArchiveLoaderTar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CArchiveLoaderTar final : public IArchiveLoader
1414
class CArchive final : public CFileArchive
1515
{
1616
public:
17-
CArchive(core::smart_refctd_ptr<IFile>&& _file, system::logger_opt_smart_ptr&& logger, core::vector<SFileList::SEntry>&& _items) :
17+
CArchive(core::smart_refctd_ptr<IFile>&& _file, system::logger_opt_smart_ptr&& logger, std::vector<SFileList::SEntry>&& _items) :
1818
CFileArchive(path(_file->getFileName()),std::move(logger),std::move(_items)), m_file(std::move(_file)) {}
1919

2020
protected:

src/nbl/system/CArchiveLoaderZip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ core::smart_refctd_ptr<IFileArchive> CArchiveLoaderZip::createArchive_impl(core:
106106
return nullptr;
107107
}
108108

109-
core::vector<IFileArchive::SFileList::SEntry> items;
109+
std::vector<IFileArchive::SFileList::SEntry> items;
110110
core::vector<SZIPFileHeader> itemsMetadata;
111111
// load file entries
112112
{

src/nbl/system/CArchiveLoaderZip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class CArchiveLoaderZip final : public IArchiveLoader
3939
CArchive(
4040
core::smart_refctd_ptr<IFile>&& _file,
4141
system::logger_opt_smart_ptr&& logger,
42-
core::vector<SFileList::SEntry>&& _items,
42+
std::vector<SFileList::SEntry>&& _items,
4343
core::vector<SZIPFileHeader>&& _itemsMetadata
4444
) : CFileArchive(path(_file->getFileName()),std::move(logger),std::move(_items)),
4545
m_file(std::move(_file)), m_itemsMetadata(std::move(_itemsMetadata)), m_password("")

src/nbl/system/CMountDirectoryArchive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CMountDirectoryArchive : public IFileArchive
4242

4343
void populateItemList(const path& p) const {
4444
auto items = m_system->listItemsInDirectory(m_defaultAbsolutePath/p);
45-
auto new_entries = std::make_shared<core::vector<SFileList::SEntry>>();
45+
auto new_entries = std::make_shared<std::vector<SFileList::SEntry>>();
4646
for (auto item : items)
4747
{
4848
if (item.has_extension())

0 commit comments

Comments
 (0)