Quick Links: |
#include <bdls_pipeutil.h>
Static Public Member Functions | |
static int | makeCanonicalName (bsl::string *pipeName, const bsl::string_view &baseName) |
static int | makeCanonicalName (std::string *pipeName, const bsl::string_view &baseName) |
static int | send (const bsl::string_view &pipeName, const bsl::string_view &message) |
static bool | isOpenForReading (const bsl::string_view &pipeName) |
This struct contains utility methods for platform-independent named pipe operations.
static int bdls::PipeUtil::makeCanonicalName | ( | bsl::string * | pipeName, | |
const bsl::string_view & | baseName | |||
) | [static] |
static int bdls::PipeUtil::makeCanonicalName | ( | std::string * | pipeName, | |
const bsl::string_view & | baseName | |||
) | [static] |
Load into the specified pipeName
the system-dependent canonical pipe name corresponding to the specified baseName
. Return 0 on success, and a nonzero value if baseName
cannot be part of a pipe name on this system. On Unix systems, if baseName
is not a full path name, the canonical name will be prefixed with the directory specified by the SOCKDIR
environment variable if it is set, otherwise with the directory specified by the TMPDIR
environment variable if it is set, and otherwise by the current directory. On Windows systems, if baseName
is not a full path name, the canonical name will be prefixed with "\\.\pipe\".
static int bdls::PipeUtil::send | ( | const bsl::string_view & | pipeName, | |
const bsl::string_view & | message | |||
) | [static] |
Send the specified message
to the pipe with the specified UTF-8 pipeName
. Return 0 on success, and a nonzero value otherwise. The behavior is undefined unless pipeName
is a valid UTF-8 string.
static bool bdls::PipeUtil::isOpenForReading | ( | const bsl::string_view & | pipeName | ) | [static] |
Return true
if the pipe with the specified UTF-8 pipeName
exists and is currently open for reading by some process, and false
otherwise. The behavior is undefined unless pipeName
is a valid UTF-8 string.