Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » .ini file helpers
Re: .ini file helpers [message #36837 is a reply to message #36834] Tue, 10 July 2012 23:03 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

mirek wrote on Tue, 10 July 2012 22:19

dolik.rce wrote on Tue, 10 July 2012 15:14

1) INI_DOUBLE is missing.


Well, seemed sort of unnecessary...
Well, at my work many different things is configured using configuration files, including doubles, arrays and other weird things Smile

mirek wrote on Tue, 10 July 2012 22:19

dolik.rce wrote on Tue, 10 July 2012 15:14


2) Once you call GetIniKey, the file is loaded and it is not possible to reload configuration. In a daemons/services, it is often desirable to reload config without restarting.



Fair enough, even if I cannot really imagine when I would want to change config (something you do usually a couple of times per month, at most) without restarting. You would have to code your daemon really carefully to allow this... Wink
It is quite common, just look at how many initscripts in /etc/init.d of any linux distro have a reload option Wink

mirek wrote on Tue, 10 July 2012 22:19

INI_* are just top-level encapsulation for GetIniKey.
Could you please explain that? I don't see any relation between these two things. (Maybe I'm just blind Smile )

mirek wrote on Tue, 10 July 2012 22:19

How about this:

void ReloadIniFile()
{
	s_ini_loaded = false;
}

void SetIniFile(const char *name) {
	Mutex::Lock __(sMtx);
	strcpy(sIniFile, name);
	ReloadIniFile();
}

Ok, that would work too Smile

mirek wrote on Tue, 10 July 2012 22:19

IME, guessing value types is difficult AND wrong...
Ok, I take that back. We don't have to guess, we know what the type is Smile At least where programmer tells us with INI_* macro. And if he tells us, it would be IMHO much more logical to serve it to him already converted to correct type.[/quote]

mirek wrote on Tue, 10 July 2012 22:19

INI_DOUBLE added.

BTW, I feel like we would rather need INI_INT64 and make it understand 'K', 'M', 'G' ('T') (like buffer=16M). Adding to RM for now...
I think the functions for suffixes are good idea. Also, allowing hexadecimal numbers would be nice Wink

Honza
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TheIDE now supports JavaScript syntax highlighting for .js file extension
Next Topic: GetIniKey is now disallowed when APP_MAIN is not running
Goto Forum:
  


Current Time: Wed Apr 30 09:36:43 CEST 2025

Total time taken to generate the page: 0.00913 seconds