Utility functions for working with NodeDirectories.
More...
#include <NodeDirectories.h>
|
| static NodeDirectories | GetDefaultNodeDirectories (const boost::shared_ptr< RobotRaconteurNode > &node=boost::shared_ptr< RobotRaconteurNode >()) |
| | Get the Default Node Directories object.
|
| static std::string | GetLogonUserName () |
| | Get the logon name of the current user.
|
| static bool | IsLogonUserRoot () |
| | Returns true if user is root.
|
| static bool | ReadInfoFile (const boost::filesystem::path &fname, std::map< std::string, std::string > &data) |
| | Create directories with user permissions.
|
| static boost::shared_ptr< NodeDirectoriesFD > | CreatePidFile (const boost::filesystem::path &path) |
| | Create a pid file.
|
| static boost::shared_ptr< NodeDirectoriesFD > | CreateInfoFile (const boost::filesystem::path &path, std::map< std::string, std::string > info) |
| | Create an info file with key-value pairs.
|
| static void | RefreshInfoFile (const boost::shared_ptr< NodeDirectoriesFD > &h_info, const std::map< std::string, std::string > &updated_info) |
| | Update key-value pairs in a file created with CreateInfoFile().
|
Utility functions for working with NodeDirectories.
◆ CreateInfoFile()
| boost::shared_ptr< NodeDirectoriesFD > RobotRaconteur::NodeDirectoriesUtil::CreateInfoFile |
( |
const boost::filesystem::path & | path, |
|
|
std::map< std::string, std::string > | info ) |
|
static |
Create an info file with key-value pairs.
The file will be locked for writing. The file will be deleted and unlocked when handle is destroyed.
- Parameters
-
| path | The info filename |
| info | The key-value pairs to write to the file. |
- Returns
- RR_SHARED_PTR<NodeDirectoriesFD> Handle to pid file. Destroy to delete and release the file lock.
◆ CreatePidFile()
| boost::shared_ptr< NodeDirectoriesFD > RobotRaconteur::NodeDirectoriesUtil::CreatePidFile |
( |
const boost::filesystem::path & | path | ) |
|
|
static |
Create a pid file.
Creates a file with the current program's pid. The file will also be locked for writing. The file will be deleted and unlocked when handle is destroyed.
- Parameters
-
| path | The pid file filename |
- Returns
- RR_SHARED_PTR<NodeDirectoriesFD> Handle to pid file. Destroy to delete and release the file lock.
◆ GetDefaultNodeDirectories()
Get the Default Node Directories object.
- Parameters
-
| node | The node to send logging information (optional) |
| create_user_dirs | Create user directories if they don't exist (optional) |
- Returns
- NodeDirectories The default node directories
◆ GetLogonUserName()
| std::string RobotRaconteur::NodeDirectoriesUtil::GetLogonUserName |
( |
| ) |
|
|
static |
Get the logon name of the current user.
- Returns
- std::string
◆ IsLogonUserRoot()
| bool RobotRaconteur::NodeDirectoriesUtil::IsLogonUserRoot |
( |
| ) |
|
|
static |
Returns true if user is root.
- Returns
- true
-
false
◆ ReadInfoFile()
| bool RobotRaconteur::NodeDirectoriesUtil::ReadInfoFile |
( |
const boost::filesystem::path & | fname, |
|
|
std::map< std::string, std::string > & | data ) |
|
static |
Create directories with user permissions.
Parent directories are created, existing directories ignored
- Parameters
-
| dir | The directories tree to create |
Create directories with private system permissions
Parent directories are created, existing directories ignored
- Parameters
-
| dir | The directories tree to create |
Create directories with public system permissions
Parent directories are created, existing directories ignored Typically these directories will allow the "robotraconteur" group ("RobotRaconteur" on Windows) access.
- Parameters
-
| dir | The directories tree to create |
Create a directory with user run permissions
- Parameters
-
| node_dirs | The directories to create |
Read an info file with key-value pairs
- Parameters
-
| fname | The file to read |
| data | (out) The map to fill with read values |
- Returns
- true Success
-
false Failure
◆ RefreshInfoFile()
| void RobotRaconteur::NodeDirectoriesUtil::RefreshInfoFile |
( |
const boost::shared_ptr< NodeDirectoriesFD > & | h_info, |
|
|
const std::map< std::string, std::string > & | updated_info ) |
|
static |
Update key-value pairs in a file created with CreateInfoFile().
Replaces key-value pairs in a file opened with CreateInfoFile()
- Parameters
-
| h_info | Handle to the opened info file |
| updated_info | Key-value pairs to replace in the info file. |
The documentation for this class was generated from the following file:
- /builddir/build/BUILD/robotraconteur-1.2.8-build/RobotRaconteur-1.2.8-Source/RobotRaconteurCore/include/RobotRaconteur/NodeDirectories.h