2019-12-11 12:10 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000681Spring engineGeneralpublic2007-11-15 00:24
Reportertc 
Assigned Totvo 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000681: [patch] ConfigHandler access from Unitsync
DescriptionThis patch lets unitsync access Spring's configuration file using the ConfigHandler interface.
Additional InformationSettings++ already has code that uses these functions to access the config. This makes life easier because Settings++ will not have to depend on the Spring source directly. It will also be used by SpringLobby in the near future to integrate Setting++ and also some other features.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon unitsync_confighandler.patch (2,227 bytes) 2007-11-14 01:02 -
    Index: tools/unitsync/unitsync.cpp
    ===================================================================
    --- tools/unitsync/unitsync.cpp	(revision 4783)
    +++ tools/unitsync/unitsync.cpp	(working copy)
    @@ -1604,3 +1604,74 @@
     void PrintLoadMsg(const char* text)
     {
     }
    +
    +
    +//////////////////////////
    +//////////////////////////
    +
    +/**
    + * @brief get string from Spring configuration
    + * @param name name of key to get
    + * @param defvalue default string value to use if key is not found
    + * @return string value
    + */
    +DLL_EXPORT const char* __stdcall GetSpringConfigString( const char* name, const char* defvalue )
    +{
    +	std::string res = configHandler.GetString( name, defvalue );
    +	return GetStr(res);
    +}
    +
    +/**
    + * @brief get integer from Spring configuration
    + * @param name name of key to get
    + * @param defvalue default integer value to use if key is not found
    + * @return integer value
    + */
    +DLL_EXPORT int __stdcall GetSpringConfigInt( const char* name, const int defvalue )
    +{
    +	return configHandler.GetInt( name, defvalue );
    +}
    +
    +/**
    + * @brief get float from Spring configuration
    + * @param name name of key to get
    + * @param defvalue default float value to use if key is not found
    + * @return float value
    + */
    +DLL_EXPORT float __stdcall GetSpringConfigFloat( const char* name, const float defvalue )
    +{
    +	return configHandler.GetFloat( name, defvalue );
    +}
    +
    +/**
    + * @brief set string in Spring configuration
    + * @param name name of key to set
    + * @param value string value to set
    + */
    +DLL_EXPORT void __stdcall SetSpringConfigString( const char* name, const char* value )
    +{
    +	configHandler.SetString( name, value );
    +}
    +
    +/**
    + * @brief set integer in Spring configuration
    + * @param name name of key to set
    + * @param value integer value to set
    + */
    +DLL_EXPORT void __stdcall SetSpringConfigInt( const char* name, const int value )
    +{
    +	configHandler.SetInt( name, value );
    +}
    +
    +/**
    + * @brief set float in Spring configuration
    + * @param name name of key to set
    + * @param value float value to set
    + * @note this does nothing right now since there is no SetFloat function in ConfigHandler. Is this needed?
    + */
    +DLL_EXPORT void __stdcall SetSpringConfigFloat( const char* name, const float value )
    +{
    +	
    +}
    +
    +
    
    patch file icon unitsync_confighandler.patch (2,227 bytes) 2007-11-14 01:02 +

-Relationships
+Relationships

-Notes

~0001435

tvo (reporter)

Committed, thank you.

I have refactored a bit and implemented SetFloat too.

Any chance you could also write the python bindings or java bindings for these functions?
+Notes

-Issue History
Date Modified Username Field Change
2007-11-14 01:02 tc New Issue
2007-11-14 01:02 tc File Added: unitsync_confighandler.patch
2007-11-14 23:45 tvo Summary ConfigHandler access from Unitsync => [patch] ConfigHandler access from Unitsync
2007-11-14 23:45 tvo Status new => assigned
2007-11-14 23:45 tvo Assigned To => tvo
2007-11-15 00:24 tvo Status assigned => resolved
2007-11-15 00:24 tvo Resolution open => fixed
2007-11-15 00:24 tvo Note Added: 0001435
+Issue History