Added iOS support for loading multiple RAM bundles

Differential Revision: D5850970

fbshipit-source-id: 88ab6fe3822f1bc4195007f8ec83177a84c27569
This commit is contained in:
Alex Dvornikov
2017-09-21 08:51:00 -07:00
committed by Facebook Github Bot
parent 79821917fa
commit 1aeb767a37
8 changed files with 68 additions and 6 deletions
@@ -0,0 +1,26 @@
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include <cxxreact/RAMBundleRegistry.h>
namespace facebook {
namespace react {
class JSIndexedRAMBundleRegistry: public RAMBundleRegistry {
public:
JSIndexedRAMBundleRegistry(
std::unique_ptr<JSModulesUnbundle> mainBundle,
std::string baseDirectoryPath):
RAMBundleRegistry(std::move(mainBundle)), m_baseDirectoryPath(baseDirectoryPath) {}
protected:
virtual std::unique_ptr<JSModulesUnbundle> bundleById(uint32_t index) const override;
private:
std::string bundlePathById(uint32_t index) const;
std::string m_baseDirectoryPath;
};
} // namespace react
} // namespace facebook