Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using C++ to access Documents folder on iOS

Tags:

c++

ios

I'm wondering if there is a way to get a reference to the Documents folder on iOS using just C++ (i.e. WITHOUT using ANY code in Objective-C; this because it is a framework implemented only in C++ that can be add as a library in a iOS project).

Please, if it is possible, provide code in your answer.

like image 395
reinaldoluckman Avatar asked Jun 25 '26 02:06

reinaldoluckman


1 Answers

With code below I able to access cache folder in my app. I think, documents folder in "/Library/Documents", or somewere else.

char *home = getenv("HOME");
char *subdir = "/Library/Caches/subdir";

home + subdir = full path

Next, with full path, you can do usual things to read/write in C++

like image 175
asukharev Avatar answered Jun 26 '26 17:06

asukharev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!