<h3 id="model">Model</h3>
+ <p>
+ The responsibility of the application's "Model" module is to operate directly on the Resource Manager API. The additional benefit of this module is that the simplification of the API function calling,
+ error checking and message logging is performed here.
+ <br>
+ Some of the functions implemented within the "Model" module were briefly described in the <a href="#app-init">Application initialization</a> and <a href="#app-finit">Application termination</a> sections
+ (<span style="font-family: Courier New,Courier,monospace">model_init()</span>, <span style="font-family: Courier New,Courier,monospace">model_finit()</span>,
+ <span style="font-family: Courier New,Courier,monospace">__model_init_app_resource_manager()</span>,
+ <span style="font-family: Courier New,Courier,monospace">__model_release_app_resource_manager()</span>. Other functions are briefly described here.
+ </p>
+
+ <p>
+ The path to the resource file pointed by the <span style="font-family: Courier New,Courier,monospace">type</span> and <span style="font-family: Courier New,Courier,monospace">id</span>
+ is obtained with the <span style="font-family: Courier New,Courier,monospace">model_get_app_resource()</span> function.
+ </p>
+
+<pre class="prettyprint">
+bool model_get_app_resource(app_resource_e type, const char *id, char **path)
+{
+ *path = NULL;
+
+ int ret = app_resource_manager_get(type, id, path);
+ if (ret != APP_RESOURCE_ERROR_NONE) {
+ controller_log(DLOG_ERROR, "Function app_resource_manager_get() failed with error %d.", ret);
+ return false;
+ }
+ return true;
+}
+</pre>
<script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../scripts/showhide.js"></script>