Crystal Space
Welcome, Guest. Please login or register.
December 19, 2014, 09:41:56 am

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9289 Members
Latest Member: Kapifryba
* Home Help Search Login Register
+  Crystal Space
|-+  Miscellaneous
| |-+  Article/Tutorial Requests
| | |-+  Tutorial Request: Application Specific Configuration File Usage
« previous next »
Pages: [1] Print
Author Topic: Tutorial Request: Application Specific Configuration File Usage  (Read 5839 times)
willjm
Newbie
*
Posts: 39


View Profile
« on: November 10, 2005, 08:25:41 pm »

I would like to see a tutorial on how to set up an application using a configuration file specified for that application.
Logged
muffinpeddler
Full Member
***
Posts: 122


View Profile Email
« Reply #1 on: November 13, 2005, 08:13:37 am »

Assuming a subclass of csApplicationFramework (for the ReportError)
Code:
        if (!csInitializer::SetupConfigManager (objectRegistry, "/programmount/config.cfg"))
        {
            return ReportError("Unable to init app!");
        } 
That will load a configuration file for your application.  The /programmount/ is a vfs mount point for your application that you put in the file vfs.cfg in the folder of your project.  It might contain something like this (this is an added line in a copy of the default CS vfs.cfg file):
Code:
VFS.Mount.programmount = $*programmountfolder$/
Where the VFS mount is /programmount/ and the actual filesystem name of that directory is programmountfolder. 
Good Luck!
« Last Edit: November 13, 2005, 08:16:26 am by muffinpeddler » Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #2 on: November 14, 2005, 07:14:20 pm »

Excellent! I'll have to give it a try. Thank you!
Logged
willjm
Newbie
*
Posts: 39


View Profile
« Reply #3 on: November 18, 2005, 03:48:11 am »

It worked great! Thanks again!
Logged
muffinpeddler
Full Member
***
Posts: 122


View Profile Email
« Reply #4 on: November 18, 2005, 07:27:12 am »

Hey no problem, glad to see it worked Smiley
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.158 seconds with 17 queries.