MCPcopy Create free account
hub / github.com/alibaba/MNN / root

Method root

test/model/MobileNetTest.cpp:203–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201 virtual ~ModelTest() = default;
202
203 std::string root() {
204#ifdef __APPLE__
205 auto bundle = CFBundleGetMainBundle();
206 auto url = CFBundleCopyBundleURL(bundle);
207 auto string = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle);
208 CFRelease(url);
209 auto cstring = CFStringGetCStringPtr(string, kCFStringEncodingUTF8);
210 auto res = std::string(cstring);
211 CFRelease(string);
212 return res;
213#else
214 return "../resource"; // assume run in build dir
215#endif
216 }
217
218 std::string path() {
219 return this->root() + "/model/temp.bin";

Callers 1

pathMethod · 0.95

Calls 1

stringFunction · 0.50

Tested by

no test coverage detected