4#ifndef _Stroika_Frameworks_UPnP_SSDP_Advertisement_h_
5#define _Stroika_Frameworks_UPnP_SSDP_Advertisement_h_ 1
7#include "Stroika/Frameworks/StroikaPreComp.h"
13#include "Stroika/Foundation/Common/Common.h"
14#include "Stroika/Foundation/Containers/Mapping.h"
15#include "Stroika/Foundation/DataExchange/ObjectVariantMapper.h"
16#include "Stroika/Foundation/Execution/LazyInitialized.h"
17#include "Stroika/Foundation/IO/Network/SocketAddress.h"
29namespace Stroika::Frameworks::UPnP::SSDP {
31 using Foundation::Characters::String;
32 using Foundation::Containers::Mapping;
33 using Foundation::IO::Network::URI;
34 using Foundation::Memory::BLOB;
38 struct Advertisement {
39 optional<bool> fAlive;
44 Mapping<String, String> fRawHeaders;
46 bool operator== (
const Advertisement&)
const =
default;
51 static const Foundation::Execution::LazyInitialized<Foundation::DataExchange::ObjectVariantMapper> kMapper;
59 static Foundation::DataExchange::ObjectVariantMapper kMapperGetter_ ();
61 inline const Foundation::Execution::LazyInitialized<Foundation::DataExchange::ObjectVariantMapper> Advertisement::kMapper{Advertisement::kMapperGetter_};
65 static const String kTarget_UPNPRootDevice{
"upnp:rootdevice"sv};
69 static const String kTarget_SSDPAll{
"ssdp:all"sv};
73 enum class SearchOrNotify {
80 BLOB Serialize (
const String& headLine, SearchOrNotify searchOrNotify,
const Advertisement& ad);
84 void DeSerialize (
const BLOB& b, String* headLine, Advertisement* advertisement);
93#include "Advertisement.inl"
STRING_TYPE ToString(FLOAT_TYPE f, const ToStringOptions &options={})