yaze
0.3.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
bonjour_publisher.h
Go to the documentation of this file.
1
#ifndef YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
2
#define YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
3
4
#include <string>
5
6
#ifdef __APPLE__
7
#include <dns_sd.h>
8
#endif
9
10
namespace
yaze
{
11
namespace
cli {
12
namespace
api {
13
16
class
BonjourPublisher
{
17
public
:
18
BonjourPublisher
() =
default
;
19
~BonjourPublisher
();
20
22
void
Publish
(
int
port,
const
std::string& rom_title =
""
);
23
25
void
Unpublish
();
26
27
bool
IsPublished
()
const
{
return
published_
; }
28
31
bool
IsAvailable
()
const
{
32
#ifdef __APPLE__
33
return
true
;
34
#else
35
return
false
;
36
#endif
37
}
38
39
private
:
40
bool
published_
=
false
;
41
#ifdef __APPLE__
42
DNSServiceRef service_ref_ =
nullptr
;
43
#endif
44
};
45
46
}
// namespace api
47
}
// namespace cli
48
}
// namespace yaze
49
50
#endif
// YAZE_SRC_CLI_SERVICE_API_BONJOUR_PUBLISHER_H_
yaze::cli::api::BonjourPublisher
Definition
bonjour_publisher.h:16
yaze::cli::api::BonjourPublisher::published_
bool published_
Definition
bonjour_publisher.h:40
yaze::cli::api::BonjourPublisher::Unpublish
void Unpublish()
Stop advertising. Safe to call multiple times.
Definition
bonjour_publisher.cc:66
yaze::cli::api::BonjourPublisher::IsPublished
bool IsPublished() const
Definition
bonjour_publisher.h:27
yaze::cli::api::BonjourPublisher::~BonjourPublisher
~BonjourPublisher()
Definition
bonjour_publisher.cc:13
yaze::cli::api::BonjourPublisher::Publish
void Publish(int port, const std::string &rom_title="")
Start advertising. Call after the HTTP server socket is bound.
Definition
bonjour_publisher.cc:17
yaze::cli::api::BonjourPublisher::IsAvailable
bool IsAvailable() const
Definition
bonjour_publisher.h:31
yaze::cli::api::BonjourPublisher::BonjourPublisher
BonjourPublisher()=default
yaze
Definition
patch_export_usage.cc:8
src
cli
service
api
bonjour_publisher.h
Generated by
1.10.0