]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/Import/include/FMI/fmi_import_util.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / Import / include / FMI / fmi_import_util.h
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
7      This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     FMILIB_License.txt file for more details.
11
12     You should have received a copy of the FMILIB_License.txt file
13     along with this program. If not, contact Modelon AB <http://www.modelon.com>.
14 */\r
15 \r
16 #ifndef FMI1_IMPORT_UTIL_H_\r
17 #define FMI1_IMPORT_UTIL_H_\r
18 \r
19 #include <JM/jm_callbacks.h>\r
20 \r
21 #ifdef __cplusplus\r
22 extern "C" {\r
23 #endif\r
24 /**\r
25 \addtogroup  fmi_import_utils Utility functions supporting interactions with the library\r
26 @{\r
27 */\r
28 /** \r
29         \brief Create a unique temporary directory\r
30         \param cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.\r
31         \param systemTempDir - directory where the temp dir should be located both absolute and relative path are accepted.\r
32                                 System-wide directory is used if this parameter is NULL.\r
33         \param tempPrefix - File name template prefix used when creating temporaty directories. "fmil" is used if this is NULL.\r
34         \return A pointer to the temporary directory name (absolute path, no terminating '/'). Caller is responsible for freeing the memory.\r
35                 The function returns NULL if there were errors in which case a message is send to the logger.   \r
36 */\r
37 FMILIB_EXPORT char* fmi_import_mk_temp_dir(jm_callbacks* cb, const char* systemTempDir, const char* tempPrefix);\r
38 \r
39 /**\r
40 \brief Remove directory and all it contents.\r
41         \param cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.\r
42         \param dir - path to be removed.\r
43         \return Statuc success or error.\r
44 */\r
45 FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir(jm_callbacks* cb, const char* dir);\r
46 \r
47 /** \r
48         \brief Create a file:// URL from absolute path\r
49         \param cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.\r
50         \param absPath - absolute path to be converted into the URL\r
51         \return A pointer to the URL. Caller is responsible for freeing the memory.\r
52                 The function returns NULL if there were errors in which case a message is send to the logger.   \r
53 */\r
54 FMILIB_EXPORT char* fmi_import_create_URL_from_abs_path(jm_callbacks* cb, const char* absPath);\r
55 \r
56 /** Given directory name fmu_unzipped_path and model identifier consturct Dll/so name\r
57         @return Pointer to a string with the file name. Caller is responsible for freeing the memory.\r
58 */\r
59 FMILIB_EXPORT char* fmi_import_get_dll_path(const char* fmu_unzipped_path, const char* model_identifier, jm_callbacks* callBackFunctions);\r
60 \r
61 /** Given directory name fmu_unzipped_path and model identifier consturct XML file name\r
62         @return Pointer to a string with the file name. Caller is responsible for freeing the memory.\r
63 */\r
64 FMILIB_EXPORT char* fmi_import_get_model_description_path(const char* fmu_unzipped_path, jm_callbacks* callBackFunctions);\r
65 /**\r
66 @}\r
67 @}\r
68 */\r
69 #ifdef __cplusplus\r
70 }\r
71 #endif\r
72 \r
73 #endif /* End of header file FMI1_IMPORT_UTIL_H_ */