Nebula
Loading...
Searching...
No Matches
schemeregistry.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13#include "core/refcounted.h"
14#include "core/singleton.h"
16
17//------------------------------------------------------------------------------
18namespace IO
19{
21{
24public:
28 virtual ~SchemeRegistry();
29
31 void Setup();
33 void Discard();
35 bool IsValid() const;
36
38 void RegisterUriScheme(const Util::String& uriScheme, const Core::Rtti& classRtti);
40 void UnregisterUriScheme(const Util::String& uriScheme);
42 bool IsUriSchemeRegistered(const Util::String& uriScheme) const;
44 const Core::Rtti& GetStreamClassByUriScheme(const Util::String& uriScheme) const;
47
48private:
51
52 Threading::CriticalSection critSect;
54 bool isValid;
55};
56
57} // namespace IO
58//------------------------------------------------------------------------------
The common base class of Nebula.
Definition refcounted.h:38
Nebula's runtime type information for one class.
Definition rtti.h:27
bool IsUriSchemeRegistered(const Util::String &uriScheme) const
return true if an uri scheme has been registered
Definition schemeregistry.cc:122
bool IsValid() const
return true if the scheme registry is valid
Definition schemeregistry.cc:77
__DeclareInterfaceSingleton(SchemeRegistry)
void RegisterUriScheme(const Util::String &uriScheme, const Core::Rtti &classRtti)
associate an uri scheme with a stream class
Definition schemeregistry.cc:88
bool isValid
Definition schemeregistry.h:54
const Core::Rtti & GetStreamClassByUriScheme(const Util::String &uriScheme) const
get the registered stream class for an uri scheme
Definition schemeregistry.cc:135
void UnregisterUriScheme(const Util::String &uriScheme)
unregister an uri scheme
Definition schemeregistry.cc:107
void Discard()
discard the scheme registry
Definition schemeregistry.cc:62
virtual ~SchemeRegistry()
destructor
Definition schemeregistry.cc:34
Threading::CriticalSection critSect
Definition schemeregistry.h:52
Util::Dictionary< Util::String, const Core::Rtti * > schemeRegistry
Definition schemeregistry.h:53
SchemeRegistry()
constructor
Definition schemeregistry.cc:25
void Setup()
setup the scheme registry (may only be called at app startup by the main thread)
Definition schemeregistry.cc:47
__DeclareClass(SchemeRegistry)
Util::Array< Util::String > GetAllRegisteredUriSchemes() const
get an array of all registered schemes
Definition schemeregistry.cc:148
void SetupStandardSchemes()
register standard URI schemes, called by the Setup method
Definition schemeregistry.cc:162
Nebula's dynamic array class.
Definition array.h:60
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
Instances of wrapped stream classes.
Definition orientation.cc:10
Nebula's universal string class.
Definition String.cs:8