BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
System.h
Go to the documentation of this file.
1// Copyright 2013 Jan de Cuveland <cmail@cuveland.de>
2/// \file
3/// \brief Defines utility functions in the fles::system namespace.
4#ifndef FLES_SYSTEM_H
5#define FLES_SYSTEM_H
6
7#include <string>
8
9namespace fles
10{
11/// Namespace for system-related utilty functions.
12namespace system
13{
14/**
15 * \brief Textual description of system error messages.
16 *
17 * This is a thin C++ wrapper around strerror_r(), which looks up the error
18 * message string corresponding to an error number.
19 *
20 * @param errnum Error number
21 * @return message string
22 */
23std::string stringerror(int errnum);
24
25/**
26 * \brief Retrieve current user name.
27 *
28 * This is a thin C++ wrapper around getpwuid_r(), which obtains information
29 * from the system password database.
30 *
31 * @return user name corresponding to current process
32 */
33std::string current_username();
34
35/**
36 * \brief Retrieve current host name.
37 *
38 * This is a thin C++ wrapper around gethostname(), which gets the name of the
39 * current host.
40 *
41 * @return current host name
42 */
43std::string current_hostname();
44
45/**
46 * \brief Retrieve current domain name.
47 *
48 * This is a thin C++ wrapper around getdomainname(), which gets the standard
49 * NIS domain name for the current host.
50 *
51 * @return current domain name
52 */
53std::string current_domainname();
54
55} // namespace system
56} // namespace fles
57
58#endif // FLES_SYSTEM_H
Namespace for system-related utilty functions.
Definition System.h:13
std::string current_hostname()
Retrieve current host name.
std::string current_username()
Retrieve current user name.
std::string stringerror(int errnum)
Textual description of system error messages.
std::string current_domainname()
Retrieve current domain name.
Main FLES namespace.