4#ifndef _Stroika_Foundation_DataExchange_InternetMediaTypeRegistry_h_
5#define _Stroika_Foundation_DataExchange_InternetMediaTypeRegistry_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
13#include "Stroika/Foundation/Containers/Mapping.h"
14#include "Stroika/Foundation/Containers/Set.h"
16#include "Stroika/Foundation/DataExchange/InternetMediaTypeNotSupportedException.h"
29 using Characters::String;
30 using Containers::Mapping;
92#if qStroika_Foundation_Common_Platform_Windows
98 static shared_ptr<IBackendRep> WindowsRegistryDefaultBackend ();
156 optional<String> fTypePrintName;
157 optional<Containers::Set<FileSuffixType>> fFileSuffixes;
158 optional<FileSuffixType> fPreferredSuffix;
212 shared_ptr<IFrontendRep_> operator() (
const IFrontendRep_& t)
const;
214 using SharedRepByValuePtr_ =
217 SharedRepByValuePtr_ fFrontEndRep_;
219 static FrontendRep_ kDefaultFrontEndForNoBackend_;
263 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::Wildcards::kText, ct)")]]
bool IsTextFormat (
const InternetMediaType& ct)
const;
269 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::Wildcards::kImage,ct)")]]
bool IsImageFormat (
const InternetMediaType& ct)
const;
279 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::kXML,ct)")]] nonvirtual
bool IsXMLFormat (
const InternetMediaType& ct)
const;
332 template <
typename EXCEPTION = InternetMediaTypeNotSupportedException>
334 const EXCEPTION& throwIfNot = InternetMediaTypeNotSupportedException::kThe)
const;
341 [[deprecated (
"Since Stroika v3.0d10 - just set sThe")]]
static void Set (
const InternetMediaTypeRegistry& newRegistry)
354 virtual optional<FileSuffixType> GetPreferredAssociatedFileSuffix (
const InternetMediaType& ct)
const = 0;
356 virtual optional<String> GetAssociatedPrettyName (
const InternetMediaType& ct)
const = 0;
357 virtual optional<InternetMediaType> GetAssociatedContentType (
const FileSuffixType& fileNameOrSuffix)
const = 0;
368 virtual shared_ptr<IBackendRep> GetBackendRep ()
const = 0;
370 virtual optional<FileSuffixType> GetPreferredAssociatedFileSuffix (
const InternetMediaType& ct)
const = 0;
372 virtual optional<String> GetAssociatedPrettyName (
const InternetMediaType& ct)
const = 0;
373 virtual optional<InternetMediaType> GetAssociatedContentType (
const FileSuffixType& fileNameOrSuffix)
const = 0;
388 namespace InternetMediaTypes::Types {
420 namespace InternetMediaTypes::Wildcards {
439 namespace InternetMediaTypes {
566#include "InternetMediaTypeRegistry.inl"
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Set<T> is a container of T, where once an item is added, additionally adds () do nothing.
Wrap any object with Synchronized<> and it can be used similarly to the base type,...
SharedByValue is a utility class to implement Copy-On-Write (aka COW) - sort of halfway between uniqu...
Iterable<T> is a base class for containers which easily produce an Iterator<T> to traverse them.