PHP 7.4.33
Preview: jsilib.h Size: 1.25 KB
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/react-native/ReactCommon/jsi/jsi/jsilib.h
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <jsi/jsi.h>

namespace facebook {
namespace jsi {

class FileBuffer : public Buffer {
 public:
  FileBuffer(const std::string& path);
  ~FileBuffer() override;

  size_t size() const override {
    return size_;
  }

  const uint8_t* data() const override {
    return data_;
  }

 private:
  size_t size_;
  uint8_t* data_;
};

// A trivial implementation of PreparedJavaScript that simply stores the source
// buffer and URL.
class SourceJavaScriptPreparation final : public jsi::PreparedJavaScript,
                                          public jsi::Buffer {
  std::shared_ptr<const jsi::Buffer> buf_;
  std::string sourceURL_;

 public:
  SourceJavaScriptPreparation(
      std::shared_ptr<const jsi::Buffer> buf,
      std::string sourceURL)
      : buf_(std::move(buf)), sourceURL_(std::move(sourceURL)) {}

  const std::string& sourceURL() const {
    return sourceURL_;
  }

  size_t size() const override {
    return buf_->size();
  }
  const uint8_t* data() const override {
    return buf_->data();
  }
};

} // namespace jsi
} // namespace facebook

Directory Contents

Dirs: 1 × Files: 12
Name Size Perms Modified Actions
test DIR
- drwxr-xr-x 2025-03-28 11:04:41
Edit Download
909 B lrw-r--r-- 2025-03-28 11:04:43
Edit Download
29.00 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
5.10 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
10.41 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
19.54 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
58.65 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
6.18 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
634 B lrw-r--r-- 2025-03-28 11:04:41
Edit Download
2.26 KB lrw-r--r-- 2025-03-28 11:04:39
Edit Download
598 B lrw-r--r-- 2025-03-28 11:04:39
Edit Download
1.25 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
1.64 KB lrw-r--r-- 2025-03-28 11:04:41
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).