MCPcopy Create free account
hub / github.com/OpenKinect/libfreenect2 / loadResource

Function loadResource

src/resource.cpp:59–74  ·  view source on GitHub ↗

* Find data of a requested resource. * @param name Name of the resource to retrieve. * @param [out] data Address of the resource data, if found. * @param [out] Length of the resource data, if found. * @return Whether the resource could be retrieved. */

Source from the content-addressed store, hash-verified

57 * @return Whether the resource could be retrieved.
58 */
59bool loadResource(const std::string &name, unsigned char const**data, size_t *length)
60{
61 bool result = false;
62
63 for(int i = 0; i < resource_descriptors_length; ++i)
64 {
65 if(name.compare(resource_descriptors[i].filename) == 0)
66 {
67 *data = resource_descriptors[i].data;
68 *length = resource_descriptors[i].length;
69 result = true;
70 break;
71 }
72 }
73 return result;
74}
75
76/**
77 * Get resource data into a supplied buffer.

Callers 4

loadCLKdeSourceFunction · 0.85
loadShaderSourceFunction · 0.85
loadCLSourceFunction · 0.85
loadBufferFromResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected