Utilities
Utilities header only library
CheckUserRights.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef UTILS_CHECK_USER_RIGHTS_H
7 #define UTILS_CHECK_USER_RIGHTS_H
8 #include <fstream>
9 
10 #include <Utils/Filesystem.h>
11 
12 namespace utils
13 {
17  [[nodiscard]]
19  {
20  const auto testfile_name = "tester.txt";
21  if (std::ofstream(testfile_name).good())
22  {
23  fs::FileRemove(testfile_name);
24  return true;
25  }
26  return false;
27  }
28 }
29 #endif /* !UTILS_CHECK_USER_RIGHTS_H */
bool HasPermissionToWriteHere()
Function returns if the current user has the right to write into the project directory.
Definition: CheckUserRights.h:18
bool FileRemove(const std::string &file)
Deletes a specified file from the system. Deleted file will not appear in recycle bin...
Definition: Filesystem.h:64
General namespace for utilities.
Definition: BulletConversions.h:9