#include <file_loader.h>
Public Member Functions | |
| FileLoader (int dirfd=-1) | |
| ~FileLoader () | |
| bool | LoadPackagesMap (const std::string &packages) |
| const std::string & | packages () const |
| Dart_Handle | HandleLibraryTag (Dart_LibraryTag tag, Dart_Handle library, Dart_Handle url) |
| Dart_Handle | CanonicalizeURL (Dart_Handle library, Dart_Handle url) |
| Dart_Handle | Import (Dart_Handle url) |
| Dart_Handle | Kernel (Dart_Handle url) |
| void | SetPackagesUrl (Dart_Handle url) |
| Dart_Handle | FetchBytes (const std::string &url, uint8_t *&buffer, intptr_t &buffer_size) |
Static Public Attributes | |
| static const char | kFileURLPrefix [] = "file://" |
| static const size_t | kFileURLPrefixLength |
| static const std::string | kPathSeparator = "/" |
Definition at line 19 of file file_loader.h.
|
explicit |
Definition at line 49 of file file_loader.cc.
| tonic::FileLoader::~FileLoader | ( | ) |
Definition at line 51 of file file_loader.cc.
| Dart_Handle tonic::FileLoader::CanonicalizeURL | ( | Dart_Handle | library, |
| Dart_Handle | url | ||
| ) |
Definition at line 133 of file file_loader.cc.
References filesystem::GetDirectoryName(), kPathSeparator, filesystem::SimplifyPath(), tonic::StdStringFromDart(), and tonic::StdStringToDart().
Referenced by HandleLibraryTag().
| Dart_Handle tonic::FileLoader::FetchBytes | ( | const std::string & | url, |
| uint8_t *& | buffer, | ||
| intptr_t & | buffer_size | ||
| ) |
Definition at line 161 of file file_loader.cc.
References filesystem::GetAbsoluteFilePath(), filesystem::ReadFileToBytes(), and filesystem::SimplifyPath().
| Dart_Handle tonic::FileLoader::HandleLibraryTag | ( | Dart_LibraryTag | tag, |
| Dart_Handle | library, | ||
| Dart_Handle | url | ||
| ) |
Definition at line 118 of file file_loader.cc.
References CanonicalizeURL(), Import(), Kernel(), and TONIC_DCHECK.
Referenced by tonic::DartState::HandleLibraryTag().
| Dart_Handle tonic::FileLoader::Import | ( | Dart_Handle | url | ) |
Definition at line 186 of file file_loader.cc.
References FetchBytes(), and tonic::StdStringFromDart().
Referenced by HandleLibraryTag().
| Dart_Handle tonic::FileLoader::Kernel | ( | Dart_Handle | url | ) |
Definition at line 205 of file file_loader.cc.
References FetchBytes(), and tonic::StdStringFromDart().
Referenced by HandleLibraryTag().
| bool tonic::FileLoader::LoadPackagesMap | ( | const std::string & | packages | ) |
Definition at line 79 of file file_loader.cc.
References error, tonic::Log(), and packages().
Referenced by SetPackagesUrl().
|
inline |
Definition at line 27 of file file_loader.h.
Referenced by LoadPackagesMap(), and SetPackagesUrl().
| void tonic::FileLoader::SetPackagesUrl | ( | Dart_Handle | url | ) |
Definition at line 220 of file file_loader.cc.
References LoadPackagesMap(), packages(), and tonic::StdStringFromDart().
|
static |
Definition at line 42 of file file_loader.h.
|
static |
Definition at line 43 of file file_loader.h.
|
static |
Definition at line 44 of file file_loader.h.
Referenced by CanonicalizeURL().