| Index: runtime/bin/resources.h
|
| ===================================================================
|
| --- runtime/bin/resources.h (revision 0)
|
| +++ runtime/bin/resources.h (revision 0)
|
| @@ -0,0 +1,55 @@
|
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
| +// for details. All rights reserved. Use of this source code is governed by a
|
| +// BSD-style license that can be found in the LICENSE file.
|
| +
|
| +#ifndef BIN_RESOURCES_H_
|
| +#define BIN_RESOURCES_H_
|
| +
|
| +#include <stddef.h>
|
| +#include <string.h>
|
| +
|
| +class Resources {
|
| + public:
|
| + static const int kNoSuchInstance = -1;
|
| +
|
| + static int ResourceLookup(const char* path, const char** resource) {
|
| + for (unsigned i = 0; i < get_resource_count(); i++) {
|
| + resource_map_entry* entry = get_resource(i);
|
| + if (!strcmp(path, entry->path_)) {
|
| + *resource = entry->resource_;
|
| + return entry->length_;
|
| + }
|
| + }
|
| + return kNoSuchInstance;
|
| + }
|
| +
|
| + private:
|
| + static const char bargraph_dart_[];
|
| + static const char chart_dart_[];
|
| + static const char favicon_ico_[];
|
| + static const char isolate_list_dart_[];
|
| + static const char models_dart_[];
|
| + static const char packages_browser_dart_js_[];
|
| + static const char server_access_dart_[];
|
| + static const char vmstats_css_[];
|
| + static const char vmstats_dart_[];
|
| + static const char vmstats_html_[];
|
| +
|
| + typedef struct {
|
| + const char* path_;
|
| + const char* resource_;
|
| + size_t length_;
|
| + } resource_map_entry;
|
| +
|
| + // These fields are generated by resources_gen.cc.
|
| + static resource_map_entry builtin_resources_[];
|
| + static const size_t builtin_resources_count_;
|
| +
|
| + static resource_map_entry* get_resource(int i) {
|
| + return builtin_resources_ + i;
|
| + }
|
| +
|
| + static size_t get_resource_count() { return builtin_resources_count_; }
|
| +};
|
| +
|
| +#endif // BIN_RESOURCES_H_
|
|
|