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 ();
154 optional<String> fTypePrintName;
155 optional<Containers::Set<FileSuffixType>> fFileSuffixes;
156 optional<FileSuffixType> fPreferredSuffix;
210 shared_ptr<IFrontendRep_> operator() (
const IFrontendRep_& t)
const;
212 using SharedRepByValuePtr_ =
215 SharedRepByValuePtr_ fFrontEndRep_;
217 static FrontendRep_ kDefaultFrontEndForNoBackend_;
261 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::Wildcards::kText, ct)")]]
bool IsTextFormat (
const InternetMediaType& ct)
const;
267 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::Wildcards::kImage,ct)")]]
bool IsImageFormat (
const InternetMediaType& ct)
const;
277 [[deprecated (
"Since Stroika v3.0d12 - use IsA (InternetMediaTypes::kXML,ct)")]] nonvirtual
bool IsXMLFormat (
const InternetMediaType& ct)
const;
330 template <
typename EXCEPTION = InternetMediaTypeNotSupportedException>
332 const EXCEPTION& throwIfNot = InternetMediaTypeNotSupportedException::kThe)
const;
339 [[deprecated (
"Since Stroika v3.0d10 - just set sThe")]]
static void Set (
const InternetMediaTypeRegistry& newRegistry)
352 virtual optional<FileSuffixType> GetPreferredAssociatedFileSuffix (
const InternetMediaType& ct)
const = 0;
354 virtual optional<String> GetAssociatedPrettyName (
const InternetMediaType& ct)
const = 0;
355 virtual optional<InternetMediaType> GetAssociatedContentType (
const FileSuffixType& fileNameOrSuffix)
const = 0;
366 virtual shared_ptr<IBackendRep> GetBackendRep ()
const = 0;
368 virtual optional<FileSuffixType> GetPreferredAssociatedFileSuffix (
const InternetMediaType& ct)
const = 0;
370 virtual optional<String> GetAssociatedPrettyName (
const InternetMediaType& ct)
const = 0;
371 virtual optional<InternetMediaType> GetAssociatedContentType (
const FileSuffixType& fileNameOrSuffix)
const = 0;
386 namespace InternetMediaTypes::Types {
418 namespace InternetMediaTypes::Wildcards {
437 namespace InternetMediaTypes {
564#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.