commit 551bd7bd
Merge pull request #2 from sago007/nitpicking1
Nitpicking1
Changed files
| M | README.md before |
| M | sago/platform_folders.cpp before |
| M | sago/platform_folders.h before |
diff --git a/README.md b/README.md
index fd2dcfb..2b859e6 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# PlatformFolders [](https://travis-ci.org/sago007/PlatformFolders) [](https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE) [](https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+# PlatformFolders [](https://travis-ci.org/sago007/PlatformFolders) [](https://raw.githubusercontent.com/sago007/PlatformFolders/master/LICENSE) [](https://gitter.im/PlatformFolders/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](https://www.codacy.com/app/github_43/PlatformFolders?utm_source=github.com&utm_medium=referral&utm_content=sago007/PlatformFolders&utm_campaign=Badge_Grade)
A C++ library to look for special directories like "My Documents" and "%APPDATA%" so that you do not need to write Linux, Windows or Mac OS X specific code
Can be found at: https://github.com/sago007/PlatformFolders
diff --git a/sago/platform_folders.cpp b/sago/platform_folders.cpp
index 3fca858..64c1e7c 100644
--- a/sago/platform_folders.cpp
+++ b/sago/platform_folders.cpp
@@ -112,10 +112,10 @@ static void throwOnRelative(const char* envName, const char* envValue) {
}
/**
- * Retrives the effective user's home dir.
- * If the user is running as root we ignore the HOME environment. It works badly with sudo.
+ * Retrives the effective user's home dir.
+ * If the user is running as root we ignore the HOME environment. It works badly with sudo.
* Writing to $HOME as root implies security concerns that a multiplatform program cannot be assumed to handle.
- * @return The home directory. HOME environment is respected for non-root users if it exists.
+ * @return The home directory. HOME environment is respected for non-root users if it exists.
*/
static std::string getHome() {
std::string res;
@@ -260,7 +260,7 @@ static void PlatformFoldersFillData(std::map<std::string, std::string>& folders)
folders["XDG_TEMPLATES_DIR"] = "$HOME/.Templates";
folders["XDG_VIDEOS_DIR"] = "$HOME/Videos";
PlatformFoldersAddFromFile( getConfigHome()+"/user-dirs.dirs", folders);
- for (std::map<std::string, std::string>::iterator itr = folders.begin() ; itr != folders.end() ; itr ++ ) {
+ for (std::map<std::string, std::string>::iterator itr = folders.begin() ; itr != folders.end() ; ++itr ) {
std::string& value = itr->second;
if (value.compare(0, 5, "$HOME") == 0) {
value = getHome() + value.substr(5, std::string::npos);
diff --git a/sago/platform_folders.h b/sago/platform_folders.h
index 4c85283..fc7cade 100644
--- a/sago/platform_folders.h
+++ b/sago/platform_folders.h
@@ -2,7 +2,7 @@
Its is under the MIT license, to encourage reuse by cut-and-paste.
The original files are hosted here: https://github.com/sago007/PlatformFolders
-
+
Copyright (c) 2015 Poul Sander
Permission is hereby granted, free of charge, to any person
@@ -162,11 +162,14 @@ public:
private:
PlatformFolders(const PlatformFolders&);
PlatformFolders& operator=(const PlatformFolders&);
+#if defined(_WIN32)
+#elif defined(__APPLE__)
+#else
struct PlatformFoldersData;
PlatformFoldersData *data;
+#endif
};
} //namespace sago
#endif /* PLATFORM_FOLDERS_H */
-