g_get_system_data_dirs函數(機器翻譯)

g_get_system_data_dirs ()

const gchar* const * g_get_system_data_dirs             (void);

Returns an ordered list of base directories in which to access system-wide application data.

On UNIX platforms this is determined using the mechanisms described in the XDG Base Directory Specification In this case the list of directories retrieved will be XDG_DATA_DIRS.

On Windows the first elements in the list are the Application Data and Documents folders for All Users. (These can be determined only on Windows 2000 or later and are not present in the list on other Windows versions.) See documentation for CSIDL_COMMON_APPDATA and CSIDL_COMMON_DOCUMENTS.

Then follows the "share" subfolder in the installation folder for the package containing the DLL that calls this function, if it can be determined.

Finally the list contains the "share" subfolder in the installation folder for GLib, and in the installation folder for the package the application's .exe file belongs to.

The installation folders above are determined by looking up the folder where the module (DLL or EXE) in question is located. If the folder's name is "bin", its parent is used, otherwise the folder itself.

Note that on Windows the returned list can vary depending on where this function is called.

Returns :

a NULL-terminated array of strings owned by GLib that must not be modified or freed.

Since 2.6

 


在UNIX平臺上,這是使用XDG基本目錄規範中描述的機制確定的。在這種情況下,檢索到的目錄列表將爲XDG_DATA_DIRS。

在Windows上,列表中的第一個元素是“所有用戶”的“應用程序數據”和“文檔”文件夾。 (這些只能在Windows 2000或更高版本上確定,並且在其他Windows版本的列表中不存在。)請參閱CSIDL_COMMON_APPDATA和CSIDL_COMMON_DOCUMENTS的文檔。

然後,如果可以確定,則在安裝文件夾中的“共享”子文件夾中包含包含調用此函數的DLL的軟件包。

最後,該列表在GLib的安裝文件夾中以及應用程序的.exe文件所屬的軟件包的安裝文件夾中包含“ share”子文件夾。

上面的安裝文件夾是通過查找相關模塊(DLL或EXE)所在的文件夾確定的。如果文件夾的名稱爲“ bin”,則使用其父文件夾,否則使用文件夾本身。

請注意,在Windows上,返回的列表可能會有所不同,具體取決於調用此函數的位置。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章