getSettingFileFullPath.m 915 B

12345678910111213141516171819202122232425262728293031
  1. function settingFileFullPath = getSettingFileFullPath(functionName)
  2. % settingFileFullPath
  3. %
  4. % Returns the full path of the settings file.
  5. %
  6. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7. % Version History
  8. %
  9. % 1.0.0.0:
  10. % - Initial release.
  11. %
  12. % 1.1.0.0:
  13. % - Updated to support unix file system.
  14. %
  15. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  16. settingFileFullPath = which(functionName);
  17. if ~isempty(settingFileFullPath)
  18. settingFilePath = fileparts(settingFileFullPath);
  19. if ismac || isunix
  20. settingFileFullPath = [settingFilePath '/' functionName '.ini'];
  21. elseif isunix
  22. settingFileFullPath = [settingFilePath '/' functionName '.ini'];
  23. else
  24. settingFileFullPath = [settingFilePath '\' functionName '.ini'];
  25. end
  26. else
  27. disp('Function not valid.');
  28. settingFileFullPath = [];
  29. end