| 511 | } |
| 512 | |
| 513 | boost::filesystem::path GetDefaultDataDir() |
| 514 | { |
| 515 | namespace fs = boost::filesystem; |
| 516 | // Windows < Vista: C:\Documents and Settings\Username\Application Data\LUX |
| 517 | // Windows >= Vista: C:\Users\Username\AppData\Roaming\LUX |
| 518 | // Mac: ~/Library/Application Support/LUX |
| 519 | // Unix: ~/.lux |
| 520 | #ifdef WIN32 |
| 521 | // Windows |
| 522 | return GetSpecialFolderPath(CSIDL_APPDATA) / "LUX"; |
| 523 | #else |
| 524 | fs::path pathRet; |
| 525 | char* pszHome = getenv("HOME"); |
| 526 | if (pszHome == NULL || strlen(pszHome) == 0) |
| 527 | pathRet = fs::path("/"); |
| 528 | else |
| 529 | pathRet = fs::path(pszHome); |
| 530 | #ifdef MAC_OSX |
| 531 | // Mac |
| 532 | pathRet /= "Library/Application Support"; |
| 533 | TryCreateDirectory(pathRet); |
| 534 | return pathRet / "LUX"; |
| 535 | #else |
| 536 | // Unix |
| 537 | return pathRet / ".lux"; |
| 538 | #endif |
| 539 | #endif |
| 540 | } |
| 541 | |
| 542 | static boost::filesystem::path pathCached; |
| 543 | static boost::filesystem::path pathCachedNetSpecific; |
no test coverage detected