cancel
Showing results for 
Search instead for 
Did you mean: 

Kernel Functions

trinitytest
Honored Guest
I'm working with strings in a native app, and there's this ScanFilePath function in the OVR_String_PathUtil.cpp file, which appears to exist in the libovrkernel.a, however I can't find it in an include file, thus I'm having a hard time using the function in my program.

Am I missing an include file?

Thanks
3 REPLIES 3

jerrytian
Protege
Oculus Mobile SDK distributes its own object system, i.e, your mentioned string, and threading stuff.

Though not that convenient if you are just familiar with standard library, it is still easy to locate them because it is relatively organized, and the API design principle is the same.

jerry:ovr_sdk_mobile_1.0.0.0$ find . -name "*String*"
./LibOVRKernel/Src/Kernel/OVR_String_Utils.h
./LibOVRKernel/Src/Kernel/OVR_StringHash.h
./LibOVRKernel/Src/Kernel/OVR_String.h
./LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp
./LibOVRKernel/Src/Kernel/OVR_String_FormatUtil.cpp
./LibOVRKernel/Src/Kernel/OVR_String.cpp

trinitytest
Honored Guest
Thanks for the quick reply.

I did an explicit search for the function:

user@machine:~/usr/local/gearvr_1.0.0.0$ egrep -r "ScanFilePath"
Binary file bin/Mac/FbxConvert/FbxConvert matches
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp:void ScanFilePath(const char* url, const char** pfilename, const char** pext)
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp:void ScanFilePath2(const char* url, const char** pfilename, const char** pext)
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(path, 0, &ext);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), &filename, 0);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), &filename, 0);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), 0, &ext);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), 0, &ext);
Binary file LibOVRKernel/Libs/Android/armeabi-v7a/libovrkernel.a matches


But it doesn't seem to be declared in any header file.
Can you find it in your source? I re-extracted mine, but still couldn't find it.

jerrytian
Protege
Yes, you are right, after a little bit deep searching, there is no header defined for this, only in source cpp file, maybe purposely designed as a private function? However, if you still try to use it, you can just add a header yourself.


jerry:ovr_sdk_mobile_1.0.0.0$ global ScanFilePath
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp


By the way, I think it is more technically right, to load local resource using these utilities provided in SDK, if that is what you want to to. The code is modified from 360PhotoSDK project.


const OvrStoragePaths & paths = app->GetStoragePaths();

paths.PushBackSearchPathIfValid( EST_SECONDARY_EXTERNAL_STORAGE, EFT_ROOT, "a_folder/", SearchPaths );
paths.PushBackSearchPathIfValid( EST_SECONDARY_EXTERNAL_STORAGE, EFT_ROOT, "", SearchPaths );
paths.PushBackSearchPathIfValid( EST_PRIMARY_EXTERNAL_STORAGE, EFT_ROOT, "a_folder/", SearchPaths );
paths.PushBackSearchPathIfValid( EST_PRIMARY_EXTERNAL_STORAGE, EFT_ROOT, "", SearchPaths );

....

String realFilePath;
if ( GetFullPath( paths, "a_file_name", realFilePath ) )
{
LOG("real file full path: %s", realFilePath.ToCStr());
}
else
{
LOG( "file not found." );
}



"trinitytest" wrote:
Thanks for the quick reply.

I did an explicit search for the function:

user@machine:~/usr/local/gearvr_1.0.0.0$ egrep -r "ScanFilePath"
Binary file bin/Mac/FbxConvert/FbxConvert matches
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp:void ScanFilePath(const char* url, const char** pfilename, const char** pext)
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp:void ScanFilePath2(const char* url, const char** pfilename, const char** pext)
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(path, 0, &ext);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), &filename, 0);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), &filename, 0);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), 0, &ext);
LibOVRKernel/Src/Kernel/OVR_String_PathUtil.cpp: ScanFilePath(ToCStr(), 0, &ext);
Binary file LibOVRKernel/Libs/Android/armeabi-v7a/libovrkernel.a matches


But it doesn't seem to be declared in any header file.
Can you find it in your source? I re-extracted mine, but still couldn't find it.