BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdls::PipeUtil Struct Reference

#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)
 

Detailed Description

This struct contains utility methods for platform-independent named pipe operations.

Member Function Documentation

◆ isOpenForReading()

static bool bdls::PipeUtil::isOpenForReading ( const bsl::string_view pipeName)
static

Return true if the pipe with the specified UTF-8 pipeName exists, the calling process has permission to write to it, and some process is able to read the bytes written to it, and false otherwise. On Windows, this function may block and may write an "empty message", consisting of a single newline. The behavior is undefined unless pipeName is a valid UTF-8 string. Note that even though a process might have the pipe open for reading, this function might still return false because there are not sufficient resources available.

◆ makeCanonicalName() [1/2]

static int bdls::PipeUtil::makeCanonicalName ( bsl::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, the canonical name is defined by prefixing baseName 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, the canonical name is defined by prefixing baseName with "\\.\pipe\".

◆ makeCanonicalName() [2/2]

static int bdls::PipeUtil::makeCanonicalName ( std::string *  pipeName,
const bsl::string_view baseName 
)
static

Finally, any uppercase characters in baseName are converted to lower case in the canonical name.

◆ send()

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. message is output in a singlewrite' operation; consequently, messages that do not exceed the PIPE_BUF value (see Pipe Atomicity will not be interleaved even when multiple concurrent processes are writing to pipeName. The behavior is undefined unless pipeName is a valid UTF-8 string.


The documentation for this struct was generated from the following file: