Loading...
Searching...
No Matches
juce_NamedPipe.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API NamedPipe final
{
public:
//==============================================================================
NamedPipe();
~NamedPipe();
//==============================================================================
bool openExisting (const String& pipeName);
bool createNewPipe (const String& pipeName, bool mustNotExist = false);
void close();
bool isOpen() const;
String getName() const;
//==============================================================================
int read (void* destBuffer, int maxBytesToRead, int timeOutMilliseconds);
int write (const void* sourceBuffer, int numBytesToWrite, int timeOutMilliseconds);
private:
//==============================================================================
JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl)
std::unique_ptr<Pimpl> pimpl;
String currentPipeName;
ReadWriteLock lock;
bool openInternal (const String& pipeName, bool createPipe, bool mustNotExist);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NamedPipe)
};
} // namespace juce
juce::NamedPipe::write
int write(const void *sourceBuffer, int numBytesToWrite, int timeOutMilliseconds)
juce::NamedPipe::read
int read(void *destBuffer, int maxBytesToRead, int timeOutMilliseconds)
juce::NamedPipe::getName
String getName() const
Definition juce_NamedPipe.cpp:59
juce::NamedPipe::isOpen
bool isOpen() const
Definition juce_NamedPipe.cpp:44
juce::NamedPipe::createNewPipe
bool createNewPipe(const String &pipeName, bool mustNotExist=false)
Definition juce_NamedPipe.cpp:50
juce::NamedPipe::NamedPipe
NamedPipe()
Definition juce_NamedPipe.cpp:28
juce::NamedPipe::openExisting
bool openExisting(const String &pipeName)
Definition juce_NamedPipe.cpp:35
juce::NamedPipe::close
void close()
juce::ReadWriteLock
Definition juce_ReadWriteLock.h:48
juce::String
Definition juce_String.h:53