Function kiwix::getDataDirectory

Function Documentation

std::string kiwix::getDataDirectory()

Return the data directory.

The data directory is a directory where to put data (zim files, …) It depends of the platform and it may be changed by user using environment variable.

The resolution order is :

  • KIWIX_DATA_DIR env variable (if set).

  • On Windows : . $APPDATA/kiwix if $APPDATA is set . $USERPROFILE/kiwix if $USERPROFILE is set

  • Else : . $XDG_DATA_HOME/kiwixif $XDG_DATA_HOME is set . $HOME/.local/share/kiwx if $HOWE is set

  • current directory

Returns

the path of the data directory (utf8 encoded)